SAP Function Modules

K_UNITCOSTING_DISPLAY SAP Function module







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

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


Pattern for FM K_UNITCOSTING_DISPLAY - K UNITCOSTING DISPLAY





CALL FUNCTION 'K_UNITCOSTING_DISPLAY' "
  EXPORTING
*   kuc_cospa = SPACE           " cospa
*   kuc_count_days = 0          "
*   kuc_key_fully_qualified = SPACE  " rk70eq-char1
*   kuc_rk70k_bwvar = SPACE     " rk70k-bwvar
    kuc_rk70k_bzobj =           " rk70k-bzobj
*   kuc_rk70k_ewknz = 0         " rk70k-ewknz
*   kuc_rk70k_herkt = SPACE     " rk70k-herkt
*   kuc_rk70k_kadky = 00000000  " rk70k-kadky
*   kuc_rk70k_kalka = SPACE     " rk70k-kalka
    kuc_rk70k_kalnr =           " rk70k-kalnr
    kuc_rk70k_kkart =           " rk70k-kkart
*   kuc_rk70k_kkzma = SPACE     " rk70k-kkzma
    kuc_rk70k_kokrs =           " rk70k-kokrs
*   kuc_rk70k_lednr = '00'      " rk70k-lednr
*   kuc_rk70k_tvers = 01        " rk70k-tvers
*   kuc_t_820 = SPACE           " t820
*   kuc_rk70k_matnr = SPACE     " rk70k-matnr
*   kuc_rk70k_wrttp = '01'      " rk70k-wrttp
*   kuc_rk70k_versn = '000'     " rk70k-versn
*   kuc_rk70k_werks = SPACE     " rk70k-werks
  IMPORTING
    kuc_rk70k_rc =              " rk70k-rc
  TABLES
    kuc_posting =               "
  EXCEPTIONS
    ABNORMAL_END = 1            "               Error in control tables
    .  "  K_UNITCOSTING_DISPLAY

ABAP code example for Function Module K_UNITCOSTING_DISPLAY





The ABAP code below is a full code listing to execute function module K_UNITCOSTING_DISPLAY 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_kuc_rk70k_rc  TYPE RK70K-RC ,
it_kuc_posting  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_kuc_posting  LIKE LINE OF it_kuc_posting .

DATA(ld_kuc_cospa) = 'Check type of data required'.
DATA(ld_kuc_count_days) = 'some text here'.

DATA(ld_kuc_key_fully_qualified) = some text here

DATA(ld_kuc_rk70k_bwvar) = some text here

DATA(ld_kuc_rk70k_bzobj) = some text here

DATA(ld_kuc_rk70k_ewknz) = Check type of data required

DATA(ld_kuc_rk70k_herkt) = some text here

DATA(ld_kuc_rk70k_kadky) = 20210129

DATA(ld_kuc_rk70k_kalka) = some text here

DATA(ld_kuc_rk70k_kalnr) = Check type of data required

DATA(ld_kuc_rk70k_kkart) = some text here

DATA(ld_kuc_rk70k_kkzma) = some text here

DATA(ld_kuc_rk70k_kokrs) = some text here

DATA(ld_kuc_rk70k_lednr) = some text here

DATA(ld_kuc_rk70k_tvers) = Check type of data required
DATA(ld_kuc_t_820) = 'Check type of data required'.

DATA(ld_kuc_rk70k_matnr) = some text here

DATA(ld_kuc_rk70k_wrttp) = some text here

DATA(ld_kuc_rk70k_versn) = some text here

DATA(ld_kuc_rk70k_werks) = some text here

