SAP CM_EXTRACT_SAVE Function Module for
CM_EXTRACT_SAVE is a standard cm extract save SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 cm extract save FM, simply by entering the name CM_EXTRACT_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCM_EXTRACT_LEVEL2
Program Name: SAPLSCM_EXTRACT_LEVEL2
Main Program: SAPLSCM_EXTRACT_LEVEL2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CM_EXTRACT_SAVE 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 'CM_EXTRACT_SAVE'".
EXPORTING
I_REPORT = "
I_VARIANT = "
* I_USER = ' ' "
I_STRUCNAME = "
* I_CUT_OFF = ' ' "
TABLES
IT_TABLE = "
* IT_FIELDCAT_HLINK = "
* IT_HLINKS = "
IMPORTING Parameters details for CM_EXTRACT_SAVE
I_REPORT -
Data type: CMDISEXTR-REPORTOptional: No
Call by Reference: No ( called with pass by value option)
I_VARIANT -
Data type: CMDISEXTR-VRNTOptional: No
Call by Reference: No ( called with pass by value option)
I_USER -
Data type: CMDISEXTR-USERNAMEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_STRUCNAME -
Data type: CMEXTRDUM-TABNAMEOptional: No
Call by Reference: Yes
I_CUT_OFF -
Data type: CMEXTRDUM-CUT_OFFDefault: SPACE
Optional: Yes
Call by Reference: Yes
TABLES Parameters details for CM_EXTRACT_SAVE
IT_TABLE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
IT_FIELDCAT_HLINK -
Data type: LVC_S_FC2_WAOOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_HLINKS -
Data type: LVC_S_HYPE_WAOOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CM_EXTRACT_SAVE 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: | ||||
| lt_it_table | TYPE STANDARD TABLE OF STRING, " | |||
| lv_i_report | TYPE CMDISEXTR-REPORT, " | |||
| lv_i_variant | TYPE CMDISEXTR-VRNT, " | |||
| lt_it_fieldcat_hlink | TYPE STANDARD TABLE OF LVC_S_FC2_WAO, " | |||
| lv_i_user | TYPE CMDISEXTR-USERNAME, " SPACE | |||
| lt_it_hlinks | TYPE STANDARD TABLE OF LVC_S_HYPE_WAO, " | |||
| lv_i_strucname | TYPE CMEXTRDUM-TABNAME, " | |||
| lv_i_cut_off | TYPE CMEXTRDUM-CUT_OFF. " SPACE |
|   CALL FUNCTION 'CM_EXTRACT_SAVE' " |
| EXPORTING | ||
| I_REPORT | = lv_i_report | |
| I_VARIANT | = lv_i_variant | |
| I_USER | = lv_i_user | |
| I_STRUCNAME | = lv_i_strucname | |
| I_CUT_OFF | = lv_i_cut_off | |
| TABLES | ||
| IT_TABLE | = lt_it_table | |
| IT_FIELDCAT_HLINK | = lt_it_fieldcat_hlink | |
| IT_HLINKS | = lt_it_hlinks | |
| . " CM_EXTRACT_SAVE | ||
ABAP code using 7.40 inline data declarations to call FM CM_EXTRACT_SAVE
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.| "SELECT single REPORT FROM CMDISEXTR INTO @DATA(ld_i_report). | ||||
| "SELECT single VRNT FROM CMDISEXTR INTO @DATA(ld_i_variant). | ||||
| "SELECT single USERNAME FROM CMDISEXTR INTO @DATA(ld_i_user). | ||||
| DATA(ld_i_user) | = ' '. | |||
| "SELECT single TABNAME FROM CMEXTRDUM INTO @DATA(ld_i_strucname). | ||||
| "SELECT single CUT_OFF FROM CMEXTRDUM INTO @DATA(ld_i_cut_off). | ||||
| DATA(ld_i_cut_off) | = ' '. | |||
Search for further information about these or an SAP related objects