SAP K_CODOC_REVERSE Function Module for
K_CODOC_REVERSE is a standard k codoc reverse SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 k codoc reverse FM, simply by entering the name K_CODOC_REVERSE into the relevant SAP transaction such as SE37 or SE38.
Function Group: KADU
Program Name: SAPLKADU
Main Program: SAPLKADU
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function K_CODOC_REVERSE 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 'K_CODOC_REVERSE'".
EXPORTING
KOKRS = "
VERSN = "
GJAHR = "
PERAB = "
PERBI = "
ORGVG = "
* SELART = "
* SELID = "
* WITH_COMMIT = 'X' "
TABLES
* PT_COAIB = "
EXCEPTIONS
NOTHING_TO_REVERSE = 1 NUMBER_ERROR = 2 GENERAL_ERROR = 3 USER_NOT_AUTHORIZED = 4
IMPORTING Parameters details for K_CODOC_REVERSE
KOKRS -
Data type: COBK-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
VERSN -
Data type: COBK-VERSNOptional: No
Call by Reference: No ( called with pass by value option)
GJAHR -
Data type: COBK-GJAHROptional: No
Call by Reference: No ( called with pass by value option)
PERAB -
Data type: COBK-PERABOptional: No
Call by Reference: No ( called with pass by value option)
PERBI -
Data type: COBK-PERBIOptional: No
Call by Reference: No ( called with pass by value option)
ORGVG -
Data type: COBK-ORGVGOptional: No
Call by Reference: No ( called with pass by value option)
SELART -
Data type: COBK_INDX-SELARTOptional: Yes
Call by Reference: No ( called with pass by value option)
SELID -
Data type: COBK_INDX-SELIDOptional: Yes
Call by Reference: No ( called with pass by value option)
WITH_COMMIT -
Data type: BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for K_CODOC_REVERSE
PT_COAIB -
Data type: COAIBOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOTHING_TO_REVERSE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NUMBER_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
GENERAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_NOT_AUTHORIZED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for K_CODOC_REVERSE 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_kokrs | TYPE COBK-KOKRS, " | |||
| lt_pt_coaib | TYPE STANDARD TABLE OF COAIB, " | |||
| lv_nothing_to_reverse | TYPE COAIB, " | |||
| lv_versn | TYPE COBK-VERSN, " | |||
| lv_number_error | TYPE COBK, " | |||
| lv_gjahr | TYPE COBK-GJAHR, " | |||
| lv_general_error | TYPE COBK, " | |||
| lv_perab | TYPE COBK-PERAB, " | |||
| lv_user_not_authorized | TYPE COBK, " | |||
| lv_perbi | TYPE COBK-PERBI, " | |||
| lv_orgvg | TYPE COBK-ORGVG, " | |||
| lv_selart | TYPE COBK_INDX-SELART, " | |||
| lv_selid | TYPE COBK_INDX-SELID, " | |||
| lv_with_commit | TYPE BOOLEAN. " 'X' |
|   CALL FUNCTION 'K_CODOC_REVERSE' " |
| EXPORTING | ||
| KOKRS | = lv_kokrs | |
| VERSN | = lv_versn | |
| GJAHR | = lv_gjahr | |
| PERAB | = lv_perab | |
| PERBI | = lv_perbi | |
| ORGVG | = lv_orgvg | |
| SELART | = lv_selart | |
| SELID | = lv_selid | |
| WITH_COMMIT | = lv_with_commit | |
| TABLES | ||
| PT_COAIB | = lt_pt_coaib | |
| EXCEPTIONS | ||
| NOTHING_TO_REVERSE = 1 | ||
| NUMBER_ERROR = 2 | ||
| GENERAL_ERROR = 3 | ||
| USER_NOT_AUTHORIZED = 4 | ||
| . " K_CODOC_REVERSE | ||
ABAP code using 7.40 inline data declarations to call FM K_CODOC_REVERSE
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 KOKRS FROM COBK INTO @DATA(ld_kokrs). | ||||
| "SELECT single VERSN FROM COBK INTO @DATA(ld_versn). | ||||
| "SELECT single GJAHR FROM COBK INTO @DATA(ld_gjahr). | ||||
| "SELECT single PERAB FROM COBK INTO @DATA(ld_perab). | ||||
| "SELECT single PERBI FROM COBK INTO @DATA(ld_perbi). | ||||
| "SELECT single ORGVG FROM COBK INTO @DATA(ld_orgvg). | ||||
| "SELECT single SELART FROM COBK_INDX INTO @DATA(ld_selart). | ||||
| "SELECT single SELID FROM COBK_INDX INTO @DATA(ld_selid). | ||||
| DATA(ld_with_commit) | = 'X'. | |||
Search for further information about these or an SAP related objects