SAP CO_DB_ORDER_PRE_READ Function Module for Einlesen von Aufträgen in Belegtabellen
CO_DB_ORDER_PRE_READ is a standard co db order pre read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Einlesen von Aufträgen in Belegtabellen 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 co db order pre read FM, simply by entering the name CO_DB_ORDER_PRE_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: CODB
Program Name: SAPLCODB
Main Program: SAPLCODB
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CO_DB_ORDER_PRE_READ 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 'CO_DB_ORDER_PRE_READ'"Einlesen von Aufträgen in Belegtabellen.
EXPORTING
* FLG_CHECK_HEADER = ' ' "
* FLG_PRE_READ_WORK_C = 'X' "Read work centers per PRE_READ
* NUMBER_OF_TASKS = 1 "Number of parallel tasks that should be used
* FLG_NO_EXTERNAL = ' ' "
* T490_IMP = "
* CAUFV_SINGLE_IMP = "
* FLG_NO_BANF = "
* FLG_NO_GOS = ' ' "
* TRTYP_SAV = ' ' "
* CLIENT = SY-MANDT "Client (still not completely implemented)
* FLG_CHECK = ' ' "Flag, whether the document tables are checked
* OBJECTS = ' ' "Entry of objects that are to be read
* TRTYP_IMP = 'A' "Transaction type 'A'=display, 'V'=change
* FLG_NO_GUI_MESSAGE = ' ' "Indicator: Do not display any GUI message
* EXPLODE_ORD_NET = ' ' "Indicator: Explode and import order network
* FLG_CALLED_TO_COPY = ' ' "Indicator: Call from copy order (BANFEN)
* IMPORT_MESSAGE_ID = ' ' "Message ID under which date in memory
TABLES
ORD_PRE_IMP = "Table of order/network numbers
EXCEPTIONS
NOT_FOUND = 1 RELEASE_NO_CHANGE = 2
IMPORTING Parameters details for CO_DB_ORDER_PRE_READ
FLG_CHECK_HEADER -
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_PRE_READ_WORK_C - Read work centers per PRE_READ
Data type: RC27X-FLG_SELDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NUMBER_OF_TASKS - Number of parallel tasks that should be used
Data type: SY-DBCNTDefault: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_NO_EXTERNAL -
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
T490_IMP -
Data type: T490Optional: Yes
Call by Reference: No ( called with pass by value option)
CAUFV_SINGLE_IMP -
Data type: CAUFVOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_NO_BANF -
Data type: RC27X-FLG_SELOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_NO_GOS -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TRTYP_SAV -
Data type: TC10-TRTYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CLIENT - Client (still not completely implemented)
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_CHECK - Flag, whether the document tables are checked
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECTS - Entry of objects that are to be read
Data type: TCA11Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TRTYP_IMP - Transaction type 'A'=display, 'V'=change
Data type: TC10-TRTYPDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_NO_GUI_MESSAGE - Indicator: Do not display any GUI message
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPLODE_ORD_NET - Indicator: Explode and import order network
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_CALLED_TO_COPY - Indicator: Call from copy order (BANFEN)
Data type: RC27X-FLG_SELDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMPORT_MESSAGE_ID - Message ID under which date in memory
Data type: INDX-SRTFDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CO_DB_ORDER_PRE_READ
ORD_PRE_IMP - Table of order/network numbers
Data type: ORD_PREOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND - Order(s) not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
RELEASE_NO_CHANGE - Error due to release status BANF
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CO_DB_ORDER_PRE_READ 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_not_found | TYPE STRING, " | |||
| lt_ord_pre_imp | TYPE STANDARD TABLE OF ORD_PRE, " | |||
| lv_flg_check_header | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_flg_pre_read_work_c | TYPE RC27X-FLG_SEL, " 'X' | |||
| lv_number_of_tasks | TYPE SY-DBCNT, " 1 | |||
| lv_flg_no_external | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_t490_imp | TYPE T490, " | |||
| lv_caufv_single_imp | TYPE CAUFV, " | |||
| lv_flg_no_banf | TYPE RC27X-FLG_SEL, " | |||
| lv_flg_no_gos | TYPE C, " SPACE | |||
| lv_trtyp_sav | TYPE TC10-TRTYP, " SPACE | |||
| lv_client | TYPE SY-MANDT, " SY-MANDT | |||
| lv_release_no_change | TYPE SY, " | |||
| lv_flg_check | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_objects | TYPE TCA11, " SPACE | |||
| lv_trtyp_imp | TYPE TC10-TRTYP, " 'A' | |||
| lv_flg_no_gui_message | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_explode_ord_net | TYPE RC27X, " SPACE | |||
| lv_flg_called_to_copy | TYPE RC27X-FLG_SEL, " SPACE | |||
| lv_import_message_id | TYPE INDX-SRTFD. " SPACE |
|   CALL FUNCTION 'CO_DB_ORDER_PRE_READ' "Einlesen von Aufträgen in Belegtabellen |
| EXPORTING | ||
| FLG_CHECK_HEADER | = lv_flg_check_header | |
| FLG_PRE_READ_WORK_C | = lv_flg_pre_read_work_c | |
| NUMBER_OF_TASKS | = lv_number_of_tasks | |
| FLG_NO_EXTERNAL | = lv_flg_no_external | |
| T490_IMP | = lv_t490_imp | |
| CAUFV_SINGLE_IMP | = lv_caufv_single_imp | |
| FLG_NO_BANF | = lv_flg_no_banf | |
| FLG_NO_GOS | = lv_flg_no_gos | |
| TRTYP_SAV | = lv_trtyp_sav | |
| CLIENT | = lv_client | |
| FLG_CHECK | = lv_flg_check | |
| OBJECTS | = lv_objects | |
| TRTYP_IMP | = lv_trtyp_imp | |
| FLG_NO_GUI_MESSAGE | = lv_flg_no_gui_message | |
| EXPLODE_ORD_NET | = lv_explode_ord_net | |
| FLG_CALLED_TO_COPY | = lv_flg_called_to_copy | |
| IMPORT_MESSAGE_ID | = lv_import_message_id | |
| TABLES | ||
| ORD_PRE_IMP | = lt_ord_pre_imp | |
| EXCEPTIONS | ||
| NOT_FOUND = 1 | ||
| RELEASE_NO_CHANGE = 2 | ||
| . " CO_DB_ORDER_PRE_READ | ||
ABAP code using 7.40 inline data declarations to call FM CO_DB_ORDER_PRE_READ
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 FLG_SEL FROM RC27X INTO @DATA(ld_flg_check_header). | ||||
| DATA(ld_flg_check_header) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_pre_read_work_c). | ||||
| DATA(ld_flg_pre_read_work_c) | = 'X'. | |||
| "SELECT single DBCNT FROM SY INTO @DATA(ld_number_of_tasks). | ||||
| DATA(ld_number_of_tasks) | = 1. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_no_external). | ||||
| DATA(ld_flg_no_external) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_no_banf). | ||||
| DATA(ld_flg_no_gos) | = ' '. | |||
| "SELECT single TRTYP FROM TC10 INTO @DATA(ld_trtyp_sav). | ||||
| DATA(ld_trtyp_sav) | = ' '. | |||
| "SELECT single MANDT FROM SY INTO @DATA(ld_client). | ||||
| DATA(ld_client) | = SY-MANDT. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_check). | ||||
| DATA(ld_flg_check) | = ' '. | |||
| DATA(ld_objects) | = ' '. | |||
| "SELECT single TRTYP FROM TC10 INTO @DATA(ld_trtyp_imp). | ||||
| DATA(ld_trtyp_imp) | = 'A'. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_no_gui_message). | ||||
| DATA(ld_flg_no_gui_message) | = ' '. | |||
| DATA(ld_explode_ord_net) | = ' '. | |||
| "SELECT single FLG_SEL FROM RC27X INTO @DATA(ld_flg_called_to_copy). | ||||
| DATA(ld_flg_called_to_copy) | = ' '. | |||
| "SELECT single SRTFD FROM INDX INTO @DATA(ld_import_message_id). | ||||
| DATA(ld_import_message_id) | = ' '. | |||
Search for further information about these or an SAP related objects