SAP Function Modules

K_KKB_CO_OBJECT_READ SAP Function module







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

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


Pattern for FM K_KKB_CO_OBJECT_READ - K KKB CO OBJECT READ





CALL FUNCTION 'K_KKB_CO_OBJECT_READ' "
  EXPORTING
    object_data =               " kkbc          Input data KKBC
*   exchange_currency_types = SPACE  "          Swap currency types?
*   read_katyp = SPACE          "               Fill field KATYP?
*   i_mode = 1                  " sy-tabix      Schnoerer mode (1,2)
*   i_no_cosras = 'X'           " tkkb1-feh     Do not read COSRA
*   i_export_perkz =            " tkkb1-par
*   i_val_mode = '1'            "
*   i_give_herku =              " tkkb1-par
*   i_condense_deltas = SPACE   " tkkb1-par
*   i_give_input_quans = SPACE  " tkkb1-par     Parameters on Selection Screen
*   i_hktyp = SPACE             " tkkb1-par
*   i_calc_cont = SPACE         " tkkb1-par
  TABLES
*   t_beknz =                   "               Entry of debit indicator
*   t_herkz =                   "               Entry of origin indicator
    t_kkbc =                    " kkbc          Output internal KKBC
*   t_kstar =                   "               Entry of cost elements
*   t_wrttp =                   "               Entry of value type
*   t_cofgr =                   " cofgr         Field groups (standard: WOG,WKG)
*   t_objnr =                   "
*   t_versn =                   "
    .  "  K_KKB_CO_OBJECT_READ

ABAP code example for Function Module K_KKB_CO_OBJECT_READ





The ABAP code below is a full code listing to execute function module K_KKB_CO_OBJECT_READ 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_t_beknz  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_beknz  LIKE LINE OF it_t_beknz ,
it_t_herkz  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_herkz  LIKE LINE OF it_t_herkz ,
it_t_kkbc  TYPE STANDARD TABLE OF KKBC,"TABLES PARAM
wa_t_kkbc  LIKE LINE OF it_t_kkbc ,
it_t_kstar  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kstar  LIKE LINE OF it_t_kstar ,
it_t_wrttp  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_wrttp  LIKE LINE OF it_t_wrttp ,
it_t_cofgr  TYPE STANDARD TABLE OF COFGR,"TABLES PARAM
wa_t_cofgr  LIKE LINE OF it_t_cofgr ,
it_t_objnr  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_objnr  LIKE LINE OF it_t_objnr ,
it_t_versn  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_versn  LIKE LINE OF it_t_versn .

DATA(ld_object_data) = 'Check type of data required'.
DATA(ld_exchange_currency_types) = 'some text here'.
DATA(ld_read_katyp) = 'some text here'.
DATA(ld_i_mode) = '123 '.

SELECT single FEH
FROM TKKB1
INTO @DATA(ld_i_no_cosras).


SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_export_perkz).

DATA(ld_i_val_mode) = 'some text here'.

SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_give_herku).


SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_condense_deltas).


SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_give_input_quans).


SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_hktyp).


SELECT single PAR
FROM TKKB1
INTO @DATA(ld_i_calc_cont).


"populate fields of struture and append to itab
append wa_t_beknz to it_t_beknz.

"populate fields of struture and append to itab
append wa_t_herkz to it_t_herkz.

"populate fields of struture and append to itab
append wa_t_kkbc to it_t_kkbc.

"populate fields of struture and append to itab
append wa_t_kstar to it_t_kstar.

"populate fields of struture and append to itab
append wa_t_wrttp to it_t_wrttp.

"populate fields of struture and append to itab
append wa_t_cofgr to it_t_cofgr.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr.

