SAP Function Modules

BF_READ_STOCK_O SAP Function module







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

Associated Function Group: MDBF
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM BF_READ_STOCK_O - BF READ STOCK O





CALL FUNCTION 'BF_READ_STOCK_O' "
* EXPORTING
*   xruem =                     " bfcom-xruem   Allow Posting to Previous Period (Backposting)
  IMPORTING
    e_problems =                "
  TABLES
    i_mslb_key =                " mslb_key
*   c_mslb =                    " mslb
*   c_mdbf =                    " mdbf
  EXCEPTIONS
    NO_INPUT_ENTRIES = 1        "
    NO_MATERIAL = 2             "
    NO_PLANT = 3                "
    NO_MIXED_LEVELS = 4         "
    .  "  BF_READ_STOCK_O

ABAP code example for Function Module BF_READ_STOCK_O





The ABAP code below is a full code listing to execute function module BF_READ_STOCK_O 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_e_problems  TYPE STRING ,
it_i_mslb_key  TYPE STANDARD TABLE OF MSLB_KEY,"TABLES PARAM
wa_i_mslb_key  LIKE LINE OF it_i_mslb_key ,
it_c_mslb  TYPE STANDARD TABLE OF MSLB,"TABLES PARAM
wa_c_mslb  LIKE LINE OF it_c_mslb ,
it_c_mdbf  TYPE STANDARD TABLE OF MDBF,"TABLES PARAM
wa_c_mdbf  LIKE LINE OF it_c_mdbf .


DATA(ld_xruem) = some text here

"populate fields of struture and append to itab
append wa_i_mslb_key to it_i_mslb_key.

"populate fields of struture and append to itab
append wa_c_mslb to it_c_mslb.

"populate fields of struture and append to itab
append wa_c_mdbf to it_c_mdbf. . CALL FUNCTION 'BF_READ_STOCK_O' * EXPORTING * xruem = ld_xruem IMPORTING e_problems = ld_e_problems TABLES i_mslb_key = it_i_mslb_key * c_mslb = it_c_mslb * c_mdbf = it_c_mdbf EXCEPTIONS NO_INPUT_ENTRIES = 1 NO_MATERIAL = 2 NO_PLANT = 3 NO_MIXED_LEVELS = 4 . " BF_READ_STOCK_O
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here 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_e_problems  TYPE STRING ,
ld_xruem  TYPE BFCOM-XRUEM ,
it_i_mslb_key  TYPE STANDARD TABLE OF MSLB_KEY ,
wa_i_mslb_key  LIKE LINE OF it_i_mslb_key,
it_c_mslb  TYPE STANDARD TABLE OF MSLB ,
wa_c_mslb  LIKE LINE OF it_c_mslb,
it_c_mdbf  TYPE STANDARD TABLE OF MDBF ,
wa_c_mdbf  LIKE LINE OF it_c_mdbf.


ld_xruem = some text here

"populate fields of struture and append to itab
append wa_i_mslb_key to it_i_mslb_key.

"populate fields of struture and append to itab
append wa_c_mslb to it_c_mslb.

"populate fields of struture and append to itab
append wa_c_mdbf to it_c_mdbf.

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 BF_READ_STOCK_O or its description.