SAP Function Modules

INVENTORY_DATA_GET SAP Function module







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

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


Pattern for FM INVENTORY_DATA_GET - INVENTORY DATA GET





CALL FUNCTION 'INVENTORY_DATA_GET' "
  EXPORTING
    pi_i_pvaen =                " pvaen
    pi_vkpu_vorga =             " rvkpu-vkpu_vorga
*   pi_warehouse_data =         " sy-marky
*   pi_vorlage_beleg =          " sy-marky
  IMPORTING
    pe_i_pvaen =                " pvaen
    pe_i_mbefu =                " mbefu
    pe_buffer_read =            " sy-marky
* TABLES
*   p_t_err_pvaen =             " verro
*   pe_t_lpvaen =               " pvaen
  EXCEPTIONS
    NO_VALID_VALUATION_TYPE = 1  "
    NO_SEPARATE_VALUATION = 2   "
    NO_MATERIAL_MASTER_DATA_FOUND = 3  "
    NO_VALUATED_STOCK = 4       "
    QUANTITY_TO_LARGE = 5       "
    NO_WAREHOUSE_DATA = 6       "
    NO_WAREHOUSE_STOCK = 7      "
    SY_MESSAGE = 8              "
    LOCK_ON_MATERIAL = 9        "
    LOCK_ON_PLANT = 10          "
    OTHER_LOCK_ERROR = 11       "
    WAART_ERROR_IN_MAT_READ = 12  "
    .  "  INVENTORY_DATA_GET

ABAP code example for Function Module INVENTORY_DATA_GET





The ABAP code below is a full code listing to execute function module INVENTORY_DATA_GET 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_pe_i_pvaen  TYPE PVAEN ,
ld_pe_i_mbefu  TYPE MBEFU ,
ld_pe_buffer_read  TYPE SY-MARKY ,
it_p_t_err_pvaen  TYPE STANDARD TABLE OF VERRO,"TABLES PARAM
wa_p_t_err_pvaen  LIKE LINE OF it_p_t_err_pvaen ,
it_pe_t_lpvaen  TYPE STANDARD TABLE OF PVAEN,"TABLES PARAM
wa_pe_t_lpvaen  LIKE LINE OF it_pe_t_lpvaen .

DATA(ld_pi_i_pvaen) = 'Check type of data required'.

DATA(ld_pi_vkpu_vorga) = some text here
DATA(ld_pi_warehouse_data) = 'some text here'.
DATA(ld_pi_vorlage_beleg) = 'some text here'.

"populate fields of struture and append to itab
append wa_p_t_err_pvaen to it_p_t_err_pvaen.

"populate fields of struture and append to itab
append wa_pe_t_lpvaen to it_pe_t_lpvaen. . CALL FUNCTION 'INVENTORY_DATA_GET' EXPORTING pi_i_pvaen = ld_pi_i_pvaen pi_vkpu_vorga = ld_pi_vkpu_vorga * pi_warehouse_data = ld_pi_warehouse_data * pi_vorlage_beleg = ld_pi_vorlage_beleg IMPORTING pe_i_pvaen = ld_pe_i_pvaen pe_i_mbefu = ld_pe_i_mbefu pe_buffer_read = ld_pe_buffer_read * TABLES * p_t_err_pvaen = it_p_t_err_pvaen * pe_t_lpvaen = it_pe_t_lpvaen EXCEPTIONS NO_VALID_VALUATION_TYPE = 1 NO_SEPARATE_VALUATION = 2 NO_MATERIAL_MASTER_DATA_FOUND = 3 NO_VALUATED_STOCK = 4 QUANTITY_TO_LARGE = 5 NO_WAREHOUSE_DATA = 6 NO_WAREHOUSE_STOCK = 7 SY_MESSAGE = 8 LOCK_ON_MATERIAL = 9 LOCK_ON_PLANT = 10 OTHER_LOCK_ERROR = 11 WAART_ERROR_IN_MAT_READ = 12 . " INVENTORY_DATA_GET
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 ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "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_pe_i_pvaen  TYPE PVAEN ,
ld_pi_i_pvaen  TYPE PVAEN ,
it_p_t_err_pvaen  TYPE STANDARD TABLE OF VERRO ,
wa_p_t_err_pvaen  LIKE LINE OF it_p_t_err_pvaen,
ld_pe_i_mbefu  TYPE MBEFU ,
ld_pi_vkpu_vorga  TYPE RVKPU-VKPU_VORGA ,
it_pe_t_lpvaen  TYPE STANDARD TABLE OF PVAEN ,
wa_pe_t_lpvaen  LIKE LINE OF it_pe_t_lpvaen,
ld_pe_buffer_read  TYPE SY-MARKY ,
ld_pi_warehouse_data  TYPE SY-MARKY ,
ld_pi_vorlage_beleg  TYPE SY-MARKY .

ld_pi_i_pvaen = 'some text here'.

"populate fields of struture and append to itab
append wa_p_t_err_pvaen to it_p_t_err_pvaen.

ld_pi_vkpu_vorga = some text here

"populate fields of struture and append to itab
append wa_pe_t_lpvaen to it_pe_t_lpvaen.
ld_pi_warehouse_data = 'some text here'.
ld_pi_vorlage_beleg = 'some text here'.

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