SAP Function Modules

BAPI_0050_CREATE SAP Function module - Create FM Budgeting Entry document







BAPI_0050_CREATE 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_0050_CREATE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM BAPI_0050_CREATE - BAPI 0050 CREATE





CALL FUNCTION 'BAPI_0050_CREATE' "Create FM Budgeting Entry document
  EXPORTING
*   language =                  " bapi_0050_fields-language  Language
    header_data =               " bapi_0050_header  Header data
*   header_data_add =           " bapi_0050_header_add  Additional header data
*   testrun = 'X'               " bapi_0050_fields-testrun  Switch to Simulation Session
  IMPORTING
    fmarea =                    " bapi_0050_fields-fm_area  Financial management area
    documentyear =              " bapi_0050_fields-doc_year  Document year
    documentnumber =            " bapi_0050_fields-document  Budget entry document number
  TABLES
    item_data =                 " bapi_0050_item  Line item
*   sender_item_data =          " bapi_0050_item  Line item (senders)
*   period_data =               " bapi_0050_period  Periods
*   sender_period_data =        " bapi_0050_period  Periods (senders)
*   long_text =                 " bapi_0050_longtext  Long text
*   extension_in =              " bapiparex     Enhancement
    return =                    " bapiret2      Return messages
    .  "  BAPI_0050_CREATE

ABAP code example for Function Module BAPI_0050_CREATE





The ABAP code below is a full code listing to execute function module BAPI_0050_CREATE 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:
ld_fmarea  TYPE BAPI_0050_FIELDS-FM_AREA ,
ld_documentyear  TYPE BAPI_0050_FIELDS-DOC_YEAR ,
ld_documentnumber  TYPE BAPI_0050_FIELDS-DOCUMENT ,
it_item_data  TYPE STANDARD TABLE OF BAPI_0050_ITEM,"TABLES PARAM
wa_item_data  LIKE LINE OF it_item_data ,
it_sender_item_data  TYPE STANDARD TABLE OF BAPI_0050_ITEM,"TABLES PARAM
wa_sender_item_data  LIKE LINE OF it_sender_item_data ,
it_period_data  TYPE STANDARD TABLE OF BAPI_0050_PERIOD,"TABLES PARAM
wa_period_data  LIKE LINE OF it_period_data ,
it_sender_period_data  TYPE STANDARD TABLE OF BAPI_0050_PERIOD,"TABLES PARAM
wa_sender_period_data  LIKE LINE OF it_sender_period_data ,
it_long_text  TYPE STANDARD TABLE OF BAPI_0050_LONGTEXT,"TABLES PARAM
wa_long_text  LIKE LINE OF it_long_text ,
it_extension_in  TYPE STANDARD TABLE OF BAPIPAREX,"TABLES PARAM
wa_extension_in  LIKE LINE OF it_extension_in ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


DATA(ld_language) = Check type of data required
DATA(ld_header_data) = 'Check type of data required'.
DATA(ld_header_data_add) = 'Check type of data required'.

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_sender_item_data to it_sender_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_sender_period_data to it_sender_period_data.

"populate fields of struture and append to itab
append wa_long_text to it_long_text.

"populate fields of struture and append to itab
append wa_extension_in to it_extension_in.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_0050_CREATE' EXPORTING * language = ld_language header_data = ld_header_data * header_data_add = ld_header_data_add * testrun = ld_testrun IMPORTING fmarea = ld_fmarea documentyear = ld_documentyear documentnumber = ld_documentnumber TABLES item_data = it_item_data * sender_item_data = it_sender_item_data * period_data = it_period_data * sender_period_data = it_sender_period_data * long_text = it_long_text * extension_in = it_extension_in return = it_return . " BAPI_0050_CREATE
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_fmarea  TYPE BAPI_0050_FIELDS-FM_AREA ,
ld_language  TYPE BAPI_0050_FIELDS-LANGUAGE ,
it_item_data  TYPE STANDARD TABLE OF BAPI_0050_ITEM ,
wa_item_data  LIKE LINE OF it_item_data,
ld_documentyear  TYPE BAPI_0050_FIELDS-DOC_YEAR ,
ld_header_data  TYPE BAPI_0050_HEADER ,
it_sender_item_data  TYPE STANDARD TABLE OF BAPI_0050_ITEM ,
wa_sender_item_data  LIKE LINE OF it_sender_item_data,
ld_documentnumber  TYPE BAPI_0050_FIELDS-DOCUMENT ,
ld_header_data_add  TYPE BAPI_0050_HEADER_ADD ,
it_period_data  TYPE STANDARD TABLE OF BAPI_0050_PERIOD ,
wa_period_data  LIKE LINE OF it_period_data,
ld_testrun  TYPE BAPI_0050_FIELDS-TESTRUN ,
it_sender_period_data  TYPE STANDARD TABLE OF BAPI_0050_PERIOD ,
wa_sender_period_data  LIKE LINE OF it_sender_period_data,
it_long_text  TYPE STANDARD TABLE OF BAPI_0050_LONGTEXT ,
wa_long_text  LIKE LINE OF it_long_text,
it_extension_in  TYPE STANDARD TABLE OF BAPIPAREX ,
wa_extension_in  LIKE LINE OF it_extension_in,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return.


ld_language = Check type of data required

"populate fields of struture and append to itab
append wa_item_data to it_item_data.
ld_header_data = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_sender_item_data to it_sender_item_data.
ld_header_data_add = 'Check type of data required'.

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

ld_testrun = some text here

"populate fields of struture and append to itab
append wa_sender_period_data to it_sender_period_data.

"populate fields of struture and append to itab
append wa_long_text to it_long_text.

"populate fields of struture and append to itab
append wa_extension_in to it_extension_in.

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

SAP Documentation for FM BAPI_0050_CREATE


This method enables you to create budget entry documents. You can create either posted documents or preposted documents. ...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_0050_CREATE or its description.