SAP BAPI_0050_REVERSE Function Module for Reverse FM Budgeting Entry document









BAPI_0050_REVERSE is a standard bapi 0050 reverse SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Reverse FM Budgeting Entry 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 bapi 0050 reverse FM, simply by entering the name BAPI_0050_REVERSE into the relevant SAP transaction such as SE37 or SE38.

Function Group: 0050
Program Name: SAPL0050
Main Program: SAPL0050
Appliation area:
Release date: 16-Jan-2002
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_0050_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 'BAPI_0050_REVERSE'"Reverse FM Budgeting Entry document
EXPORTING
FMAREA = "Financial management area
DOCUMENTYEAR = "Document year
DOCUMENTNUMBER = "Budget entry document number
REVERSAL_DATA = "Reversal data
* LANGUAGE = "Language
* TESTRUN = 'X' "Switch to Simulation Session for Write BAPIs

IMPORTING
REV_FM_AREA = "Financial management area
REV_DOCUMENT_YEAR = "Document year
REV_DOCUMENT_NUMBER = "Budget entry document number

TABLES
* LONG_TEXT = "Long text
* EXTENSION_IN = "ExtensionIn
RETURN = "Return messages
.



IMPORTING Parameters details for BAPI_0050_REVERSE

FMAREA - Financial management area

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

DOCUMENTYEAR - Document year

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

DOCUMENTNUMBER - Budget entry document number

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

REVERSAL_DATA - Reversal data

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

LANGUAGE - Language

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

TESTRUN - Switch to Simulation Session for Write BAPIs

Data type: BAPI_0050_FIELDS-TESTRUN
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_0050_REVERSE

REV_FM_AREA - Financial management area

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

REV_DOCUMENT_YEAR - Document year

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

REV_DOCUMENT_NUMBER - Budget entry document number

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

TABLES Parameters details for BAPI_0050_REVERSE

LONG_TEXT - Long text

Data type: BAPI_0050_LONGTEXT
Optional: Yes
Call by Reference: Yes

EXTENSION_IN - ExtensionIn

Data type: BAPIPAREX
Optional: Yes
Call by Reference: Yes

RETURN - Return messages

Data type: BAPIRET2
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for BAPI_0050_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_fmarea  TYPE BAPI_0050_FIELDS-FM_AREA, "   
lt_long_text  TYPE STANDARD TABLE OF BAPI_0050_LONGTEXT, "   
lv_rev_fm_area  TYPE BAPI_0050_FIELDS-FM_AREA, "   
lv_documentyear  TYPE BAPI_0050_FIELDS-DOC_YEAR, "   
lt_extension_in  TYPE STANDARD TABLE OF BAPIPAREX, "   
lv_rev_document_year  TYPE BAPI_0050_FIELDS-DOC_YEAR, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_documentnumber  TYPE BAPI_0050_FIELDS-DOCUMENT, "   
lv_rev_document_number  TYPE BAPI_0050_FIELDS-DOCUMENT, "   
lv_reversal_data  TYPE BAPI_0050_REVERSAL_DATA, "   
lv_language  TYPE BAPI_0050_FIELDS-LANGUAGE, "   
lv_testrun  TYPE BAPI_0050_FIELDS-TESTRUN. "   'X'

  CALL FUNCTION 'BAPI_0050_REVERSE'  "Reverse FM Budgeting Entry document
    EXPORTING
         FMAREA = lv_fmarea
         DOCUMENTYEAR = lv_documentyear
         DOCUMENTNUMBER = lv_documentnumber
         REVERSAL_DATA = lv_reversal_data
         LANGUAGE = lv_language
         TESTRUN = lv_testrun
    IMPORTING
         REV_FM_AREA = lv_rev_fm_area
         REV_DOCUMENT_YEAR = lv_rev_document_year
         REV_DOCUMENT_NUMBER = lv_rev_document_number
    TABLES
         LONG_TEXT = lt_long_text
         EXTENSION_IN = lt_extension_in
         RETURN = lt_return
. " BAPI_0050_REVERSE




ABAP code using 7.40 inline data declarations to call FM BAPI_0050_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 FM_AREA FROM BAPI_0050_FIELDS INTO @DATA(ld_fmarea).
 
 
"SELECT single FM_AREA FROM BAPI_0050_FIELDS INTO @DATA(ld_rev_fm_area).
 
"SELECT single DOC_YEAR FROM BAPI_0050_FIELDS INTO @DATA(ld_documentyear).
 
 
"SELECT single DOC_YEAR FROM BAPI_0050_FIELDS INTO @DATA(ld_rev_document_year).
 
 
"SELECT single DOCUMENT FROM BAPI_0050_FIELDS INTO @DATA(ld_documentnumber).
 
"SELECT single DOCUMENT FROM BAPI_0050_FIELDS INTO @DATA(ld_rev_document_number).
 
 
"SELECT single LANGUAGE FROM BAPI_0050_FIELDS INTO @DATA(ld_language).
 
"SELECT single TESTRUN FROM BAPI_0050_FIELDS INTO @DATA(ld_testrun).
DATA(ld_testrun) = 'X'.
 


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!