Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

READ TABLE FROM WA

0 Likes
1,533

Hi,

I am working on a existing program where it does a read based on work area so it should compare all fields of work area to find whether a record exists in internal table but i found it compares only first 4 fields .How is it.This is a standard internal table

READ TABLE it_scr_exp TRANSPORTING NO FIELDS
    FROM v_scr_exp.
  IF sy-subrc EQ 0 AND sy-tabix NE tc_exp-current_line.
    MESSAGE e224(zsl).
*   That entry already exists.
  ENDIF.

Regards

3 REPLIES 3
Read only

Former Member
0 Likes
909

When you use the FROM <wa> clause in read stament,

The work area wa must be a data object that is compatible with the line type of the internal table. The first found line of the internal table is read for which the values in the columns of the table key match the values in the corresponding components of wa.

For standard table there is no unique key. Try using sorted/hashed table type.

Hope this helps you.

Read only

0 Likes
909

Hi,

while developing the program developer or functionality is to check only first four fields.

If you required to add all fields you can define the key field table same as original one.

Read only

Former Member
0 Likes
909

Hi chandra,

Try to use this syntax to compare all fields in Work area.

READ TABLE it_scr_exp into v_scr_exp1 TRANSPORTING NO FIELDS

FROM v_scr_exp COMPARING ALL FIELDS.

Thanks,

Prasad.