SAP Function Modules

IWPC_TLIST_CALCULATE SAP Function module







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

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


Pattern for FM IWPC_TLIST_CALCULATE - IWPC TLIST CALCULATE





CALL FUNCTION 'IWPC_TLIST_CALCULATE' "
  EXPORTING
    iv_auart =                  " caufvd-auart
*   iv_gsber =                  " caufvd-gsber
*   iv_date = SY-DATUM          " sy-datum
*   iv_with_over = ITOB_BOOL-FALSE  " itob_types-bool
*   iv_packsize_ext = 0         " sbiwa_s_interface-maxsize
*   iv_packsize_int = 0         " sbiwa_s_interface-maxsize
  IMPORTING
    ev_packcount =              " sbiwa_s_interface-datapakid
  TABLES
*   it_range_plnnr =            " rsrange
*   it_range_plnty =            " rsrange
    ct_plancosts =              " iwpc_simulated_plancosts
*   it_range_equnr =            " rsrange
*   it_range_kokrs =            " rsrange
*   it_range_tplnr =            " rsrange
*   it_range_wapos =            " rsrange
*   it_range_tstmp =            " rsrange
  EXCEPTIONS
    NO_MORE_DATA = 1            "
    ERR_PARAM = 2               "
    ERR_INTERNAL = 3            "
    .  "  IWPC_TLIST_CALCULATE

ABAP code example for Function Module IWPC_TLIST_CALCULATE





The ABAP code below is a full code listing to execute function module IWPC_TLIST_CALCULATE 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_ev_packcount  TYPE SBIWA_S_INTERFACE-DATAPAKID ,
it_it_range_plnnr  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_plnnr  LIKE LINE OF it_it_range_plnnr ,
it_it_range_plnty  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_plnty  LIKE LINE OF it_it_range_plnty ,
it_ct_plancosts  TYPE STANDARD TABLE OF IWPC_SIMULATED_PLANCOSTS,"TABLES PARAM
wa_ct_plancosts  LIKE LINE OF it_ct_plancosts ,
it_it_range_equnr  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_equnr  LIKE LINE OF it_it_range_equnr ,
it_it_range_kokrs  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_kokrs  LIKE LINE OF it_it_range_kokrs ,
it_it_range_tplnr  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_tplnr  LIKE LINE OF it_it_range_tplnr ,
it_it_range_wapos  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_wapos  LIKE LINE OF it_it_range_wapos ,
it_it_range_tstmp  TYPE STANDARD TABLE OF RSRANGE,"TABLES PARAM
wa_it_range_tstmp  LIKE LINE OF it_it_range_tstmp .


DATA(ld_iv_auart) = some text here

DATA(ld_iv_gsber) = some text here
DATA(ld_iv_date) = '20210129'.

DATA(ld_iv_with_over) = some text here

DATA(ld_iv_packsize_ext) = some text here

DATA(ld_iv_packsize_int) = some text here

"populate fields of struture and append to itab
append wa_it_range_plnnr to it_it_range_plnnr.

"populate fields of struture and append to itab
append wa_it_range_plnty to it_it_range_plnty.

"populate fields of struture and append to itab
append wa_ct_plancosts to it_ct_plancosts.

"populate fields of struture and append to itab
append wa_it_range_equnr to it_it_range_equnr.

"populate fields of struture and append to itab
append wa_it_range_kokrs to it_it_range_kokrs.

"populate fields of struture and append to itab
append wa_it_range_tplnr to it_it_range_tplnr.

"populate fields of struture and append to itab
append wa_it_range_wapos to it_it_range_wapos.

"populate fields of struture and append to itab
append wa_it_range_tstmp to it_it_range_tstmp. . CALL FUNCTION 'IWPC_TLIST_CALCULATE' EXPORTING iv_auart = ld_iv_auart * iv_gsber = ld_iv_gsber * iv_date = ld_iv_date * iv_with_over = ld_iv_with_over * iv_packsize_ext = ld_iv_packsize_ext * iv_packsize_int = ld_iv_packsize_int IMPORTING ev_packcount = ld_ev_packcount TABLES * it_range_plnnr = it_it_range_plnnr * it_range_plnty = it_it_range_plnty ct_plancosts = it_ct_plancosts * it_range_equnr = it_it_range_equnr * it_range_kokrs = it_it_range_kokrs * it_range_tplnr = it_it_range_tplnr * it_range_wapos = it_it_range_wapos * it_range_tstmp = it_it_range_tstmp EXCEPTIONS NO_MORE_DATA = 1 ERR_PARAM = 2 ERR_INTERNAL = 3 . " IWPC_TLIST_CALCULATE
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 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_ev_packcount  TYPE SBIWA_S_INTERFACE-DATAPAKID ,
ld_iv_auart  TYPE CAUFVD-AUART ,
it_it_range_plnnr  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_plnnr  LIKE LINE OF it_it_range_plnnr,
ld_iv_gsber  TYPE CAUFVD-GSBER ,
it_it_range_plnty  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_plnty  LIKE LINE OF it_it_range_plnty,
ld_iv_date  TYPE SY-DATUM ,
it_ct_plancosts  TYPE STANDARD TABLE OF IWPC_SIMULATED_PLANCOSTS ,
wa_ct_plancosts  LIKE LINE OF it_ct_plancosts,
ld_iv_with_over  TYPE ITOB_TYPES-BOOL ,
it_it_range_equnr  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_equnr  LIKE LINE OF it_it_range_equnr,
ld_iv_packsize_ext  TYPE SBIWA_S_INTERFACE-MAXSIZE ,
it_it_range_kokrs  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_kokrs  LIKE LINE OF it_it_range_kokrs,
ld_iv_packsize_int  TYPE SBIWA_S_INTERFACE-MAXSIZE ,
it_it_range_tplnr  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_tplnr  LIKE LINE OF it_it_range_tplnr,
it_it_range_wapos  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_wapos  LIKE LINE OF it_it_range_wapos,
it_it_range_tstmp  TYPE STANDARD TABLE OF RSRANGE ,
wa_it_range_tstmp  LIKE LINE OF it_it_range_tstmp.


ld_iv_auart = some text here

"populate fields of struture and append to itab
append wa_it_range_plnnr to it_it_range_plnnr.

ld_iv_gsber = some text here

"populate fields of struture and append to itab
append wa_it_range_plnty to it_it_range_plnty.
ld_iv_date = '20210129'.

"populate fields of struture and append to itab
append wa_ct_plancosts to it_ct_plancosts.

ld_iv_with_over = some text here

"populate fields of struture and append to itab
append wa_it_range_equnr to it_it_range_equnr.

ld_iv_packsize_ext = some text here

"populate fields of struture and append to itab
append wa_it_range_kokrs to it_it_range_kokrs.

ld_iv_packsize_int = some text here

"populate fields of struture and append to itab
append wa_it_range_tplnr to it_it_range_tplnr.

"populate fields of struture and append to itab
append wa_it_range_wapos to it_it_range_wapos.

"populate fields of struture and append to itab
append wa_it_range_tstmp to it_it_range_tstmp.

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