SAP AMSS_DOCUMENT_REVERSE Function Module for









AMSS_DOCUMENT_REVERSE is a standard amss document 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 amss document reverse FM, simply by entering the name AMSS_DOCUMENT_REVERSE into the relevant SAP transaction such as SE37 or SE38.

Function Group: AMSS
Program Name: SAPLAMSS
Main Program: SAPLAMSS
Appliation area: A
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function AMSS_DOCUMENT_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 'AMSS_DOCUMENT_REVERSE'"
EXPORTING
I_AWTYP = "
* I_BELNR = "
* I_BLART = "
* I_BUDAT = "Posting Date of the Reversal
* I_MONAT = "Special Period
* I_BLDAT = "
* I_STGRD = "Reason for Reversal
I_AWREF = "
I_AWORG = "
I_AWSYS = "
* I_BUKRS = "
* I_ANLN1 = "
* I_ANLN2 = "
* I_GJAHR = "
* I_LNRAN = "

TABLES
* T_ANEK = "

EXCEPTIONS
REVERSAL_NOT_POSSIBLE = 1 DUBLICATE_OBJECT_KEY = 2 DOCUMENT_NOT_FOUND = 3
.



IMPORTING Parameters details for AMSS_DOCUMENT_REVERSE

I_AWTYP -

Data type: ACCHD-AWTYP
Optional: No
Call by Reference: No ( called with pass by value option)

I_BELNR -

Data type: ANEK-BELNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BLART -

Data type: BKPF-BLART
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BUDAT - Posting Date of the Reversal

Data type: ANEK-BUDAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_MONAT - Special Period

Data type: ANEK-MONAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BLDAT -

Data type: ANEK-BLDAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_STGRD - Reason for Reversal

Data type: UF05A-STGRD
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_AWREF -

Data type: ACCHD-AWREF
Optional: No
Call by Reference: No ( called with pass by value option)

I_AWORG -

Data type: ACCHD-AWORG
Optional: No
Call by Reference: No ( called with pass by value option)

I_AWSYS -

Data type: ACCHD-AWSYS
Optional: No
Call by Reference: No ( called with pass by value option)

I_BUKRS -

Data type: ANEK-BUKRS
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ANLN1 -

Data type: ANEK-ANLN1
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_ANLN2 -

Data type: ANEK-ANLN2
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_GJAHR -

Data type: ANEK-GJAHR
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_LNRAN -

Data type: ANEK-LNRAN
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for AMSS_DOCUMENT_REVERSE

T_ANEK -

Data type: ANEK
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

REVERSAL_NOT_POSSIBLE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DUBLICATE_OBJECT_KEY -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DOCUMENT_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for AMSS_DOCUMENT_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:
lt_t_anek  TYPE STANDARD TABLE OF ANEK, "   
lv_i_awtyp  TYPE ACCHD-AWTYP, "   
lv_reversal_not_possible  TYPE ACCHD, "   
lv_i_belnr  TYPE ANEK-BELNR, "   
lv_i_blart  TYPE BKPF-BLART, "   
lv_i_budat  TYPE ANEK-BUDAT, "   
lv_i_monat  TYPE ANEK-MONAT, "   
lv_i_bldat  TYPE ANEK-BLDAT, "   
lv_i_stgrd  TYPE UF05A-STGRD, "   
lv_i_awref  TYPE ACCHD-AWREF, "   
lv_dublicate_object_key  TYPE ACCHD, "   
lv_i_aworg  TYPE ACCHD-AWORG, "   
lv_document_not_found  TYPE ACCHD, "   
lv_i_awsys  TYPE ACCHD-AWSYS, "   
lv_i_bukrs  TYPE ANEK-BUKRS, "   
lv_i_anln1  TYPE ANEK-ANLN1, "   
lv_i_anln2  TYPE ANEK-ANLN2, "   
lv_i_gjahr  TYPE ANEK-GJAHR, "   
lv_i_lnran  TYPE ANEK-LNRAN. "   

  CALL FUNCTION 'AMSS_DOCUMENT_REVERSE'  "
    EXPORTING
         I_AWTYP = lv_i_awtyp
         I_BELNR = lv_i_belnr
         I_BLART = lv_i_blart
         I_BUDAT = lv_i_budat
         I_MONAT = lv_i_monat
         I_BLDAT = lv_i_bldat
         I_STGRD = lv_i_stgrd
         I_AWREF = lv_i_awref
         I_AWORG = lv_i_aworg
         I_AWSYS = lv_i_awsys
         I_BUKRS = lv_i_bukrs
         I_ANLN1 = lv_i_anln1
         I_ANLN2 = lv_i_anln2
         I_GJAHR = lv_i_gjahr
         I_LNRAN = lv_i_lnran
    TABLES
         T_ANEK = lt_t_anek
    EXCEPTIONS
        REVERSAL_NOT_POSSIBLE = 1
        DUBLICATE_OBJECT_KEY = 2
        DOCUMENT_NOT_FOUND = 3
. " AMSS_DOCUMENT_REVERSE




ABAP code using 7.40 inline data declarations to call FM AMSS_DOCUMENT_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 AWTYP FROM ACCHD INTO @DATA(ld_i_awtyp).
 
 
"SELECT single BELNR FROM ANEK INTO @DATA(ld_i_belnr).
 
"SELECT single BLART FROM BKPF INTO @DATA(ld_i_blart).
 
"SELECT single BUDAT FROM ANEK INTO @DATA(ld_i_budat).
 
"SELECT single MONAT FROM ANEK INTO @DATA(ld_i_monat).
 
"SELECT single BLDAT FROM ANEK INTO @DATA(ld_i_bldat).
 
"SELECT single STGRD FROM UF05A INTO @DATA(ld_i_stgrd).
 
"SELECT single AWREF FROM ACCHD INTO @DATA(ld_i_awref).
 
 
"SELECT single AWORG FROM ACCHD INTO @DATA(ld_i_aworg).
 
 
"SELECT single AWSYS FROM ACCHD INTO @DATA(ld_i_awsys).
 
"SELECT single BUKRS FROM ANEK INTO @DATA(ld_i_bukrs).
 
"SELECT single ANLN1 FROM ANEK INTO @DATA(ld_i_anln1).
 
"SELECT single ANLN2 FROM ANEK INTO @DATA(ld_i_anln2).
 
"SELECT single GJAHR FROM ANEK INTO @DATA(ld_i_gjahr).
 
"SELECT single LNRAN FROM ANEK INTO @DATA(ld_i_lnran).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!