SAP Function Modules

WFCSMDST_FCAST_WERKS_CREATE_M SAP Function module - Create Forecast per Plant (RFC Function Module)







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

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


Pattern for FM WFCSMDST_FCAST_WERKS_CREATE_M - WFCSMDST FCAST WERKS CREATE M





CALL FUNCTION 'WFCSMDST_FCAST_WERKS_CREATE_M' "Create Forecast per Plant (RFC Function Module)
  EXPORTING
    pi_werks =                  " t001w-werks   Plant
*   pi_packetsize = 300         " wrpacketsize  Package Size
*   pi_pl_date = SY-DATUM       " wfcs_date     Date
*   pi_simulation = ' '         " wfcs_boolean  Flag:Simulation (kein COMMIT)
*   pi_runtime_meas_profile = '0'  " wfcs_runtime_profile  Validity Period: Detail Level
*   pi_bapiret2_get = ' '       " wfcs_boolean  Flag: Fehlerprotokoll erstellen
*   pi_short_fcast_msg = ' '    " wfcs_boolean  Flag:Prognosemeldung als BAPIRET2
* TABLES
*   ti_sel_matnr =              " wfcs_sel_matnr  Selection Range for Material
*   ti_sel_date =               " wfcs_sel_date  Selektionsranges für letztes Prognosedatum PROP-PRDAT
*   ti_sel_perkz =              " wfcs_sel_perkz  Selection Range for Period Indicator
*   ti_sel_periv =              " wfcs_sel_periv  Selection Range for Posting Periods
*   ti_sel_prmod =              " wfcs_sel_prmod  Selection Range for Forecast Model
*   ti_sel_matkl =              " wfcs_sel_matkl  Selection Range for Material Group
*   te_bapiret2 =               " bapiret2      Error Log
*   te_runtime_info =           " wfcs_runtime_info  Ergebnis Laufzeitmessung
  EXCEPTIONS
    NO_AUTHORIZATION = 1        "               Fehlende Berechtigung zur Prognosedurchführung
    .  "  WFCSMDST_FCAST_WERKS_CREATE_M

ABAP code example for Function Module WFCSMDST_FCAST_WERKS_CREATE_M





The ABAP code below is a full code listing to execute function module WFCSMDST_FCAST_WERKS_CREATE_M 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_ti_sel_matnr  TYPE STANDARD TABLE OF WFCS_SEL_MATNR,"TABLES PARAM
wa_ti_sel_matnr  LIKE LINE OF it_ti_sel_matnr ,
it_ti_sel_date  TYPE STANDARD TABLE OF WFCS_SEL_DATE,"TABLES PARAM
wa_ti_sel_date  LIKE LINE OF it_ti_sel_date ,
it_ti_sel_perkz  TYPE STANDARD TABLE OF WFCS_SEL_PERKZ,"TABLES PARAM
wa_ti_sel_perkz  LIKE LINE OF it_ti_sel_perkz ,
it_ti_sel_periv  TYPE STANDARD TABLE OF WFCS_SEL_PERIV,"TABLES PARAM
wa_ti_sel_periv  LIKE LINE OF it_ti_sel_periv ,
it_ti_sel_prmod  TYPE STANDARD TABLE OF WFCS_SEL_PRMOD,"TABLES PARAM
wa_ti_sel_prmod  LIKE LINE OF it_ti_sel_prmod ,
it_ti_sel_matkl  TYPE STANDARD TABLE OF WFCS_SEL_MATKL,"TABLES PARAM
wa_ti_sel_matkl  LIKE LINE OF it_ti_sel_matkl ,
it_te_bapiret2  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_te_bapiret2  LIKE LINE OF it_te_bapiret2 ,
it_te_runtime_info  TYPE STANDARD TABLE OF WFCS_RUNTIME_INFO,"TABLES PARAM
wa_te_runtime_info  LIKE LINE OF it_te_runtime_info .


SELECT single WERKS
FROM T001W
INTO @DATA(ld_pi_werks).

DATA(ld_pi_packetsize) = 'Check type of data required'.
DATA(ld_pi_pl_date) = 'Check type of data required'.
DATA(ld_pi_simulation) = 'Check type of data required'.
DATA(ld_pi_runtime_meas_profile) = 'Check type of data required'.
DATA(ld_pi_bapiret2_get) = 'Check type of data required'.
DATA(ld_pi_short_fcast_msg) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_matnr to it_ti_sel_matnr.

