SAP CHANGEDOCUMENT_PREPARE_TABLES Function Module for Change document: Edit tables for change document
CHANGEDOCUMENT_PREPARE_TABLES is a standard changedocument prepare tables SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change document: Edit tables for change document processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for changedocument prepare tables FM, simply by entering the name CHANGEDOCUMENT_PREPARE_TABLES into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCD0
Program Name: SAPLSCD0
Main Program: SAPLSCD0
Appliation area: *
Release date: 22-Dec-1994
Mode(Normal, Remote etc): Normal Function Module
Update:
Function CHANGEDOCUMENT_PREPARE_TABLES pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CHANGEDOCUMENT_PREPARE_TABLES'"Change document: Edit tables for change document.
EXPORTING
* CHECK_INDICATOR = ' ' "Flag whether tables are to be changed
TABLENAME = "Name of the table structure of the internal tables
* CHECK_ONLY_LOGFLAGS = ' ' "Control Flag: Check Change Document-Relevant Fields Only
IMPORTING
RESULT = "Flag whether tables are identical
TABLES
TABLE_NEW = "Table contains the changed data
TABLE_OLD = "Table contains the unchanged data
EXCEPTIONS
NAMETAB_ERROR = 1 WRONG_STRUCTURE_LENGTH = 2
IMPORTING Parameters details for CHANGEDOCUMENT_PREPARE_TABLES
CHECK_INDICATOR - Flag whether tables are to be changed
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLENAME - Name of the table structure of the internal tables
Data type: CDPOS-TABNAMEOptional: No
Call by Reference: No ( called with pass by value option)
CHECK_ONLY_LOGFLAGS - Control Flag: Check Change Document-Relevant Fields Only
Data type: CDCHECK_LOGFLAGSDefault: SPACE
Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CHANGEDOCUMENT_PREPARE_TABLES
RESULT - Flag whether tables are identical
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CHANGEDOCUMENT_PREPARE_TABLES
TABLE_NEW - Table contains the changed data
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLE_OLD - Table contains the unchanged data
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NAMETAB_ERROR - Error when calling NAMETAB_GET
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_STRUCTURE_LENGTH - Table line not long enough to set indicator
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CHANGEDOCUMENT_PREPARE_TABLES Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_result | TYPE STRING, " | |||
lt_table_new | TYPE STANDARD TABLE OF STRING, " | |||
lv_nametab_error | TYPE STRING, " | |||
lv_check_indicator | TYPE STRING, " SPACE | |||
lv_tablename | TYPE CDPOS-TABNAME, " | |||
lt_table_old | TYPE STANDARD TABLE OF CDPOS, " | |||
lv_wrong_structure_length | TYPE CDPOS, " | |||
lv_check_only_logflags | TYPE CDCHECK_LOGFLAGS. " SPACE |
  CALL FUNCTION 'CHANGEDOCUMENT_PREPARE_TABLES' "Change document: Edit tables for change document |
EXPORTING | ||
CHECK_INDICATOR | = lv_check_indicator | |
TABLENAME | = lv_tablename | |
CHECK_ONLY_LOGFLAGS | = lv_check_only_logflags | |
IMPORTING | ||
RESULT | = lv_result | |
TABLES | ||
TABLE_NEW | = lt_table_new | |
TABLE_OLD | = lt_table_old | |
EXCEPTIONS | ||
NAMETAB_ERROR = 1 | ||
WRONG_STRUCTURE_LENGTH = 2 | ||
. " CHANGEDOCUMENT_PREPARE_TABLES |
ABAP code using 7.40 inline data declarations to call FM CHANGEDOCUMENT_PREPARE_TABLES
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.DATA(ld_check_indicator) | = ' '. | |||
"SELECT single TABNAME FROM CDPOS INTO @DATA(ld_tablename). | ||||
DATA(ld_check_only_logflags) | = ' '. | |||
Search for further information about these or an SAP related objects