Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

read... the rules about meaningfull subject titles please

Hi Guyz,

LOOP AT gt_data INTO gs_data FROM 2.


  • gs_data = gt_data-line.

SPLIT gs_data AT '|' INTO TABLE gt_columns.

READ TABLE gt_columns INDEX 1 ASSIGNING <fs_data>.

gt_tab-client = <fs_data>.

im reading the data using above read statement , iam doing it 11 times coz i know there is 11 entries (sy-tabix = 11)..but i dont wanna hardcode that bit after can i do it?..plz advise


Edited by: Julius Bussche on Oct 7, 2008 6:00 PM

Former Member

I see, but the problem is not LOOP vs. READ TABLE here...

The question is now, if in the target table the fields are in the same order, then in the source. If gt_tab is built up in the same sequence, like the source (that means client is the fierst field, asd is the second....wsd is the last), if yes than you can code like:


READ TABLE gt_columns INDEX sy-index ASSIGNING <fs_data>.
ASSIGN COMPONENT sy-index OF structure gt_tab TO <fs_target>.
<fs_target> = <fs_data>.

(sorry Rob, it still READ TABLE

One more thing: Can't you replace the whole thing with only:

SPLIT gs_data AT '|' INTO gt_tab-client, gt_tab-asd, ... , gt_tab-wsd.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question