SAP FKK_REVERSE_DOC Function Module for
FKK_REVERSE_DOC is a standard fkk reverse doc 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 fkk reverse doc FM, simply by entering the name FKK_REVERSE_DOC into the relevant SAP transaction such as SE37 or SE38.
Function Group: FKB0
Program Name: SAPLFKB0
Main Program: SAPLFKB0
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FKK_REVERSE_DOC 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 'FKK_REVERSE_DOC'".
EXPORTING
I_OPBEL = "Document to be Reversed
I_HERKF = "Reversal document origin key
* I_XBLNR = ' ' "Reference Number of Reversal Document
* I_AWSYS = ' ' "Logical System of Source Document
* I_AWTYP = ' ' "Reference Transaction
* I_AWKEY = ' ' "Reference Key
* I_STODT = "Alternative Reversal Date, if Required
* I_PRTID = "
* I_CHECK_ARCHIVE = ' ' "
* I_OPEN_REPEATINGS = ' ' "'X' All Open Repetitions (Statistical Documents)
* I_NO_PARTIAL = ' ' "
* I_BUDAT = "... Only Items with This Posting Date
* I_UPDATE_TASK = ' ' "Indicator: Update via Update Task
* I_RESOB = ' ' "Reserved Object Class for Reconciliation Key
* I_RESKY = ' ' "Reserved Object Key for Reconciliation Key
* I_CALLR = ' ' "ID of User who Called up Transaction
* I_TEST = ' ' "'X' Only Simulate
* I_IGNORE_CLEARINGS = ' ' "
* I_SEND_NOTES = ' ' "'X' Output Notes
* I_DIALOG = ' ' "'X' Dialog Boxes Permitted
* I_WF4EYE = ' ' "'X' Call from Workflow (Dual Control Principle)
* I_CLARIFY = ' ' "'X' Back to Clarification Account
I_BLART = "Reversal Document Type
* I_NO_4EYES = ' ' "'X' No Dual Control Principle Required
* I_RA_EXTENDED = ' ' "
* I_CHECK_MEMORY = ' ' "
I_AUGRD = "Clearing Reason
* I_RLGRD = ' ' "Returns Reason
* I_VOIDR = ' ' "Check Voiding Reason
* I_STMET = ' ' "Reversal Method
* I_XCOPA = ' ' "'X' CO-PA already Updated
* I_FIKEY = "Reversal Document Reconciliation Key
IMPORTING
E_OPBEL = "Reverse Document Number
E_C4EYE = "Check Reason for Reversal Indicator
E_STODT = "Posting Date of Reversal
E_BUDAT = "Posting Date Used
E_BLDAT = "
TABLES
* T_CLETAB = "
* T_FKKOP_NEW = "
* T_FKKOPK_NEW = "
EXCEPTIONS
CLEARED_ITEMS = 1
IMPORTING Parameters details for FKK_REVERSE_DOC
I_OPBEL - Document to be Reversed
Data type: FKKKO-OPBELOptional: No
Call by Reference: No ( called with pass by value option)
I_HERKF - Reversal document origin key
Data type: FKKKO-HERKFOptional: No
Call by Reference: No ( called with pass by value option)
I_XBLNR - Reference Number of Reversal Document
Data type: FKKKO-XBLNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_AWSYS - Logical System of Source Document
Data type: AWSYSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_AWTYP - Reference Transaction
Data type: AWTYPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_AWKEY - Reference Key
Data type: AWKEYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STODT - Alternative Reversal Date, if Required
Data type: FKKKO-BUDATOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PRTID -
Data type: PRTID_KKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_CHECK_ARCHIVE -
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_OPEN_REPEATINGS - 'X' All Open Repetitions (Statistical Documents)
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_PARTIAL -
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BUDAT - ... Only Items with This Posting Date
Data type: FKKKO-BUDATOptional: Yes
Call by Reference: No ( called with pass by value option)
I_UPDATE_TASK - Indicator: Update via Update Task
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RESOB - Reserved Object Class for Reconciliation Key
Data type: DFKKSUMC-RESOBDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RESKY - Reserved Object Key for Reconciliation Key
Data type: DFKKSUMC-RESKYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CALLR - ID of User who Called up Transaction
Data type: FKKFIELDS-CALLRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TEST - 'X' Only Simulate
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_IGNORE_CLEARINGS -
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SEND_NOTES - 'X' Output Notes
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DIALOG - 'X' Dialog Boxes Permitted
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WF4EYE - 'X' Call from Workflow (Dual Control Principle)
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CLARIFY - 'X' Back to Clarification Account
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BLART - Reversal Document Type
Data type: FKKKO-BLARTOptional: No
Call by Reference: No ( called with pass by value option)
I_NO_4EYES - 'X' No Dual Control Principle Required
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_RA_EXTENDED -
Data type: BOOLE-BOOLEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CHECK_MEMORY -
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_AUGRD - Clearing Reason
Data type: FKKOP-AUGRDOptional: No
Call by Reference: No ( called with pass by value option)
I_RLGRD - Returns Reason
Data type: FKKKO-RLGRDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VOIDR - Check Voiding Reason
Data type: VOIDREAS_KKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STMET - Reversal Method
Data type: STMET_KKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_XCOPA - 'X' CO-PA already Updated
Data type: XCOPA_KKDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FIKEY - Reversal Document Reconciliation Key
Data type: FKKKO-FIKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FKK_REVERSE_DOC
E_OPBEL - Reverse Document Number
Data type: FKKKO-OPBELOptional: No
Call by Reference: No ( called with pass by value option)
E_C4EYE - Check Reason for Reversal Indicator
Data type: C4EYE_KKOptional: No
Call by Reference: No ( called with pass by value option)
E_STODT - Posting Date of Reversal
Data type: FKKKO-BUDATOptional: No
Call by Reference: No ( called with pass by value option)
E_BUDAT - Posting Date Used
Data type: BUDAT_KKOptional: No
Call by Reference: No ( called with pass by value option)
E_BLDAT -
Data type: BLDATOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for FKK_REVERSE_DOC
T_CLETAB -
Data type: FKK_OPUPKOptional: Yes
Call by Reference: Yes
T_FKKOP_NEW -
Data type: FKKOPOptional: Yes
Call by Reference: Yes
T_FKKOPK_NEW -
Data type: FKKOPKOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
CLEARED_ITEMS - Reversal Not Possible due to External Clearing
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FKK_REVERSE_DOC 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_opbel | TYPE FKKKO-OPBEL, " | |||
| lv_i_opbel | TYPE FKKKO-OPBEL, " | |||
| lt_t_cletab | TYPE STANDARD TABLE OF FKK_OPUPK, " | |||
| lv_cleared_items | TYPE FKK_OPUPK, " | |||
| lv_i_herkf | TYPE FKKKO-HERKF, " | |||
| lv_i_xblnr | TYPE FKKKO-XBLNR, " SPACE | |||
| lv_i_awsys | TYPE AWSYS, " SPACE | |||
| lv_i_awtyp | TYPE AWTYP, " SPACE | |||
| lv_i_awkey | TYPE AWKEY, " SPACE | |||
| lv_i_stodt | TYPE FKKKO-BUDAT, " | |||
| lv_i_prtid | TYPE PRTID_KK, " | |||
| lv_i_check_archive | TYPE XFELD, " SPACE | |||
| lv_i_open_repeatings | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_no_partial | TYPE XFELD, " SPACE | |||
| lv_e_c4eye | TYPE C4EYE_KK, " | |||
| lv_i_budat | TYPE FKKKO-BUDAT, " | |||
| lt_t_fkkop_new | TYPE STANDARD TABLE OF FKKOP, " | |||
| lv_i_update_task | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_resob | TYPE DFKKSUMC-RESOB, " SPACE | |||
| lv_i_resky | TYPE DFKKSUMC-RESKY, " SPACE | |||
| lv_i_callr | TYPE FKKFIELDS-CALLR, " SPACE | |||
| lv_i_test | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_ignore_clearings | TYPE XFELD, " SPACE | |||
| lv_i_send_notes | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_dialog | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_wf4eye | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_clarify | TYPE XFELD, " SPACE | |||
| lv_e_stodt | TYPE FKKKO-BUDAT, " | |||
| lv_i_blart | TYPE FKKKO-BLART, " | |||
| lt_t_fkkopk_new | TYPE STANDARD TABLE OF FKKOPK, " | |||
| lv_i_no_4eyes | TYPE XFELD, " SPACE | |||
| lv_i_ra_extended | TYPE BOOLE-BOOLE, " SPACE | |||
| lv_i_check_memory | TYPE XFELD, " SPACE | |||
| lv_e_budat | TYPE BUDAT_KK, " | |||
| lv_i_augrd | TYPE FKKOP-AUGRD, " | |||
| lv_e_bldat | TYPE BLDAT, " | |||
| lv_i_rlgrd | TYPE FKKKO-RLGRD, " SPACE | |||
| lv_i_voidr | TYPE VOIDREAS_KK, " SPACE | |||
| lv_i_stmet | TYPE STMET_KK, " SPACE | |||
| lv_i_xcopa | TYPE XCOPA_KK, " SPACE | |||
| lv_i_fikey | TYPE FKKKO-FIKEY. " |
|   CALL FUNCTION 'FKK_REVERSE_DOC' " |
| EXPORTING | ||
| I_OPBEL | = lv_i_opbel | |
| I_HERKF | = lv_i_herkf | |
| I_XBLNR | = lv_i_xblnr | |
| I_AWSYS | = lv_i_awsys | |
| I_AWTYP | = lv_i_awtyp | |
| I_AWKEY | = lv_i_awkey | |
| I_STODT | = lv_i_stodt | |
| I_PRTID | = lv_i_prtid | |
| I_CHECK_ARCHIVE | = lv_i_check_archive | |
| I_OPEN_REPEATINGS | = lv_i_open_repeatings | |
| I_NO_PARTIAL | = lv_i_no_partial | |
| I_BUDAT | = lv_i_budat | |
| I_UPDATE_TASK | = lv_i_update_task | |
| I_RESOB | = lv_i_resob | |
| I_RESKY | = lv_i_resky | |
| I_CALLR | = lv_i_callr | |
| I_TEST | = lv_i_test | |
| I_IGNORE_CLEARINGS | = lv_i_ignore_clearings | |
| I_SEND_NOTES | = lv_i_send_notes | |
| I_DIALOG | = lv_i_dialog | |
| I_WF4EYE | = lv_i_wf4eye | |
| I_CLARIFY | = lv_i_clarify | |
| I_BLART | = lv_i_blart | |
| I_NO_4EYES | = lv_i_no_4eyes | |
| I_RA_EXTENDED | = lv_i_ra_extended | |
| I_CHECK_MEMORY | = lv_i_check_memory | |
| I_AUGRD | = lv_i_augrd | |
| I_RLGRD | = lv_i_rlgrd | |
| I_VOIDR | = lv_i_voidr | |
| I_STMET | = lv_i_stmet | |
| I_XCOPA | = lv_i_xcopa | |
| I_FIKEY | = lv_i_fikey | |
| IMPORTING | ||
| E_OPBEL | = lv_e_opbel | |
| E_C4EYE | = lv_e_c4eye | |
| E_STODT | = lv_e_stodt | |
| E_BUDAT | = lv_e_budat | |
| E_BLDAT | = lv_e_bldat | |
| TABLES | ||
| T_CLETAB | = lt_t_cletab | |
| T_FKKOP_NEW | = lt_t_fkkop_new | |
| T_FKKOPK_NEW | = lt_t_fkkopk_new | |
| EXCEPTIONS | ||
| CLEARED_ITEMS = 1 | ||
| . " FKK_REVERSE_DOC | ||
ABAP code using 7.40 inline data declarations to call FM FKK_REVERSE_DOC
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 OPBEL FROM FKKKO INTO @DATA(ld_e_opbel). | ||||
| "SELECT single OPBEL FROM FKKKO INTO @DATA(ld_i_opbel). | ||||
| "SELECT single HERKF FROM FKKKO INTO @DATA(ld_i_herkf). | ||||
| "SELECT single XBLNR FROM FKKKO INTO @DATA(ld_i_xblnr). | ||||
| DATA(ld_i_xblnr) | = ' '. | |||
| DATA(ld_i_awsys) | = ' '. | |||
| DATA(ld_i_awtyp) | = ' '. | |||
| DATA(ld_i_awkey) | = ' '. | |||
| "SELECT single BUDAT FROM FKKKO INTO @DATA(ld_i_stodt). | ||||
| DATA(ld_i_check_archive) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_open_repeatings). | ||||
| DATA(ld_i_open_repeatings) | = ' '. | |||
| DATA(ld_i_no_partial) | = ' '. | |||
| "SELECT single BUDAT FROM FKKKO INTO @DATA(ld_i_budat). | ||||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_update_task). | ||||
| DATA(ld_i_update_task) | = ' '. | |||
| "SELECT single RESOB FROM DFKKSUMC INTO @DATA(ld_i_resob). | ||||
| DATA(ld_i_resob) | = ' '. | |||
| "SELECT single RESKY FROM DFKKSUMC INTO @DATA(ld_i_resky). | ||||
| DATA(ld_i_resky) | = ' '. | |||
| "SELECT single CALLR FROM FKKFIELDS INTO @DATA(ld_i_callr). | ||||
| DATA(ld_i_callr) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_test). | ||||
| DATA(ld_i_test) | = ' '. | |||
| DATA(ld_i_ignore_clearings) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_send_notes). | ||||
| DATA(ld_i_send_notes) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_dialog). | ||||
| DATA(ld_i_dialog) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_wf4eye). | ||||
| DATA(ld_i_wf4eye) | = ' '. | |||
| DATA(ld_i_clarify) | = ' '. | |||
| "SELECT single BUDAT FROM FKKKO INTO @DATA(ld_e_stodt). | ||||
| "SELECT single BLART FROM FKKKO INTO @DATA(ld_i_blart). | ||||
| DATA(ld_i_no_4eyes) | = ' '. | |||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_ra_extended). | ||||
| DATA(ld_i_ra_extended) | = ' '. | |||
| DATA(ld_i_check_memory) | = ' '. | |||
| "SELECT single AUGRD FROM FKKOP INTO @DATA(ld_i_augrd). | ||||
| "SELECT single RLGRD FROM FKKKO INTO @DATA(ld_i_rlgrd). | ||||
| DATA(ld_i_rlgrd) | = ' '. | |||
| DATA(ld_i_voidr) | = ' '. | |||
| DATA(ld_i_stmet) | = ' '. | |||
| DATA(ld_i_xcopa) | = ' '. | |||
| "SELECT single FIKEY FROM FKKKO INTO @DATA(ld_i_fikey). | ||||
Search for further information about these or an SAP related objects