SAP COCF_GET_ORDER Function Module for Retrieve order header details
COCF_GET_ORDER is a standard cocf get order SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Retrieve order header details 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 cocf get order FM, simply by entering the name COCF_GET_ORDER into the relevant SAP transaction such as SE37 or SE38.
Function Group: COCF_MD_DP
Program Name: SAPLCOCF_MD_DP
Main Program: SAPLCOCF_MD_DP
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function COCF_GET_ORDER 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 'COCF_GET_ORDER'"Retrieve order header details.
EXPORTING
* I_REQUNR = "
* I_ISOURCE = "
* I_MAXSIZE = "
* I_INITFLAG = "
* I_UPDMODE = "
* I_DATAPAKID = "
TABLES
* I_T_SELECT = "
* I_T_FIELDS = "
* E_T_COCF_ORDER_HDR = "PP Order header
* CT_IOHEADER = "Database structure for order headers and items
* CT_IOITEM = "Database structure for order items
* CT_IOOPER = "Database structure for operations in order
EXCEPTIONS
ERROR_PASSED_TO_MESS_HANDLER = 1 NO_MORE_DATA = 2
IMPORTING Parameters details for COCF_GET_ORDER
I_REQUNR -
Data type: SBIWA_S_INTERFACE-REQUNROptional: Yes
Call by Reference: Yes
I_ISOURCE -
Data type: SBIWA_S_INTERFACE-ISOURCEOptional: Yes
Call by Reference: Yes
I_MAXSIZE -
Data type: SBIWA_S_INTERFACE-MAXSIZEOptional: Yes
Call by Reference: Yes
I_INITFLAG -
Data type: SBIWA_S_INTERFACE-INITFLAGOptional: Yes
Call by Reference: Yes
I_UPDMODE -
Data type: SBIWA_S_INTERFACE-UPDMODEOptional: Yes
Call by Reference: Yes
I_DATAPAKID -
Data type: SBIWA_S_INTERFACE-DATAPAKIDOptional: Yes
Call by Reference: Yes
TABLES Parameters details for COCF_GET_ORDER
I_T_SELECT -
Data type: SBIWA_T_SELECTOptional: Yes
Call by Reference: No ( called with pass by value option)
I_T_FIELDS -
Data type: SBIWA_T_FIELDSOptional: Yes
Call by Reference: No ( called with pass by value option)
E_T_COCF_ORDER_HDR - PP Order header
Data type: COCF_ORDER_HDROptional: Yes
Call by Reference: No ( called with pass by value option)
CT_IOHEADER - Database structure for order headers and items
Data type: IOHEADEROptional: Yes
Call by Reference: Yes
CT_IOITEM - Database structure for order items
Data type: IOITEMOptional: Yes
Call by Reference: Yes
CT_IOOPER - Database structure for operations in order
Data type: IOOPEROptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ERROR_PASSED_TO_MESS_HANDLER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_MORE_DATA -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for COCF_GET_ORDER 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_requnr | TYPE SBIWA_S_INTERFACE-REQUNR, " | |||
| lt_i_t_select | TYPE STANDARD TABLE OF SBIWA_T_SELECT, " | |||
| lv_error_passed_to_mess_handler | TYPE SBIWA_T_SELECT, " | |||
| lv_i_isource | TYPE SBIWA_S_INTERFACE-ISOURCE, " | |||
| lt_i_t_fields | TYPE STANDARD TABLE OF SBIWA_T_FIELDS, " | |||
| lv_no_more_data | TYPE SBIWA_T_FIELDS, " | |||
| lv_i_maxsize | TYPE SBIWA_S_INTERFACE-MAXSIZE, " | |||
| lt_e_t_cocf_order_hdr | TYPE STANDARD TABLE OF COCF_ORDER_HDR, " | |||
| lv_i_initflag | TYPE SBIWA_S_INTERFACE-INITFLAG, " | |||
| lt_ct_ioheader | TYPE STANDARD TABLE OF IOHEADER, " | |||
| lt_ct_ioitem | TYPE STANDARD TABLE OF IOITEM, " | |||
| lv_i_updmode | TYPE SBIWA_S_INTERFACE-UPDMODE, " | |||
| lt_ct_iooper | TYPE STANDARD TABLE OF IOOPER, " | |||
| lv_i_datapakid | TYPE SBIWA_S_INTERFACE-DATAPAKID. " |
|   CALL FUNCTION 'COCF_GET_ORDER' "Retrieve order header details |
| EXPORTING | ||
| I_REQUNR | = lv_i_requnr | |
| I_ISOURCE | = lv_i_isource | |
| I_MAXSIZE | = lv_i_maxsize | |
| I_INITFLAG | = lv_i_initflag | |
| I_UPDMODE | = lv_i_updmode | |
| I_DATAPAKID | = lv_i_datapakid | |
| TABLES | ||
| I_T_SELECT | = lt_i_t_select | |
| I_T_FIELDS | = lt_i_t_fields | |
| E_T_COCF_ORDER_HDR | = lt_e_t_cocf_order_hdr | |
| CT_IOHEADER | = lt_ct_ioheader | |
| CT_IOITEM | = lt_ct_ioitem | |
| CT_IOOPER | = lt_ct_iooper | |
| EXCEPTIONS | ||
| ERROR_PASSED_TO_MESS_HANDLER = 1 | ||
| NO_MORE_DATA = 2 | ||
| . " COCF_GET_ORDER | ||
ABAP code using 7.40 inline data declarations to call FM COCF_GET_ORDER
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 REQUNR FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_requnr). | ||||
| "SELECT single ISOURCE FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_isource). | ||||
| "SELECT single MAXSIZE FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_maxsize). | ||||
| "SELECT single INITFLAG FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_initflag). | ||||
| "SELECT single UPDMODE FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_updmode). | ||||
| "SELECT single DATAPAKID FROM SBIWA_S_INTERFACE INTO @DATA(ld_i_datapakid). | ||||
Search for further information about these or an SAP related objects