SAP Function Modules

BAPI_0051_UPDATE SAP Function module - FM Budgeting - Update totals







BAPI_0051_UPDATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_0051_UPDATE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 0051
Released Date: 16.01.2002
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_0051_UPDATE - BAPI 0051 UPDATE





CALL FUNCTION 'BAPI_0051_UPDATE' "FM Budgeting - Update totals
  EXPORTING
    f_mngt_area =               " bapi_0051_fields-fm_area  Financial management area
    fisc_year =                 " bapi_0051_fields-fisc_year  Fiscal year
    versn =                     " bapi_0051_fields-version  Budget version
    bud_cat =                   " bapi_0051_fields-budcat  Budget category
    period_interval =           " bapi_0051_period_interval  Interval of periods to take into account for mass update
    update_mode =               " bapi_0051_fields-update_mode  Update mode in mass transactions
*   testrun = 'X'               " bapi_0051_fields-testrun  Switch to Simulation Session for Write BAPIs
  TABLES
    item_data =                 " bapi_0051_item_set  Total line for Budget Data
*   period_data =               " bapi_0051_period_set  Period value for Budget Data
    return =                    " bapiret2      Return parameter
    .  "  BAPI_0051_UPDATE

ABAP code example for Function Module BAPI_0051_UPDATE





The ABAP code below is a full code listing to execute function module BAPI_0051_UPDATE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_item_data  TYPE STANDARD TABLE OF BAPI_0051_ITEM_SET,"TABLES PARAM
wa_item_data  LIKE LINE OF it_item_data ,
it_period_data  TYPE STANDARD TABLE OF BAPI_0051_PERIOD_SET,"TABLES PARAM
wa_period_data  LIKE LINE OF it_period_data ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


DATA(ld_f_mngt_area) = some text here

DATA(ld_fisc_year) = Check type of data required

DATA(ld_versn) = some text here

DATA(ld_bud_cat) = some text here
DATA(ld_period_interval) = 'Check type of data required'.

DATA(ld_update_mode) = some text here

DATA(ld_testrun) = some text here

"populate fields of struture and append to itab
append wa_item_data to it_item_data.

"populate fields of struture and append to itab
append wa_period_data to it_period_data.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_0051_UPDATE' EXPORTING f_mngt_area = ld_f_mngt_area fisc_year = ld_fisc_year versn = ld_versn bud_cat = ld_bud_cat period_interval = ld_period_interval update_mode = ld_update_mode * testrun = ld_testrun TABLES item_data = it_item_data * period_data = it_period_data return = it_return . " BAPI_0051_UPDATE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_f_mngt_area  TYPE BAPI_0051_FIELDS-FM_AREA ,
it_item_data  TYPE STANDARD TABLE OF BAPI_0051_ITEM_SET ,
wa_item_data  LIKE LINE OF it_item_data,
ld_fisc_year  TYPE BAPI_0051_FIELDS-FISC_YEAR ,
it_period_data  TYPE STANDARD TABLE OF BAPI_0051_PERIOD_SET ,
wa_period_data  LIKE LINE OF it_period_data,
ld_versn  TYPE BAPI_0051_FIELDS-VERSION ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_bud_cat  TYPE BAPI_0051_FIELDS-BUDCAT ,
ld_period_interval  TYPE BAPI_0051_PERIOD_INTERVAL ,
ld_update_mode  TYPE BAPI_0051_FIELDS-UPDATE_MODE ,
ld_testrun  TYPE BAPI_0051_FIELDS-TESTRUN .


ld_f_mngt_area = some text here

"populate fields of struture and append to itab
append wa_item_data to it_item_data.

ld_fisc_year = Check type of data required

"populate fields of struture and append to itab
append wa_period_data to it_period_data.

ld_versn = some text here

"populate fields of struture and append to itab
append wa_return to it_return.

ld_bud_cat = some text here
ld_period_interval = 'Check type of data required'.

ld_update_mode = some text here

ld_testrun = some text here

SAP Documentation for FM BAPI_0051_UPDATE


This method enables you to update budgeting totals.

EXAMPLE ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_0051_UPDATE or its description.