SAP ISM_INVOICE_CANCEL Function Module for IS-M/SD: Reverse Billing Document
ISM_INVOICE_CANCEL is a standard ism invoice cancel SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for IS-M/SD: Reverse Billing Document 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 ism invoice cancel FM, simply by entering the name ISM_INVOICE_CANCEL into the relevant SAP transaction such as SE37 or SE38.
Function Group: JF24
Program Name: SAPLJF24
Main Program: SAPLJF24
Appliation area: J
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ISM_INVOICE_CANCEL 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 'ISM_INVOICE_CANCEL'"IS-M/SD: Reverse Billing Document.
EXPORTING
I_VBELN = "Bill.Doc.No.
* I_TRANSFER = ' ' "
* I_ACCRUAL_DATE = SYST-DATUM "
* I_CCARD_RETURN = ' ' "
I_STOGRD = "Cancellation Reason
* I_WITH_POSTING = "
* I_INVOICE_INDEX = "
* I_NO_INVOICE_INDEX_CHECK = "
* I_INVOICE_REFRESH = 'X' "
* I_BANK_RETURN = "
* I_JFSK = "
* I_WITH_COMMIT = 'X' "
IMPORTING
E_JFSK = "
E_JSTORN = "
CHANGING
* C_UEBNR = "
TABLES
* AJFDFS = "Billing Index
* AJFFDICHT = "
* AJFRKCC = "Payment Cards
* AKOMFK = "
* AKOMFKGN = "
* AKOMV = "Conditions
* ATHEAD = "Texts
* AJFFS = "Error Log
* AJFPA = "
* AJFRK = "Billing header
* AJFRP = "Billing Item
EXCEPTIONS
ERROR = 1 TRANSFER_ERROR = 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_SAPLJF24_001 IS-M/SD: Bank Returns Transfer - Header Data
EXIT_SAPLJF24_002 IS-M/SD: Bank Returns Transfer - Customer Line
EXIT_SAPLJF24_003 IS-M/SD: Bank Returns Transfer - G/L Account Line
EXIT_SAPLJF24_004 IS-M/SD: Bank Returns Transfer - Document
EXIT_SAPLJF24_005 IS-M/SD: Data Transfer - Fill Segment Text for Payment Dataset
EXIT_SAPLJF24_006
IMPORTING Parameters details for ISM_INVOICE_CANCEL
I_VBELN - Bill.Doc.No.
Data type: JFRK-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
I_TRANSFER -
Data type: XFELDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ACCRUAL_DATE -
Data type: SYDATUMDefault: SYST-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_CCARD_RETURN -
Data type: XFELDDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_STOGRD - Cancellation Reason
Data type: TJF27-STOGRDOptional: No
Call by Reference: No ( called with pass by value option)
I_WITH_POSTING -
Data type: JF24_XFIELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_INVOICE_INDEX -
Data type: JF24_XFIELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_NO_INVOICE_INDEX_CHECK -
Data type: XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_INVOICE_REFRESH -
Data type: JF24_XFIELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BANK_RETURN -
Data type: JF24_XFIELDOptional: Yes
Call by Reference: No ( called with pass by value option)
I_JFSK -
Data type: JFSKOptional: Yes
Call by Reference: No ( called with pass by value option)
I_WITH_COMMIT -
Data type: XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for ISM_INVOICE_CANCEL
E_JFSK -
Data type: JFSKOptional: No
Call by Reference: No ( called with pass by value option)
E_JSTORN -
Data type: JFRK-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for ISM_INVOICE_CANCEL
C_UEBNR -
Data type: ISPUEBNROptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for ISM_INVOICE_CANCEL
AJFDFS - Billing Index
Data type: JFDFSVBOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFFDICHT -
Data type: JFFDIVBOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFRKCC - Payment Cards
Data type: JFRKCCVBOptional: Yes
Call by Reference: No ( called with pass by value option)
AKOMFK -
Data type: JKOMFKOptional: Yes
Call by Reference: No ( called with pass by value option)
AKOMFKGN -
Data type: JF60_XKOMFKGN_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
AKOMV - Conditions
Data type: KOMVOptional: Yes
Call by Reference: No ( called with pass by value option)
ATHEAD - Texts
Data type: THEADOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFFS - Error Log
Data type: JFFSOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFPA -
Data type: JFPAVBOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFRK - Billing header
Data type: JFRKVBOptional: Yes
Call by Reference: No ( called with pass by value option)
AJFRP - Billing Item
Data type: JFRPVBOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR - Errors have occurred
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TRANSFER_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for ISM_INVOICE_CANCEL 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_error | TYPE STRING, " | |||
| lt_ajfdfs | TYPE STANDARD TABLE OF JFDFSVB, " | |||
| lv_e_jfsk | TYPE JFSK, " | |||
| lv_c_uebnr | TYPE ISPUEBNR, " | |||
| lv_i_vbeln | TYPE JFRK-VBELN, " | |||
| lt_ajffdicht | TYPE STANDARD TABLE OF JFFDIVB, " | |||
| lv_i_transfer | TYPE XFELD, " ' ' | |||
| lt_ajfrkcc | TYPE STANDARD TABLE OF JFRKCCVB, " | |||
| lv_i_accrual_date | TYPE SYDATUM, " SYST-DATUM | |||
| lv_i_ccard_return | TYPE XFELD, " ' ' | |||
| lt_akomfk | TYPE STANDARD TABLE OF JKOMFK, " | |||
| lv_e_jstorn | TYPE JFRK-VBELN, " | |||
| lv_i_stogrd | TYPE TJF27-STOGRD, " | |||
| lv_transfer_error | TYPE TJF27, " | |||
| lt_akomfkgn | TYPE STANDARD TABLE OF JF60_XKOMFKGN_TYPE, " | |||
| lv_i_with_posting | TYPE JF24_XFIELD, " | |||
| lt_akomv | TYPE STANDARD TABLE OF KOMV, " | |||
| lv_i_invoice_index | TYPE JF24_XFIELD, " | |||
| lt_athead | TYPE STANDARD TABLE OF THEAD, " | |||
| lv_i_no_invoice_index_check | TYPE XFELD, " | |||
| lt_ajffs | TYPE STANDARD TABLE OF JFFS, " | |||
| lv_i_invoice_refresh | TYPE JF24_XFIELD, " 'X' | |||
| lt_ajfpa | TYPE STANDARD TABLE OF JFPAVB, " | |||
| lv_i_bank_return | TYPE JF24_XFIELD, " | |||
| lt_ajfrk | TYPE STANDARD TABLE OF JFRKVB, " | |||
| lv_i_jfsk | TYPE JFSK, " | |||
| lt_ajfrp | TYPE STANDARD TABLE OF JFRPVB, " | |||
| lv_i_with_commit | TYPE XFELD. " 'X' |
|   CALL FUNCTION 'ISM_INVOICE_CANCEL' "IS-M/SD: Reverse Billing Document |
| EXPORTING | ||
| I_VBELN | = lv_i_vbeln | |
| I_TRANSFER | = lv_i_transfer | |
| I_ACCRUAL_DATE | = lv_i_accrual_date | |
| I_CCARD_RETURN | = lv_i_ccard_return | |
| I_STOGRD | = lv_i_stogrd | |
| I_WITH_POSTING | = lv_i_with_posting | |
| I_INVOICE_INDEX | = lv_i_invoice_index | |
| I_NO_INVOICE_INDEX_CHECK | = lv_i_no_invoice_index_check | |
| I_INVOICE_REFRESH | = lv_i_invoice_refresh | |
| I_BANK_RETURN | = lv_i_bank_return | |
| I_JFSK | = lv_i_jfsk | |
| I_WITH_COMMIT | = lv_i_with_commit | |
| IMPORTING | ||
| E_JFSK | = lv_e_jfsk | |
| E_JSTORN | = lv_e_jstorn | |
| CHANGING | ||
| C_UEBNR | = lv_c_uebnr | |
| TABLES | ||
| AJFDFS | = lt_ajfdfs | |
| AJFFDICHT | = lt_ajffdicht | |
| AJFRKCC | = lt_ajfrkcc | |
| AKOMFK | = lt_akomfk | |
| AKOMFKGN | = lt_akomfkgn | |
| AKOMV | = lt_akomv | |
| ATHEAD | = lt_athead | |
| AJFFS | = lt_ajffs | |
| AJFPA | = lt_ajfpa | |
| AJFRK | = lt_ajfrk | |
| AJFRP | = lt_ajfrp | |
| EXCEPTIONS | ||
| ERROR = 1 | ||
| TRANSFER_ERROR = 2 | ||
| . " ISM_INVOICE_CANCEL | ||
ABAP code using 7.40 inline data declarations to call FM ISM_INVOICE_CANCEL
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 VBELN FROM JFRK INTO @DATA(ld_i_vbeln). | ||||
| DATA(ld_i_transfer) | = ' '. | |||
| DATA(ld_i_accrual_date) | = SYST-DATUM. | |||
| DATA(ld_i_ccard_return) | = ' '. | |||
| "SELECT single VBELN FROM JFRK INTO @DATA(ld_e_jstorn). | ||||
| "SELECT single STOGRD FROM TJF27 INTO @DATA(ld_i_stogrd). | ||||
| DATA(ld_i_invoice_refresh) | = 'X'. | |||
| DATA(ld_i_with_commit) | = 'X'. | |||
Search for further information about these or an SAP related objects