SAP CO2M_COMPONENT_CREATE_WITH_REF Function Module for NOTRANSL: Network: create component with reference
CO2M_COMPONENT_CREATE_WITH_REF is a standard co2m component create with ref SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Network: create component with reference 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 co2m component create with ref FM, simply by entering the name CO2M_COMPONENT_CREATE_WITH_REF into the relevant SAP transaction such as SE37 or SE38.
Function Group: CO2M
Program Name: SAPLCO2M
Main Program: SAPLCO2M
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CO2M_COMPONENT_CREATE_WITH_REF 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 'CO2M_COMPONENT_CREATE_WITH_REF'"NOTRANSL: Network: create component with reference.
EXPORTING
I_AUFPL = "Routing number of operations in the order
I_APLZL = "Internal counter
* I_VERSION_DESTINATION = "Number or description of a version
I_RESBD_NEW = "Reservation/Dependent requirements
IMPORTING
E_RSNUM = "Number of Reservation/Dependent Requirement
E_RSPOS = "Item Number of Reservation/Dependent Requirement
E_RSART = "Record type
E_OBJNR = "Object number
E_INDBT = "Field defined as in SY-TABIX
EXCEPTIONS
ERROR_OCCURED = 1
IMPORTING Parameters details for CO2M_COMPONENT_CREATE_WITH_REF
I_AUFPL - Routing number of operations in the order
Data type: RESBD-AUFPLOptional: No
Call by Reference: No ( called with pass by value option)
I_APLZL - Internal counter
Data type: RESBD-APLZLOptional: No
Call by Reference: No ( called with pass by value option)
I_VERSION_DESTINATION - Number or description of a version
Data type: VSKOPF-VSNMROptional: Yes
Call by Reference: No ( called with pass by value option)
I_RESBD_NEW - Reservation/Dependent requirements
Data type: RESBDOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CO2M_COMPONENT_CREATE_WITH_REF
E_RSNUM - Number of Reservation/Dependent Requirement
Data type: RESB-RSNUMOptional: No
Call by Reference: No ( called with pass by value option)
E_RSPOS - Item Number of Reservation/Dependent Requirement
Data type: RESB-RSPOSOptional: No
Call by Reference: No ( called with pass by value option)
E_RSART - Record type
Data type: RESB-RSARTOptional: No
Call by Reference: No ( called with pass by value option)
E_OBJNR - Object number
Data type: RESB-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
E_INDBT - Field defined as in SY-TABIX
Data type: RESBD-INDBTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR_OCCURED -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CO2M_COMPONENT_CREATE_WITH_REF 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_e_rsnum | TYPE RESB-RSNUM, " | |||
| lv_i_aufpl | TYPE RESBD-AUFPL, " | |||
| lv_error_occured | TYPE RESBD, " | |||
| lv_e_rspos | TYPE RESB-RSPOS, " | |||
| lv_i_aplzl | TYPE RESBD-APLZL, " | |||
| lv_e_rsart | TYPE RESB-RSART, " | |||
| lv_i_version_destination | TYPE VSKOPF-VSNMR, " | |||
| lv_e_objnr | TYPE RESB-OBJNR, " | |||
| lv_i_resbd_new | TYPE RESBD, " | |||
| lv_e_indbt | TYPE RESBD-INDBT. " |
|   CALL FUNCTION 'CO2M_COMPONENT_CREATE_WITH_REF' "NOTRANSL: Network: create component with reference |
| EXPORTING | ||
| I_AUFPL | = lv_i_aufpl | |
| I_APLZL | = lv_i_aplzl | |
| I_VERSION_DESTINATION | = lv_i_version_destination | |
| I_RESBD_NEW | = lv_i_resbd_new | |
| IMPORTING | ||
| E_RSNUM | = lv_e_rsnum | |
| E_RSPOS | = lv_e_rspos | |
| E_RSART | = lv_e_rsart | |
| E_OBJNR | = lv_e_objnr | |
| E_INDBT | = lv_e_indbt | |
| EXCEPTIONS | ||
| ERROR_OCCURED = 1 | ||
| . " CO2M_COMPONENT_CREATE_WITH_REF | ||
ABAP code using 7.40 inline data declarations to call FM CO2M_COMPONENT_CREATE_WITH_REF
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 RSNUM FROM RESB INTO @DATA(ld_e_rsnum). | ||||
| "SELECT single AUFPL FROM RESBD INTO @DATA(ld_i_aufpl). | ||||
| "SELECT single RSPOS FROM RESB INTO @DATA(ld_e_rspos). | ||||
| "SELECT single APLZL FROM RESBD INTO @DATA(ld_i_aplzl). | ||||
| "SELECT single RSART FROM RESB INTO @DATA(ld_e_rsart). | ||||
| "SELECT single VSNMR FROM VSKOPF INTO @DATA(ld_i_version_destination). | ||||
| "SELECT single OBJNR FROM RESB INTO @DATA(ld_e_objnr). | ||||
| "SELECT single INDBT FROM RESBD INTO @DATA(ld_e_indbt). | ||||
Search for further information about these or an SAP related objects