"populate fields of struture and append to itab
append wa_t_versn to it_t_versn. . CALL FUNCTION 'K_KKB_CO_OBJECT_READ' EXPORTING object_data = ld_object_data * exchange_currency_types = ld_exchange_currency_types * read_katyp = ld_read_katyp * i_mode = ld_i_mode * i_no_cosras = ld_i_no_cosras * i_export_perkz = ld_i_export_perkz * i_val_mode = ld_i_val_mode * i_give_herku = ld_i_give_herku * i_condense_deltas = ld_i_condense_deltas * i_give_input_quans = ld_i_give_input_quans * i_hktyp = ld_i_hktyp * i_calc_cont = ld_i_calc_cont TABLES * t_beknz = it_t_beknz * t_herkz = it_t_herkz t_kkbc = it_t_kkbc * t_kstar = it_t_kstar * t_wrttp = it_t_wrttp * t_cofgr = it_t_cofgr * t_objnr = it_t_objnr * t_versn = it_t_versn . " K_KKB_CO_OBJECT_READ
IF SY-SUBRC EQ 0. "All OK 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_object_data  TYPE KKBC ,
it_t_beknz  TYPE STANDARD TABLE OF STRING ,
wa_t_beknz  LIKE LINE OF it_t_beknz,
ld_exchange_currency_types  TYPE STRING ,
it_t_herkz  TYPE STANDARD TABLE OF STRING ,
wa_t_herkz  LIKE LINE OF it_t_herkz,
ld_read_katyp  TYPE STRING ,
it_t_kkbc  TYPE STANDARD TABLE OF KKBC ,
wa_t_kkbc  LIKE LINE OF it_t_kkbc,
ld_i_mode  TYPE SY-TABIX ,
it_t_kstar  TYPE STANDARD TABLE OF STRING ,
wa_t_kstar  LIKE LINE OF it_t_kstar,
ld_i_no_cosras  TYPE TKKB1-FEH ,
it_t_wrttp  TYPE STANDARD TABLE OF STRING ,
wa_t_wrttp  LIKE LINE OF it_t_wrttp,
ld_i_export_perkz  TYPE TKKB1-PAR ,
it_t_cofgr  TYPE STANDARD TABLE OF COFGR ,
wa_t_cofgr  LIKE LINE OF it_t_cofgr,
ld_i_val_mode  TYPE STRING ,
it_t_objnr  TYPE STANDARD TABLE OF STRING ,
wa_t_objnr  LIKE LINE OF it_t_objnr,
ld_i_give_herku  TYPE TKKB1-PAR ,
it_t_versn  TYPE STANDARD TABLE OF STRING ,
wa_t_versn  LIKE LINE OF it_t_versn,
ld_i_condense_deltas  TYPE TKKB1-PAR ,
ld_i_give_input_quans  TYPE TKKB1-PAR ,
ld_i_hktyp  TYPE TKKB1-PAR ,
ld_i_calc_cont  TYPE TKKB1-PAR .

ld_object_data = '123 '.

"populate fields of struture and append to itab
append wa_t_beknz to it_t_beknz.
ld_exchange_currency_types = 'some text here'.

"populate fields of struture and append to itab
append wa_t_herkz to it_t_herkz.
ld_read_katyp = 'some text here'.

"populate fields of struture and append to itab
append wa_t_kkbc to it_t_kkbc.
ld_i_mode = '123 '.

"populate fields of struture and append to itab
append wa_t_kstar to it_t_kstar.

SELECT single FEH
FROM TKKB1
INTO ld_i_no_cosras.


"populate fields of struture and append to itab
append wa_t_wrttp to it_t_wrttp.

SELECT single PAR
FROM TKKB1
INTO ld_i_export_perkz.


"populate fields of struture and append to itab
append wa_t_cofgr to it_t_cofgr.
ld_i_val_mode = 'some text here'.

"populate fields of struture and append to itab
append wa_t_objnr to it_t_objnr.

SELECT single PAR
FROM TKKB1
INTO ld_i_give_herku.


"populate fields of struture and append to itab
append wa_t_versn to it_t_versn.

SELECT single PAR
FROM TKKB1
INTO ld_i_condense_deltas.


SELECT single PAR
FROM TKKB1
INTO ld_i_give_input_quans.


SELECT single PAR
FROM TKKB1
INTO ld_i_hktyp.


SELECT single PAR
FROM TKKB1
INTO ld_i_calc_cont.

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