"populate fields of struture and append to itab
append wa_ti_sel_date to it_ti_sel_date.

"populate fields of struture and append to itab
append wa_ti_sel_perkz to it_ti_sel_perkz.

"populate fields of struture and append to itab
append wa_ti_sel_periv to it_ti_sel_periv.

"populate fields of struture and append to itab
append wa_ti_sel_prmod to it_ti_sel_prmod.

"populate fields of struture and append to itab
append wa_ti_sel_matkl to it_ti_sel_matkl.

"populate fields of struture and append to itab
append wa_te_bapiret2 to it_te_bapiret2.

"populate fields of struture and append to itab
append wa_te_runtime_info to it_te_runtime_info. . CALL FUNCTION 'WFCSMDST_FCAST_WERKS_CREATE_M' EXPORTING pi_werks = ld_pi_werks * pi_packetsize = ld_pi_packetsize * pi_pl_date = ld_pi_pl_date * pi_simulation = ld_pi_simulation * pi_runtime_meas_profile = ld_pi_runtime_meas_profile * pi_bapiret2_get = ld_pi_bapiret2_get * pi_short_fcast_msg = ld_pi_short_fcast_msg * TABLES * ti_sel_matnr = it_ti_sel_matnr * ti_sel_date = it_ti_sel_date * ti_sel_perkz = it_ti_sel_perkz * ti_sel_periv = it_ti_sel_periv * ti_sel_prmod = it_ti_sel_prmod * ti_sel_matkl = it_ti_sel_matkl * te_bapiret2 = it_te_bapiret2 * te_runtime_info = it_te_runtime_info EXCEPTIONS NO_AUTHORIZATION = 1 . " WFCSMDST_FCAST_WERKS_CREATE_M
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_pi_werks  TYPE T001W-WERKS ,
it_ti_sel_matnr  TYPE STANDARD TABLE OF WFCS_SEL_MATNR ,
wa_ti_sel_matnr  LIKE LINE OF it_ti_sel_matnr,
ld_pi_packetsize  TYPE WRPACKETSIZE ,
it_ti_sel_date  TYPE STANDARD TABLE OF WFCS_SEL_DATE ,
wa_ti_sel_date  LIKE LINE OF it_ti_sel_date,
ld_pi_pl_date  TYPE WFCS_DATE ,
it_ti_sel_perkz  TYPE STANDARD TABLE OF WFCS_SEL_PERKZ ,
wa_ti_sel_perkz  LIKE LINE OF it_ti_sel_perkz,
ld_pi_simulation  TYPE WFCS_BOOLEAN ,
it_ti_sel_periv  TYPE STANDARD TABLE OF WFCS_SEL_PERIV ,
wa_ti_sel_periv  LIKE LINE OF it_ti_sel_periv,
ld_pi_runtime_meas_profile  TYPE WFCS_RUNTIME_PROFILE ,
it_ti_sel_prmod  TYPE STANDARD TABLE OF WFCS_SEL_PRMOD ,
wa_ti_sel_prmod  LIKE LINE OF it_ti_sel_prmod,
ld_pi_bapiret2_get  TYPE WFCS_BOOLEAN ,
it_ti_sel_matkl  TYPE STANDARD TABLE OF WFCS_SEL_MATKL ,
wa_ti_sel_matkl  LIKE LINE OF it_ti_sel_matkl,
ld_pi_short_fcast_msg  TYPE WFCS_BOOLEAN ,
it_te_bapiret2  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_te_bapiret2  LIKE LINE OF it_te_bapiret2,
it_te_runtime_info  TYPE STANDARD TABLE OF WFCS_RUNTIME_INFO ,
wa_te_runtime_info  LIKE LINE OF it_te_runtime_info.


SELECT single WERKS
FROM T001W
INTO ld_pi_werks.


"populate fields of struture and append to itab
append wa_ti_sel_matnr to it_ti_sel_matnr.
ld_pi_packetsize = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_date to it_ti_sel_date.
ld_pi_pl_date = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_perkz to it_ti_sel_perkz.
ld_pi_simulation = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_periv to it_ti_sel_periv.
ld_pi_runtime_meas_profile = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_prmod to it_ti_sel_prmod.
ld_pi_bapiret2_get = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_sel_matkl to it_ti_sel_matkl.
ld_pi_short_fcast_msg = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_te_bapiret2 to it_te_bapiret2.

"populate fields of struture and append to itab
append wa_te_runtime_info to it_te_runtime_info.

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