SAP CMS_MIG_AST_CREATE Function Module for Wrapper FM on Asset create Mapi for idoc creation
CMS_MIG_AST_CREATE is a standard cms mig ast create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Wrapper FM on Asset create Mapi for idoc creation 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 cms mig ast create FM, simply by entering the name CMS_MIG_AST_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: CMS_MIG_AST
Program Name: SAPLCMS_MIG_AST
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function CMS_MIG_AST_CREATE 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 'CMS_MIG_AST_CREATE'"Wrapper FM on Asset create Mapi for idoc creation.
EXPORTING
I_AST_TYP = "Asset Type
I_STR_ADMINORG = "Administrative organization unit
I_STR_AST_DETAILS = "Asset details
* I_FLG_UPDATE_TASK = 'X' "Flag: Use update task to save data
* I_FLG_COMMIT = ' ' "Indicator
IMPORTING
E_STR_AST_SKY = "Semantic Key for Table CMS_AST
E_STR_RETURN = "Return Parameter
TABLES
* I_TAB_SAS_DETAILS = "Sub-asset details
* I_TAB_AST_BP = "Business Partners for an Asset
* I_TAB_SAS_BP = "Business partners for the sub-assets
* I_TAB_AST_DOC = "Documents for an Asset
* I_TAB_SAS_DOC = "Documents for the Sub-assets
* I_TAB_AST_NOTES = "Text lines
IMPORTING Parameters details for CMS_MIG_AST_CREATE
I_AST_TYP - Asset Type
Data type: CMS_AST-AST_TYPOptional: No
Call by Reference: No ( called with pass by value option)
I_STR_ADMINORG - Administrative organization unit
Data type: CMS_STR_ADMINORGOptional: No
Call by Reference: No ( called with pass by value option)
I_STR_AST_DETAILS - Asset details
Data type: CMS_STR_AST_DETAILS_MAP_CREATEOptional: No
Call by Reference: No ( called with pass by value option)
I_FLG_UPDATE_TASK - Flag: Use update task to save data
Data type: CMS_STR_FLG-FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_COMMIT - Indicator
Data type: CMS_STR_FLG-FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CMS_MIG_AST_CREATE
E_STR_AST_SKY - Semantic Key for Table CMS_AST
Data type: CMS_STR_AST_SKYOptional: No
Call by Reference: No ( called with pass by value option)
E_STR_RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CMS_MIG_AST_CREATE
I_TAB_SAS_DETAILS - Sub-asset details
Data type: CMS_STR_SAS_DETAILS_MAPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TAB_AST_BP - Business Partners for an Asset
Data type: CMS_STR_AST_BP_MAPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TAB_SAS_BP - Business partners for the sub-assets
Data type: CMS_STR_SAS_BP_MAPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TAB_AST_DOC - Documents for an Asset
Data type: CMS_STR_AST_DOC_MAPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TAB_SAS_DOC - Documents for the Sub-assets
Data type: CMS_STR_SAS_DOC_MAPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TAB_AST_NOTES - Text lines
Data type: TLINEOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CMS_MIG_AST_CREATE 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_i_ast_typ | TYPE CMS_AST-AST_TYP, " | |||
| lv_e_str_ast_sky | TYPE CMS_STR_AST_SKY, " | |||
| lt_i_tab_sas_details | TYPE STANDARD TABLE OF CMS_STR_SAS_DETAILS_MAP, " | |||
| lv_e_str_return | TYPE BAPIRET2, " | |||
| lt_i_tab_ast_bp | TYPE STANDARD TABLE OF CMS_STR_AST_BP_MAP, " | |||
| lv_i_str_adminorg | TYPE CMS_STR_ADMINORG, " | |||
| lt_i_tab_sas_bp | TYPE STANDARD TABLE OF CMS_STR_SAS_BP_MAP, " | |||
| lv_i_str_ast_details | TYPE CMS_STR_AST_DETAILS_MAP_CREATE, " | |||
| lt_i_tab_ast_doc | TYPE STANDARD TABLE OF CMS_STR_AST_DOC_MAP, " | |||
| lv_i_flg_update_task | TYPE CMS_STR_FLG-FLAG, " 'X' | |||
| lv_i_flg_commit | TYPE CMS_STR_FLG-FLAG, " SPACE | |||
| lt_i_tab_sas_doc | TYPE STANDARD TABLE OF CMS_STR_SAS_DOC_MAP, " | |||
| lt_i_tab_ast_notes | TYPE STANDARD TABLE OF TLINE. " |
|   CALL FUNCTION 'CMS_MIG_AST_CREATE' "Wrapper FM on Asset create Mapi for idoc creation |
| EXPORTING | ||
| I_AST_TYP | = lv_i_ast_typ | |
| I_STR_ADMINORG | = lv_i_str_adminorg | |
| I_STR_AST_DETAILS | = lv_i_str_ast_details | |
| I_FLG_UPDATE_TASK | = lv_i_flg_update_task | |
| I_FLG_COMMIT | = lv_i_flg_commit | |
| IMPORTING | ||
| E_STR_AST_SKY | = lv_e_str_ast_sky | |
| E_STR_RETURN | = lv_e_str_return | |
| TABLES | ||
| I_TAB_SAS_DETAILS | = lt_i_tab_sas_details | |
| I_TAB_AST_BP | = lt_i_tab_ast_bp | |
| I_TAB_SAS_BP | = lt_i_tab_sas_bp | |
| I_TAB_AST_DOC | = lt_i_tab_ast_doc | |
| I_TAB_SAS_DOC | = lt_i_tab_sas_doc | |
| I_TAB_AST_NOTES | = lt_i_tab_ast_notes | |
| . " CMS_MIG_AST_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM CMS_MIG_AST_CREATE
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 AST_TYP FROM CMS_AST INTO @DATA(ld_i_ast_typ). | ||||
| "SELECT single FLAG FROM CMS_STR_FLG INTO @DATA(ld_i_flg_update_task). | ||||
| DATA(ld_i_flg_update_task) | = 'X'. | |||
| "SELECT single FLAG FROM CMS_STR_FLG INTO @DATA(ld_i_flg_commit). | ||||
| DATA(ld_i_flg_commit) | = ' '. | |||
Search for further information about these or an SAP related objects