SAP Function Modules

CONDITION_RECORD_READ SAP Function module







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

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


Pattern for FM CONDITION_RECORD_READ - CONDITION RECORD READ





CALL FUNCTION 'CONDITION_RECORD_READ' "
  EXPORTING
*   pi_kvewe = 'A'              " t685-kvewe
    pi_kappl =                  " t685-kappl
    pi_kschl =                  " t685-kschl
*   pi_kotabnr =                " t682i-kotabnr
*   pi_bufrd =                  " pispr-bufrd
    pi_i_komk =                 " komk
    pi_i_komp =                 " komp
*   pi_scale_read =             " sy-marky
*   pi_kalsm =                  " t683s-kalsm
  IMPORTING
    pe_i_vake =                 " vakekond
* TABLES
*   pi_t_kschl =                " wpkschl
*   px_t_xvake =                " vakekond
*   pe_t_vake =                 " vakekond
*   pe_t_scale =                " condscale
  EXCEPTIONS
    NO_RECORD_FOUND = 1         "
    .  "  CONDITION_RECORD_READ

ABAP code example for Function Module CONDITION_RECORD_READ





The ABAP code below is a full code listing to execute function module CONDITION_RECORD_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_pe_i_vake  TYPE VAKEKOND ,
it_pi_t_kschl  TYPE STANDARD TABLE OF WPKSCHL,"TABLES PARAM
wa_pi_t_kschl  LIKE LINE OF it_pi_t_kschl ,
it_px_t_xvake  TYPE STANDARD TABLE OF VAKEKOND,"TABLES PARAM
wa_px_t_xvake  LIKE LINE OF it_px_t_xvake ,
it_pe_t_vake  TYPE STANDARD TABLE OF VAKEKOND,"TABLES PARAM
wa_pe_t_vake  LIKE LINE OF it_pe_t_vake ,
it_pe_t_scale  TYPE STANDARD TABLE OF CONDSCALE,"TABLES PARAM
wa_pe_t_scale  LIKE LINE OF it_pe_t_scale .


SELECT single KVEWE
FROM T685
INTO @DATA(ld_pi_kvewe).


SELECT single KAPPL
FROM T685
INTO @DATA(ld_pi_kappl).


SELECT single KSCHL
FROM T685
INTO @DATA(ld_pi_kschl).


SELECT single KOTABNR
FROM T682I
INTO @DATA(ld_pi_kotabnr).


DATA(ld_pi_bufrd) = some text here
DATA(ld_pi_i_komk) = 'Check type of data required'.
DATA(ld_pi_i_komp) = 'Check type of data required'.
DATA(ld_pi_scale_read) = 'some text here'.

SELECT single KALSM
FROM T683S
INTO @DATA(ld_pi_kalsm).


"populate fields of struture and append to itab
append wa_pi_t_kschl to it_pi_t_kschl.

"populate fields of struture and append to itab
append wa_px_t_xvake to it_px_t_xvake.

"populate fields of struture and append to itab
append wa_pe_t_vake to it_pe_t_vake.

"populate fields of struture and append to itab
append wa_pe_t_scale to it_pe_t_scale. . CALL FUNCTION 'CONDITION_RECORD_READ' EXPORTING * pi_kvewe = ld_pi_kvewe pi_kappl = ld_pi_kappl pi_kschl = ld_pi_kschl * pi_kotabnr = ld_pi_kotabnr * pi_bufrd = ld_pi_bufrd pi_i_komk = ld_pi_i_komk pi_i_komp = ld_pi_i_komp * pi_scale_read = ld_pi_scale_read * pi_kalsm = ld_pi_kalsm IMPORTING pe_i_vake = ld_pe_i_vake * TABLES * pi_t_kschl = it_pi_t_kschl * px_t_xvake = it_px_t_xvake * pe_t_vake = it_pe_t_vake * pe_t_scale = it_pe_t_scale EXCEPTIONS NO_RECORD_FOUND = 1 . " CONDITION_RECORD_READ
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_pe_i_vake  TYPE VAKEKOND ,
ld_pi_kvewe  TYPE T685-KVEWE ,
it_pi_t_kschl  TYPE STANDARD TABLE OF WPKSCHL ,
wa_pi_t_kschl  LIKE LINE OF it_pi_t_kschl,
ld_pi_kappl  TYPE T685-KAPPL ,
it_px_t_xvake  TYPE STANDARD TABLE OF VAKEKOND ,
wa_px_t_xvake  LIKE LINE OF it_px_t_xvake,
ld_pi_kschl  TYPE T685-KSCHL ,
it_pe_t_vake  TYPE STANDARD TABLE OF VAKEKOND ,
wa_pe_t_vake  LIKE LINE OF it_pe_t_vake,
ld_pi_kotabnr  TYPE T682I-KOTABNR ,
it_pe_t_scale  TYPE STANDARD TABLE OF CONDSCALE ,
wa_pe_t_scale  LIKE LINE OF it_pe_t_scale,
ld_pi_bufrd  TYPE PISPR-BUFRD ,
ld_pi_i_komk  TYPE KOMK ,
ld_pi_i_komp  TYPE KOMP ,
ld_pi_scale_read  TYPE SY-MARKY ,
ld_pi_kalsm  TYPE T683S-KALSM .


SELECT single KVEWE
FROM T685
INTO ld_pi_kvewe.


"populate fields of struture and append to itab
append wa_pi_t_kschl to it_pi_t_kschl.

SELECT single KAPPL
FROM T685
INTO ld_pi_kappl.


"populate fields of struture and append to itab
append wa_px_t_xvake to it_px_t_xvake.

SELECT single KSCHL
FROM T685
INTO ld_pi_kschl.


"populate fields of struture and append to itab
append wa_pe_t_vake to it_pe_t_vake.

SELECT single KOTABNR
FROM T682I
INTO ld_pi_kotabnr.


"populate fields of struture and append to itab
append wa_pe_t_scale to it_pe_t_scale.

ld_pi_bufrd = some text here
ld_pi_i_komk = 'some text here'.
ld_pi_i_komp = 'some text here'.
ld_pi_scale_read = 'some text here'.

SELECT single KALSM
FROM T683S
INTO ld_pi_kalsm.

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