SAP OIK_LOG_DOCUMENT Function Module for Log table - Enter documents and check status
OIK_LOG_DOCUMENT is a standard oik log document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Log table - Enter documents and check status 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 oik log document FM, simply by entering the name OIK_LOG_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: OIKR
Program Name: SAPLOIKR
Main Program: SAPLOIKR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OIK_LOG_DOCUMENT 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 'OIK_LOG_DOCUMENT'"Log table - Enter documents and check status.
EXPORTING
* I_DOC_TYP = 'J' "SD document category
I_DOC_NR = "SD document number
* I_USER = SY-UNAME "system user from SAP logon
* I_DATE = SY-DATUM "system date
* I_LOG_MODE = 'S' "status of SD document in the table
IMPORTING
E_STATUS = "status of SD document for Icons
EXCEPTIONS
WRONG_I_LOG_MODE = 1 DELIVERY_PLANED_ALREADY = 2 INSERT_FAILED = 3 UPDATE_FAILED = 4 NO_ENTRY_FOUND = 5 WRONG_DOC_NO = 6
IMPORTING Parameters details for OIK_LOG_DOCUMENT
I_DOC_TYP - SD document category
Data type: OIKSSL-DOCTYPDefault: 'J'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DOC_NR - SD document number
Data type: OIKSSL-DOCNROptional: No
Call by Reference: No ( called with pass by value option)
I_USER - system user from SAP logon
Data type: OIKSSL-LOG_USERDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DATE - system date
Data type: OIKSSL-LOG_DATEDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LOG_MODE - status of SD document in the table
Data type: OIKSSL-LOG_MODEDefault: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for OIK_LOG_DOCUMENT
E_STATUS - status of SD document for Icons
Data type: OIKSSL-LOG_MODEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
WRONG_I_LOG_MODE - wrong log mode entered (possible 'E' or 'S')
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DELIVERY_PLANED_ALREADY - delivery already assigned to generated shipment
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INSERT_FAILED - new entry in log table failed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UPDATE_FAILED - update of entry in log table failed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ENTRY_FOUND - no entry found for update
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_DOC_NO -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for OIK_LOG_DOCUMENT 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_status | TYPE OIKSSL-LOG_MODE, " | |||
| lv_i_doc_typ | TYPE OIKSSL-DOCTYP, " 'J' | |||
| lv_wrong_i_log_mode | TYPE OIKSSL, " | |||
| lv_i_doc_nr | TYPE OIKSSL-DOCNR, " | |||
| lv_delivery_planed_already | TYPE OIKSSL, " | |||
| lv_i_user | TYPE OIKSSL-LOG_USER, " SY-UNAME | |||
| lv_insert_failed | TYPE OIKSSL, " | |||
| lv_i_date | TYPE OIKSSL-LOG_DATE, " SY-DATUM | |||
| lv_update_failed | TYPE OIKSSL, " | |||
| lv_i_log_mode | TYPE OIKSSL-LOG_MODE, " 'S' | |||
| lv_no_entry_found | TYPE OIKSSL, " | |||
| lv_wrong_doc_no | TYPE OIKSSL. " |
|   CALL FUNCTION 'OIK_LOG_DOCUMENT' "Log table - Enter documents and check status |
| EXPORTING | ||
| I_DOC_TYP | = lv_i_doc_typ | |
| I_DOC_NR | = lv_i_doc_nr | |
| I_USER | = lv_i_user | |
| I_DATE | = lv_i_date | |
| I_LOG_MODE | = lv_i_log_mode | |
| IMPORTING | ||
| E_STATUS | = lv_e_status | |
| EXCEPTIONS | ||
| WRONG_I_LOG_MODE = 1 | ||
| DELIVERY_PLANED_ALREADY = 2 | ||
| INSERT_FAILED = 3 | ||
| UPDATE_FAILED = 4 | ||
| NO_ENTRY_FOUND = 5 | ||
| WRONG_DOC_NO = 6 | ||
| . " OIK_LOG_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM OIK_LOG_DOCUMENT
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 LOG_MODE FROM OIKSSL INTO @DATA(ld_e_status). | ||||
| "SELECT single DOCTYP FROM OIKSSL INTO @DATA(ld_i_doc_typ). | ||||
| DATA(ld_i_doc_typ) | = 'J'. | |||
| "SELECT single DOCNR FROM OIKSSL INTO @DATA(ld_i_doc_nr). | ||||
| "SELECT single LOG_USER FROM OIKSSL INTO @DATA(ld_i_user). | ||||
| DATA(ld_i_user) | = SY-UNAME. | |||
| "SELECT single LOG_DATE FROM OIKSSL INTO @DATA(ld_i_date). | ||||
| DATA(ld_i_date) | = SY-DATUM. | |||
| "SELECT single LOG_MODE FROM OIKSSL INTO @DATA(ld_i_log_mode). | ||||
| DATA(ld_i_log_mode) | = 'S'. | |||
Search for further information about these or an SAP related objects