"populate fields of struture and append to itab
append wa_kuc_posting to it_kuc_posting. . CALL FUNCTION 'K_UNITCOSTING_DISPLAY' EXPORTING * kuc_cospa = ld_kuc_cospa * kuc_count_days = ld_kuc_count_days * kuc_key_fully_qualified = ld_kuc_key_fully_qualified * kuc_rk70k_bwvar = ld_kuc_rk70k_bwvar kuc_rk70k_bzobj = ld_kuc_rk70k_bzobj * kuc_rk70k_ewknz = ld_kuc_rk70k_ewknz * kuc_rk70k_herkt = ld_kuc_rk70k_herkt * kuc_rk70k_kadky = ld_kuc_rk70k_kadky * kuc_rk70k_kalka = ld_kuc_rk70k_kalka kuc_rk70k_kalnr = ld_kuc_rk70k_kalnr kuc_rk70k_kkart = ld_kuc_rk70k_kkart * kuc_rk70k_kkzma = ld_kuc_rk70k_kkzma kuc_rk70k_kokrs = ld_kuc_rk70k_kokrs * kuc_rk70k_lednr = ld_kuc_rk70k_lednr * kuc_rk70k_tvers = ld_kuc_rk70k_tvers * kuc_t_820 = ld_kuc_t_820 * kuc_rk70k_matnr = ld_kuc_rk70k_matnr * kuc_rk70k_wrttp = ld_kuc_rk70k_wrttp * kuc_rk70k_versn = ld_kuc_rk70k_versn * kuc_rk70k_werks = ld_kuc_rk70k_werks IMPORTING kuc_rk70k_rc = ld_kuc_rk70k_rc TABLES kuc_posting = it_kuc_posting EXCEPTIONS ABNORMAL_END = 1 . " K_UNITCOSTING_DISPLAY
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_kuc_rk70k_rc  TYPE RK70K-RC ,
ld_kuc_cospa  TYPE COSPA ,
it_kuc_posting  TYPE STANDARD TABLE OF STRING ,
wa_kuc_posting  LIKE LINE OF it_kuc_posting,
ld_kuc_count_days  TYPE STRING ,
ld_kuc_key_fully_qualified  TYPE RK70EQ-CHAR1 ,
ld_kuc_rk70k_bwvar  TYPE RK70K-BWVAR ,
ld_kuc_rk70k_bzobj  TYPE RK70K-BZOBJ ,
ld_kuc_rk70k_ewknz  TYPE RK70K-EWKNZ ,
ld_kuc_rk70k_herkt  TYPE RK70K-HERKT ,
ld_kuc_rk70k_kadky  TYPE RK70K-KADKY ,
ld_kuc_rk70k_kalka  TYPE RK70K-KALKA ,
ld_kuc_rk70k_kalnr  TYPE RK70K-KALNR ,
ld_kuc_rk70k_kkart  TYPE RK70K-KKART ,
ld_kuc_rk70k_kkzma  TYPE RK70K-KKZMA ,
ld_kuc_rk70k_kokrs  TYPE RK70K-KOKRS ,
ld_kuc_rk70k_lednr  TYPE RK70K-LEDNR ,
ld_kuc_rk70k_tvers  TYPE RK70K-TVERS ,
ld_kuc_t_820  TYPE T820 ,
ld_kuc_rk70k_matnr  TYPE RK70K-MATNR ,
ld_kuc_rk70k_wrttp  TYPE RK70K-WRTTP ,
ld_kuc_rk70k_versn  TYPE RK70K-VERSN ,
ld_kuc_rk70k_werks  TYPE RK70K-WERKS .

ld_kuc_cospa = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_kuc_posting to it_kuc_posting.
ld_kuc_count_days = 'some text here'.

ld_kuc_key_fully_qualified = some text here

ld_kuc_rk70k_bwvar = some text here

ld_kuc_rk70k_bzobj = some text here

ld_kuc_rk70k_ewknz = Check type of data required

ld_kuc_rk70k_herkt = some text here

ld_kuc_rk70k_kadky = 20210129

ld_kuc_rk70k_kalka = some text here

ld_kuc_rk70k_kalnr = Check type of data required

ld_kuc_rk70k_kkart = some text here

ld_kuc_rk70k_kkzma = some text here

ld_kuc_rk70k_kokrs = some text here

ld_kuc_rk70k_lednr = some text here

ld_kuc_rk70k_tvers = Check type of data required
ld_kuc_t_820 = 'Check type of data required'.

ld_kuc_rk70k_matnr = some text here

ld_kuc_rk70k_wrttp = some text here

ld_kuc_rk70k_versn = some text here

ld_kuc_rk70k_werks = some text here

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