SAP OIJB_GENERATE_DOCUMENTS Function Module for OIL-TSW: Create documents
OIJB_GENERATE_DOCUMENTS is a standard oijb generate documents SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for OIL-TSW: Create documents 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 oijb generate documents FM, simply by entering the name OIJB_GENERATE_DOCUMENTS into the relevant SAP transaction such as SE37 or SE38.
Function Group: OIJB
Program Name: SAPLOIJB
Main Program: SAPLOIJB
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OIJB_GENERATE_DOCUMENTS 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 'OIJB_GENERATE_DOCUMENTS'"OIL-TSW: Create documents.
EXPORTING
I_TICKET_HEADER = "Universal ticket table
I_TICKET_ITEM = "Universal ticket item table
I_TICKET_HEADER_PV = "Universal ticket table
I_TICKET_ITEM_PV = "Universal ticket item table
I_OIJNOMH = "
I_OIJNOMI = "
I_ISTAT = "Status of Oijnomi after successful Postings
* I_CLOSE_SHIPMENT = ' ' "
* I_E1OIPC1 = "IDoc: Oil Document item ASTM conversion parameters
TABLES
* T_AUOM = "OIL-TSW: Ticket additional units of measure
* T_DOC_FLOW = "OIL-TSW: Structure for document flow
* T_ERR_LOG = "OIL-TSW: Structure for error log for ticketing process
* T_REVERSAL_DOCS = "OIL-TSW: Structure for reversal tickets
* T_ORIGINAL_DOCS = "OIL-TSW: Structure for reversal tickets
* T_OIJNOMSUBITEMS = "Nomination Sub-Item
EXCEPTIONS
ERROR_DURING_CIP_PROCESS = 1 ERROR_UPDATE_DATABASE = 2
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLOIJB_001 TSW: user exits for customer
EXIT_SAPLOIJB_002 TSW: user exits for customer handling of mvmt scenairo
EXIT_SAPLOIJB_003 TSW : User exits to do Rebrands
IMPORTING Parameters details for OIJB_GENERATE_DOCUMENTS
I_TICKET_HEADER - Universal ticket table
Data type: OIJ_EL_TICKET_HOptional: No
Call by Reference: No ( called with pass by value option)
I_TICKET_ITEM - Universal ticket item table
Data type: OIJ_EL_TICKET_IOptional: No
Call by Reference: No ( called with pass by value option)
I_TICKET_HEADER_PV - Universal ticket table
Data type: OIJ_EL_TICKET_HOptional: No
Call by Reference: No ( called with pass by value option)
I_TICKET_ITEM_PV - Universal ticket item table
Data type: OIJ_EL_TICKET_IOptional: No
Call by Reference: No ( called with pass by value option)
I_OIJNOMH -
Data type: OIJNOMHOptional: No
Call by Reference: No ( called with pass by value option)
I_OIJNOMI -
Data type: OIJNOMIOptional: No
Call by Reference: No ( called with pass by value option)
I_ISTAT - Status of Oijnomi after successful Postings
Data type: OIJNOMI-ISTATOptional: No
Call by Reference: No ( called with pass by value option)
I_CLOSE_SHIPMENT -
Data type: OIJNOMI-ISTATDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_E1OIPC1 - IDoc: Oil Document item ASTM conversion parameters
Data type: E1OIPC1Optional: Yes
Call by Reference: Yes
TABLES Parameters details for OIJB_GENERATE_DOCUMENTS
T_AUOM - OIL-TSW: Ticket additional units of measure
Data type: OIJ_EL_TICKET_UOM_STROptional: Yes
Call by Reference: Yes
T_DOC_FLOW - OIL-TSW: Structure for document flow
Data type: OIJ_EL_DOC_FLOW_STROptional: Yes
Call by Reference: Yes
T_ERR_LOG - OIL-TSW: Structure for error log for ticketing process
Data type: OIJ_EL_ERROR_LOG_STROptional: Yes
Call by Reference: Yes
T_REVERSAL_DOCS - OIL-TSW: Structure for reversal tickets
Data type: ROIJREVDOCOptional: Yes
Call by Reference: Yes
T_ORIGINAL_DOCS - OIL-TSW: Structure for reversal tickets
Data type: ROIJREVDOCOptional: Yes
Call by Reference: Yes
T_OIJNOMSUBITEMS - Nomination Sub-Item
Data type: OIJNOMSUBITEMSOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ERROR_DURING_CIP_PROCESS -
Data type:Optional: No
Call by Reference: Yes
ERROR_UPDATE_DATABASE -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for OIJB_GENERATE_DOCUMENTS 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_t_auom | TYPE STANDARD TABLE OF OIJ_EL_TICKET_UOM_STR, " | |||
| lv_i_ticket_header | TYPE OIJ_EL_TICKET_H, " | |||
| lv_error_during_cip_process | TYPE OIJ_EL_TICKET_H, " | |||
| lt_t_doc_flow | TYPE STANDARD TABLE OF OIJ_EL_DOC_FLOW_STR, " | |||
| lv_i_ticket_item | TYPE OIJ_EL_TICKET_I, " | |||
| lv_error_update_database | TYPE OIJ_EL_TICKET_I, " | |||
| lt_t_err_log | TYPE STANDARD TABLE OF OIJ_EL_ERROR_LOG_STR, " | |||
| lv_i_ticket_header_pv | TYPE OIJ_EL_TICKET_H, " | |||
| lt_t_reversal_docs | TYPE STANDARD TABLE OF ROIJREVDOC, " | |||
| lv_i_ticket_item_pv | TYPE OIJ_EL_TICKET_I, " | |||
| lv_i_oijnomh | TYPE OIJNOMH, " | |||
| lt_t_original_docs | TYPE STANDARD TABLE OF ROIJREVDOC, " | |||
| lv_i_oijnomi | TYPE OIJNOMI, " | |||
| lt_t_oijnomsubitems | TYPE STANDARD TABLE OF OIJNOMSUBITEMS, " | |||
| lv_i_istat | TYPE OIJNOMI-ISTAT, " | |||
| lv_i_close_shipment | TYPE OIJNOMI-ISTAT, " ' ' | |||
| lv_i_e1oipc1 | TYPE E1OIPC1. " |
|   CALL FUNCTION 'OIJB_GENERATE_DOCUMENTS' "OIL-TSW: Create documents |
| EXPORTING | ||
| I_TICKET_HEADER | = lv_i_ticket_header | |
| I_TICKET_ITEM | = lv_i_ticket_item | |
| I_TICKET_HEADER_PV | = lv_i_ticket_header_pv | |
| I_TICKET_ITEM_PV | = lv_i_ticket_item_pv | |
| I_OIJNOMH | = lv_i_oijnomh | |
| I_OIJNOMI | = lv_i_oijnomi | |
| I_ISTAT | = lv_i_istat | |
| I_CLOSE_SHIPMENT | = lv_i_close_shipment | |
| I_E1OIPC1 | = lv_i_e1oipc1 | |
| TABLES | ||
| T_AUOM | = lt_t_auom | |
| T_DOC_FLOW | = lt_t_doc_flow | |
| T_ERR_LOG | = lt_t_err_log | |
| T_REVERSAL_DOCS | = lt_t_reversal_docs | |
| T_ORIGINAL_DOCS | = lt_t_original_docs | |
| T_OIJNOMSUBITEMS | = lt_t_oijnomsubitems | |
| EXCEPTIONS | ||
| ERROR_DURING_CIP_PROCESS = 1 | ||
| ERROR_UPDATE_DATABASE = 2 | ||
| . " OIJB_GENERATE_DOCUMENTS | ||
ABAP code using 7.40 inline data declarations to call FM OIJB_GENERATE_DOCUMENTS
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 ISTAT FROM OIJNOMI INTO @DATA(ld_i_istat). | ||||
| "SELECT single ISTAT FROM OIJNOMI INTO @DATA(ld_i_close_shipment). | ||||
| DATA(ld_i_close_shipment) | = ' '. | |||
Search for further information about these or an SAP related objects