‎2011 Aug 18 2:27 PM
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
‎2011 Aug 18 2:54 PM
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.
‎2011 Aug 18 3:03 PM
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.
‎2011 Aug 18 3:43 PM
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.