SAP Function Modules

WRF_PPW_CALCITEMS_SAVE SAP Function module - Save Pricing Items in Database







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

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


Pattern for FM WRF_PPW_CALCITEMS_SAVE - WRF PPW CALCITEMS SAVE





CALL FUNCTION 'WRF_PPW_CALCITEMS_SAVE' "Save Pricing Items in Database
  EXPORTING
*   i_state_admin = 'A'         " wrf_ppw_state_admin  Status Administration
    is_calchead =               " wrf_ppw_ppdcalchead_sty  PPW: Structure for Pricing Header
*   i_foreign_docnr =           " wrf_ppw_ppdnr  Ext. Doc. No. of Application Calling Up Sales Price Calc.
    i_no_conditions =           " w_rpc_no_conditions  Keine Konditionen erzeugen
*   is_wakhd =                  " wakhd         Screen Field String for Promotion Header Data
*   it_wagud =                  " wagud_tab     Table Type for WAGUD
*   it_wapld =                  " wrf_rpr_wapld_tty  Table Type for WRF_RPR_WAPLD
*   it_calcitem =               " wrf_ppw_ppdcalcitem_tty
  IMPORTING
    et_calcitem =               " wrf_ppw_ppdcalcitem_tty  Tabelle der Kalkulationspositionen
    et_calcerro =               " wrf_ppw_ppdcalcerro_tty  PPW: Table for Error Handling
* CHANGING
*   xt_calcitem_control =       " wrf_ppw_ppdcalcitemctrl_tty  Management of Pricing Items
  EXCEPTIONS
    NO_CALCULATION_HEADER_GUID = 1  "           GUID des Kalkulationskopfs fehlt
    CALCULATION_HEADER_NOT_FOUND = 2  "         Kalkulationskopf ist nicht vorhanden
    WRONG_CALCULATION_HEADER = 3  "             Falscher Kalkulationskopf
    INTERNAL_ERROR = 4          "               Internal Error
    .  "  WRF_PPW_CALCITEMS_SAVE

ABAP code example for Function Module WRF_PPW_CALCITEMS_SAVE





The ABAP code below is a full code listing to execute function module WRF_PPW_CALCITEMS_SAVE 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_et_calcitem  TYPE WRF_PPW_PPDCALCITEM_TTY ,
ld_et_calcerro  TYPE WRF_PPW_PPDCALCERRO_TTY .

DATA(ld_xt_calcitem_control) = 'Check type of data required'.
DATA(ld_i_state_admin) = 'Check type of data required'.
DATA(ld_is_calchead) = 'Check type of data required'.
DATA(ld_i_foreign_docnr) = 'Check type of data required'.
DATA(ld_i_no_conditions) = 'Check type of data required'.
DATA(ld_is_wakhd) = 'Check type of data required'.
DATA(ld_it_wagud) = 'Check type of data required'.
DATA(ld_it_wapld) = 'Check type of data required'.
DATA(ld_it_calcitem) = 'Check type of data required'. . CALL FUNCTION 'WRF_PPW_CALCITEMS_SAVE' EXPORTING * i_state_admin = ld_i_state_admin is_calchead = ld_is_calchead * i_foreign_docnr = ld_i_foreign_docnr i_no_conditions = ld_i_no_conditions * is_wakhd = ld_is_wakhd * it_wagud = ld_it_wagud * it_wapld = ld_it_wapld * it_calcitem = ld_it_calcitem IMPORTING et_calcitem = ld_et_calcitem et_calcerro = ld_et_calcerro * CHANGING * xt_calcitem_control = ld_xt_calcitem_control EXCEPTIONS NO_CALCULATION_HEADER_GUID = 1 CALCULATION_HEADER_NOT_FOUND = 2 WRONG_CALCULATION_HEADER = 3 INTERNAL_ERROR = 4 . " WRF_PPW_CALCITEMS_SAVE
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_xt_calcitem_control  TYPE WRF_PPW_PPDCALCITEMCTRL_TTY ,
ld_et_calcitem  TYPE WRF_PPW_PPDCALCITEM_TTY ,
ld_i_state_admin  TYPE WRF_PPW_STATE_ADMIN ,
ld_et_calcerro  TYPE WRF_PPW_PPDCALCERRO_TTY ,
ld_is_calchead  TYPE WRF_PPW_PPDCALCHEAD_STY ,
ld_i_foreign_docnr  TYPE WRF_PPW_PPDNR ,
ld_i_no_conditions  TYPE W_RPC_NO_CONDITIONS ,
ld_is_wakhd  TYPE WAKHD ,
ld_it_wagud  TYPE WAGUD_TAB ,
ld_it_wapld  TYPE WRF_RPR_WAPLD_TTY ,
ld_it_calcitem  TYPE WRF_PPW_PPDCALCITEM_TTY .

ld_xt_calcitem_control = 'Check type of data required'.
ld_i_state_admin = 'Check type of data required'.
ld_is_calchead = 'Check type of data required'.
ld_i_foreign_docnr = 'Check type of data required'.
ld_i_no_conditions = 'Check type of data required'.
ld_is_wakhd = 'Check type of data required'.
ld_it_wagud = 'Check type of data required'.
ld_it_wapld = 'Check type of data required'.
ld_it_calcitem = 'Check type of data required'.

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