SAP Function Modules

BAPI_WHSE_TO_CREATE_STOCK SAP Function module - BAPI for Stock Data per Quant







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

Associated Function Group: L2018
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_WHSE_TO_CREATE_STOCK - BAPI WHSE TO CREATE STOCK





CALL FUNCTION 'BAPI_WHSE_TO_CREATE_STOCK' "BAPI for Stock Data per Quant
  EXPORTING
    whsenumber =                " bapi2018e-whsenumber  Warehouse number / warehouse complex
    whsemvmt =                  " bapi2018e-whse_mvmt  Movement type for Warehouse Management
*   reqnumber = SPACE           " bapi2018e-req_number  Requirement Tracking Number
*   reqtype = SPACE             " bapi2018e-req_type  Requirement Type
*   addrefno = SPACE            " bapi2018e-add_ref_no  Additional number for transfer requirement
*   notpriind = SPACE           " bapi2018e-not_pri_ind  Do not print transfer order
*   prictlind = SPACE           " bapi2018e-pri_ctl_ind  Indicator: form and sort code for printing transfer orders
*   minwmind = SPACE            " bapi2018e-min_wm_ind  Transfer order transfers no real storage bin stock
*   addrem = SPACE              " bapi2018e-add_rem  TO processing comment (code)
  TABLES
    importdata =                " bapi2018d     Import Structure D for Business Object WhseTransOrder
    createdata =                " bapicr2018ret  BAPI Export Fields for Data Transmission BO 2018
    return =                    " bapiret2      Return parameter
    .  "  BAPI_WHSE_TO_CREATE_STOCK

ABAP code example for Function Module BAPI_WHSE_TO_CREATE_STOCK





The ABAP code below is a full code listing to execute function module BAPI_WHSE_TO_CREATE_STOCK 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_importdata  TYPE STANDARD TABLE OF BAPI2018D,"TABLES PARAM
wa_importdata  LIKE LINE OF it_importdata ,
it_createdata  TYPE STANDARD TABLE OF BAPICR2018RET,"TABLES PARAM
wa_createdata  LIKE LINE OF it_createdata ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return .


DATA(ld_whsenumber) = some text here

DATA(ld_whsemvmt) = Check type of data required

DATA(ld_reqnumber) = some text here

DATA(ld_reqtype) = some text here

DATA(ld_addrefno) = some text here

DATA(ld_notpriind) = some text here

DATA(ld_prictlind) = some text here

DATA(ld_minwmind) = some text here

DATA(ld_addrem) = some text here

"populate fields of struture and append to itab
append wa_importdata to it_importdata.

"populate fields of struture and append to itab
append wa_createdata to it_createdata.

"populate fields of struture and append to itab
append wa_return to it_return. . CALL FUNCTION 'BAPI_WHSE_TO_CREATE_STOCK' EXPORTING whsenumber = ld_whsenumber whsemvmt = ld_whsemvmt * reqnumber = ld_reqnumber * reqtype = ld_reqtype * addrefno = ld_addrefno * notpriind = ld_notpriind * prictlind = ld_prictlind * minwmind = ld_minwmind * addrem = ld_addrem TABLES importdata = it_importdata createdata = it_createdata return = it_return . " BAPI_WHSE_TO_CREATE_STOCK
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_whsenumber  TYPE BAPI2018E-WHSENUMBER ,
it_importdata  TYPE STANDARD TABLE OF BAPI2018D ,
wa_importdata  LIKE LINE OF it_importdata,
ld_whsemvmt  TYPE BAPI2018E-WHSE_MVMT ,
it_createdata  TYPE STANDARD TABLE OF BAPICR2018RET ,
wa_createdata  LIKE LINE OF it_createdata,
ld_reqnumber  TYPE BAPI2018E-REQ_NUMBER ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_reqtype  TYPE BAPI2018E-REQ_TYPE ,
ld_addrefno  TYPE BAPI2018E-ADD_REF_NO ,
ld_notpriind  TYPE BAPI2018E-NOT_PRI_IND ,
ld_prictlind  TYPE BAPI2018E-PRI_CTL_IND ,
ld_minwmind  TYPE BAPI2018E-MIN_WM_IND ,
ld_addrem  TYPE BAPI2018E-ADD_REM .


ld_whsenumber = some text here

"populate fields of struture and append to itab
append wa_importdata to it_importdata.

ld_whsemvmt = Check type of data required

"populate fields of struture and append to itab
append wa_createdata to it_createdata.

ld_reqnumber = some text here

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

ld_reqtype = some text here

ld_addrefno = some text here

ld_notpriind = some text here

ld_prictlind = some text here

ld_minwmind = some text here

ld_addrem = some text here

SAP Documentation for FM BAPI_WHSE_TO_CREATE_STOCK


With this method, you can execute the transfer of initial stock data into a warehouse. ...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_WHSE_TO_CREATE_STOCK or its description.