SAP Function Modules

K_PROCESS_PRICE_READ SAP Function module







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

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


Pattern for FM K_PROCESS_PRICE_READ - K PROCESS PRICE READ





CALL FUNCTION 'K_PROCESS_PRICE_READ' "
  EXPORTING
*   lednr = '00'                " cokl-lednr
    kokrs =                     " cssl-kokrs
    versn =                     " tka07-versn
    gjahr =                     " tka00-gjahr
    prznr =                     " cbpr-prznr
*   tarkz_type = 1              "
*   owaer_r =                   " csks-waers
*   policy =                    " bwstrat
  IMPORTING
    tarkz =                     " cost-tarkz
    leinh =                     " cssl-leinh
    vksta =                     " cokl-vksta
    objnr =                     " cssl-objnr
    owaer_s =                   " csks-waers
    ltext =                     " cbprp-ltext
  TABLES
    it_cobtr =                  " cobtr
    it_periods =                " periods
  EXCEPTIONS
    PRICE_NOT_FOUND = 1         "
    PROCESS_NOT_FOUND = 2       "
    .  "  K_PROCESS_PRICE_READ

ABAP code example for Function Module K_PROCESS_PRICE_READ





The ABAP code below is a full code listing to execute function module K_PROCESS_PRICE_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:
ld_tarkz  TYPE COST-TARKZ ,
ld_leinh  TYPE CSSL-LEINH ,
ld_vksta  TYPE COKL-VKSTA ,
ld_objnr  TYPE CSSL-OBJNR ,
ld_owaer_s  TYPE CSKS-WAERS ,
ld_ltext  TYPE CBPRP-LTEXT ,
it_it_cobtr  TYPE STANDARD TABLE OF COBTR,"TABLES PARAM
wa_it_cobtr  LIKE LINE OF it_it_cobtr ,
it_it_periods  TYPE STANDARD TABLE OF PERIODS,"TABLES PARAM
wa_it_periods  LIKE LINE OF it_it_periods .


SELECT single LEDNR
FROM COKL
INTO @DATA(ld_lednr).


SELECT single KOKRS
FROM CSSL
INTO @DATA(ld_kokrs).


SELECT single VERSN
FROM TKA07
INTO @DATA(ld_versn).


SELECT single GJAHR
FROM TKA00
INTO @DATA(ld_gjahr).


SELECT single PRZNR
FROM CBPR
INTO @DATA(ld_prznr).

DATA(ld_tarkz_type) = 'some text here'.

SELECT single WAERS
FROM CSKS
INTO @DATA(ld_owaer_r).

DATA(ld_policy) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_cobtr to it_it_cobtr.

"populate fields of struture and append to itab
append wa_it_periods to it_it_periods. . CALL FUNCTION 'K_PROCESS_PRICE_READ' EXPORTING * lednr = ld_lednr kokrs = ld_kokrs versn = ld_versn gjahr = ld_gjahr prznr = ld_prznr * tarkz_type = ld_tarkz_type * owaer_r = ld_owaer_r * policy = ld_policy IMPORTING tarkz = ld_tarkz leinh = ld_leinh vksta = ld_vksta objnr = ld_objnr owaer_s = ld_owaer_s ltext = ld_ltext TABLES it_cobtr = it_it_cobtr it_periods = it_it_periods EXCEPTIONS PRICE_NOT_FOUND = 1 PROCESS_NOT_FOUND = 2 . " K_PROCESS_PRICE_READ
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 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_tarkz  TYPE COST-TARKZ ,
ld_lednr  TYPE COKL-LEDNR ,
it_it_cobtr  TYPE STANDARD TABLE OF COBTR ,
wa_it_cobtr  LIKE LINE OF it_it_cobtr,
ld_leinh  TYPE CSSL-LEINH ,
ld_kokrs  TYPE CSSL-KOKRS ,
it_it_periods  TYPE STANDARD TABLE OF PERIODS ,
wa_it_periods  LIKE LINE OF it_it_periods,
ld_vksta  TYPE COKL-VKSTA ,
ld_versn  TYPE TKA07-VERSN ,
ld_objnr  TYPE CSSL-OBJNR ,
ld_gjahr  TYPE TKA00-GJAHR ,
ld_owaer_s  TYPE CSKS-WAERS ,
ld_prznr  TYPE CBPR-PRZNR ,
ld_ltext  TYPE CBPRP-LTEXT ,
ld_tarkz_type  TYPE STRING ,
ld_owaer_r  TYPE CSKS-WAERS ,
ld_policy  TYPE BWSTRAT .


SELECT single LEDNR
FROM COKL
INTO ld_lednr.


"populate fields of struture and append to itab
append wa_it_cobtr to it_it_cobtr.

SELECT single KOKRS
FROM CSSL
INTO ld_kokrs.


"populate fields of struture and append to itab
append wa_it_periods to it_it_periods.

SELECT single VERSN
FROM TKA07
INTO ld_versn.


SELECT single GJAHR
FROM TKA00
INTO ld_gjahr.


SELECT single PRZNR
FROM CBPR
INTO ld_prznr.

ld_tarkz_type = 'some text here'.

SELECT single WAERS
FROM CSKS
INTO ld_owaer_r.

ld_policy = '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 K_PROCESS_PRICE_READ or its description.