SAP Function Modules

K_UNITCOSTING_TEXTS_COPY SAP Function module







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

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


Pattern for FM K_UNITCOSTING_TEXTS_COPY - K UNITCOSTING TEXTS COPY





CALL FUNCTION 'K_UNITCOSTING_TEXTS_COPY' "
  EXPORTING
    tc_bzobj =                  " ckhs-bzobj    Reference object of costing
*   tc_language = '*'           " thead-tdspras
*   savemode_direct = SPACE     "
  TABLES
    tc_rk70f_source_imp =       " rk70f         Source table of the key part which BZOBJ manages
    tc_rk70f_target_imp =       " rk70f         Target table of the key part which BZOBJ manages
  EXCEPTIONS
    BZOBJ_NOT_VALID = 1         "               BZOBJ does not exist or key determination is not possible
    DIFF_NUMBER_OF_ENTRYS = 2   "               Number of table entries target table source table not equal
    DUPLICATE_RECORD = 3        "               Target table entry equals source table entry
    FATAL_ERROR = 4             "               Internal error: further processing is not possible
    KLVAR_NOT_DEFINED = 5       "               Costing variant is not available in table TCK03
    NO_ENTRY_IN_RK70F = 6       "               Import table is empty
    NO_KALKA_FOR_KLVAR = 7      "               Costing type is not available in table TCK01
    .  "  K_UNITCOSTING_TEXTS_COPY

ABAP code example for Function Module K_UNITCOSTING_TEXTS_COPY





The ABAP code below is a full code listing to execute function module K_UNITCOSTING_TEXTS_COPY 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_tc_rk70f_source_imp  TYPE STANDARD TABLE OF RK70F,"TABLES PARAM
wa_tc_rk70f_source_imp  LIKE LINE OF it_tc_rk70f_source_imp ,
it_tc_rk70f_target_imp  TYPE STANDARD TABLE OF RK70F,"TABLES PARAM
wa_tc_rk70f_target_imp  LIKE LINE OF it_tc_rk70f_target_imp .


SELECT single BZOBJ
FROM CKHS
INTO @DATA(ld_tc_bzobj).


DATA(ld_tc_language) = Check type of data required
DATA(ld_savemode_direct) = 'some text here'.

"populate fields of struture and append to itab
append wa_tc_rk70f_source_imp to it_tc_rk70f_source_imp.

"populate fields of struture and append to itab
append wa_tc_rk70f_target_imp to it_tc_rk70f_target_imp. . CALL FUNCTION 'K_UNITCOSTING_TEXTS_COPY' EXPORTING tc_bzobj = ld_tc_bzobj * tc_language = ld_tc_language * savemode_direct = ld_savemode_direct TABLES tc_rk70f_source_imp = it_tc_rk70f_source_imp tc_rk70f_target_imp = it_tc_rk70f_target_imp EXCEPTIONS BZOBJ_NOT_VALID = 1 DIFF_NUMBER_OF_ENTRYS = 2 DUPLICATE_RECORD = 3 FATAL_ERROR = 4 KLVAR_NOT_DEFINED = 5 NO_ENTRY_IN_RK70F = 6 NO_KALKA_FOR_KLVAR = 7 . " K_UNITCOSTING_TEXTS_COPY
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 ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "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_tc_bzobj  TYPE CKHS-BZOBJ ,
it_tc_rk70f_source_imp  TYPE STANDARD TABLE OF RK70F ,
wa_tc_rk70f_source_imp  LIKE LINE OF it_tc_rk70f_source_imp,
ld_tc_language  TYPE THEAD-TDSPRAS ,
it_tc_rk70f_target_imp  TYPE STANDARD TABLE OF RK70F ,
wa_tc_rk70f_target_imp  LIKE LINE OF it_tc_rk70f_target_imp,
ld_savemode_direct  TYPE STRING .


SELECT single BZOBJ
FROM CKHS
INTO ld_tc_bzobj.


"populate fields of struture and append to itab
append wa_tc_rk70f_source_imp to it_tc_rk70f_source_imp.

ld_tc_language = Check type of data required

"populate fields of struture and append to itab
append wa_tc_rk70f_target_imp to it_tc_rk70f_target_imp.
ld_savemode_direct = '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_TEXTS_COPY or its description.