Skip to Content
author's profile photo Former Member
Former Member

READ TABLE FROM WA

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 18, 2011 at 01: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 18, 2011 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 18, 2011 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.