SAP Function Modules

WSRP_SELECT_REQUIREMENTS SAP Function module - Store Replenishment: Selection of All Determined Replenishment Reqs







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

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


Pattern for FM WSRP_SELECT_REQUIREMENTS - WSRP SELECT REQUIREMENTS





CALL FUNCTION 'WSRP_SELECT_REQUIREMENTS' "Store Replenishment: Selection of All Determined Replenishment Reqs
* EXPORTING
*   i_or_and = 'X'              " wsrp_andorlink  Filialnachschub: ODER-Verknüpfung bei der Materialauswahl
*   i_decmara = ' '             " wsrp_maradata  Bestimmung der allgemeinen Materilastammdaten
*   i_cprog =                   " sycprog       ABAP Program, Caller in External Procedures
*   i_tcode =                   " sytcode       ABAP Program, Current Transaction Code
  TABLES
    i_t_customers =             " wsrp_customers  Store Replenishment: Transfer Structure for Recipient
*   i_r_matnr =                 " wsrp_rangesmatnr  BAPI Selection Structure: Material Number
*   i_r_matkl =                 " wsrp_rangesmatkl  Selektionsstruktur: Warengruppe
    e_t_wrplte =                " wsrp_wrplte   Store Replenishment: Worklist
*   e_t_wrpe =                  " wrpe          Replenishment: Error messages
  EXCEPTIONS
    ERROR = 1                   "               General Error
    .  "  WSRP_SELECT_REQUIREMENTS

ABAP code example for Function Module WSRP_SELECT_REQUIREMENTS





The ABAP code below is a full code listing to execute function module WSRP_SELECT_REQUIREMENTS 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_i_t_customers  TYPE STANDARD TABLE OF WSRP_CUSTOMERS,"TABLES PARAM
wa_i_t_customers  LIKE LINE OF it_i_t_customers ,
it_i_r_matnr  TYPE STANDARD TABLE OF WSRP_RANGESMATNR,"TABLES PARAM
wa_i_r_matnr  LIKE LINE OF it_i_r_matnr ,
it_i_r_matkl  TYPE STANDARD TABLE OF WSRP_RANGESMATKL,"TABLES PARAM
wa_i_r_matkl  LIKE LINE OF it_i_r_matkl ,
it_e_t_wrplte  TYPE STANDARD TABLE OF WSRP_WRPLTE,"TABLES PARAM
wa_e_t_wrplte  LIKE LINE OF it_e_t_wrplte ,
it_e_t_wrpe  TYPE STANDARD TABLE OF WRPE,"TABLES PARAM
wa_e_t_wrpe  LIKE LINE OF it_e_t_wrpe .

DATA(ld_i_or_and) = 'Check type of data required'.
DATA(ld_i_decmara) = 'Check type of data required'.
DATA(ld_i_cprog) = 'some text here'.
DATA(ld_i_tcode) = 'some text here'.

"populate fields of struture and append to itab
append wa_i_t_customers to it_i_t_customers.

"populate fields of struture and append to itab
append wa_i_r_matnr to it_i_r_matnr.

"populate fields of struture and append to itab
append wa_i_r_matkl to it_i_r_matkl.

"populate fields of struture and append to itab
append wa_e_t_wrplte to it_e_t_wrplte.

"populate fields of struture and append to itab
append wa_e_t_wrpe to it_e_t_wrpe. . CALL FUNCTION 'WSRP_SELECT_REQUIREMENTS' * EXPORTING * i_or_and = ld_i_or_and * i_decmara = ld_i_decmara * i_cprog = ld_i_cprog * i_tcode = ld_i_tcode TABLES i_t_customers = it_i_t_customers * i_r_matnr = it_i_r_matnr * i_r_matkl = it_i_r_matkl e_t_wrplte = it_e_t_wrplte * e_t_wrpe = it_e_t_wrpe EXCEPTIONS ERROR = 1 . " WSRP_SELECT_REQUIREMENTS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_i_or_and  TYPE WSRP_ANDORLINK ,
it_i_t_customers  TYPE STANDARD TABLE OF WSRP_CUSTOMERS ,
wa_i_t_customers  LIKE LINE OF it_i_t_customers,
ld_i_decmara  TYPE WSRP_MARADATA ,
it_i_r_matnr  TYPE STANDARD TABLE OF WSRP_RANGESMATNR ,
wa_i_r_matnr  LIKE LINE OF it_i_r_matnr,
ld_i_cprog  TYPE SYCPROG ,
it_i_r_matkl  TYPE STANDARD TABLE OF WSRP_RANGESMATKL ,
wa_i_r_matkl  LIKE LINE OF it_i_r_matkl,
ld_i_tcode  TYPE SYTCODE ,
it_e_t_wrplte  TYPE STANDARD TABLE OF WSRP_WRPLTE ,
wa_e_t_wrplte  LIKE LINE OF it_e_t_wrplte,
it_e_t_wrpe  TYPE STANDARD TABLE OF WRPE ,
wa_e_t_wrpe  LIKE LINE OF it_e_t_wrpe.

ld_i_or_and = 'some text here'.

"populate fields of struture and append to itab
append wa_i_t_customers to it_i_t_customers.
ld_i_decmara = 'some text here'.

"populate fields of struture and append to itab
append wa_i_r_matnr to it_i_r_matnr.
ld_i_cprog = 'some text here'.

"populate fields of struture and append to itab
append wa_i_r_matkl to it_i_r_matkl.
ld_i_tcode = 'some text here'.

"populate fields of struture and append to itab
append wa_e_t_wrplte to it_e_t_wrplte.

"populate fields of struture and append to itab
append wa_e_t_wrpe to it_e_t_wrpe.

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