SAP Function Modules

K_RES_READ_RESRC_PRICING SAP Function module







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

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


Pattern for FM K_RES_READ_RESRC_PRICING - K RES READ RESRC PRICING





CALL FUNCTION 'K_RES_READ_RESRC_PRICING' "
  EXPORTING
    i_crarg =                   " crarg
*   i_variant = '000'           " crvar1-variant
    i_unit =                    " komp-vrkme
*   i_quantity =                " komp-mgame
*   i_basis_value =             " komp-wrbtr
*   i_waers =                   " komk-waerk
*   i_dialog = SPACE            " c
  IMPORTING
    e_cr =                      " komv-kwert
    e_waers =                   " komv-waers
    e_kpein =                   " komv-kpein
    e_variant =                 " crvar2-variant
  EXCEPTIONS
    KOKRS_NOT_FOUND = 1         "
    NO_SCHEME_IN_KOKRS_FOUND = 2  "
    NO_VARIANT_IN_VERSION_FOUND = 3  "
    NO_KALSM_FOR_VARIANT = 4    "
    DATA_MISSING = 5            "
    CURRENCY_NOT_FOUND = 6      "
    RESSOURCE_NOT_FOUND = 7     "
    REPMAT_ERROR = 8            "
    BKLAS_NOT_FOUND = 9         "
    NO_PRICE_FOUND = 10         "
    NO_KALSM_POSITION_FOUND = 11  "
    .  "  K_RES_READ_RESRC_PRICING

ABAP code example for Function Module K_RES_READ_RESRC_PRICING





The ABAP code below is a full code listing to execute function module K_RES_READ_RESRC_PRICING 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_e_cr  TYPE KOMV-KWERT ,
ld_e_waers  TYPE KOMV-WAERS ,
ld_e_kpein  TYPE KOMV-KPEIN ,
ld_e_variant  TYPE CRVAR2-VARIANT .

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

SELECT single VARIANT
FROM CRVAR1
INTO @DATA(ld_i_variant).


DATA(ld_i_unit) = Check type of data required

DATA(ld_i_quantity) = Check type of data required

DATA(ld_i_basis_value) = 20.50

DATA(ld_i_waers) = Check type of data required
DATA(ld_i_dialog) = 'Check type of data required'. . CALL FUNCTION 'K_RES_READ_RESRC_PRICING' EXPORTING i_crarg = ld_i_crarg * i_variant = ld_i_variant i_unit = ld_i_unit * i_quantity = ld_i_quantity * i_basis_value = ld_i_basis_value * i_waers = ld_i_waers * i_dialog = ld_i_dialog IMPORTING e_cr = ld_e_cr e_waers = ld_e_waers e_kpein = ld_e_kpein e_variant = ld_e_variant EXCEPTIONS KOKRS_NOT_FOUND = 1 NO_SCHEME_IN_KOKRS_FOUND = 2 NO_VARIANT_IN_VERSION_FOUND = 3 NO_KALSM_FOR_VARIANT = 4 DATA_MISSING = 5 CURRENCY_NOT_FOUND = 6 RESSOURCE_NOT_FOUND = 7 REPMAT_ERROR = 8 BKLAS_NOT_FOUND = 9 NO_PRICE_FOUND = 10 NO_KALSM_POSITION_FOUND = 11 . " K_RES_READ_RESRC_PRICING
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 ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "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_e_cr  TYPE KOMV-KWERT ,
ld_i_crarg  TYPE CRARG ,
ld_e_waers  TYPE KOMV-WAERS ,
ld_i_variant  TYPE CRVAR1-VARIANT ,
ld_e_kpein  TYPE KOMV-KPEIN ,
ld_i_unit  TYPE KOMP-VRKME ,
ld_e_variant  TYPE CRVAR2-VARIANT ,
ld_i_quantity  TYPE KOMP-MGAME ,
ld_i_basis_value  TYPE KOMP-WRBTR ,
ld_i_waers  TYPE KOMK-WAERK ,
ld_i_dialog  TYPE C .

ld_i_crarg = 'Check type of data required'.

SELECT single VARIANT
FROM CRVAR1
INTO ld_i_variant.


ld_i_unit = Check type of data required

ld_i_quantity = Check type of data required

ld_i_basis_value = 20.50

ld_i_waers = Check type of data required
ld_i_dialog = '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_RES_READ_RESRC_PRICING or its description.