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

append split data into internal table w.r.t fields

Hai friends,

I am getting the data matnr : 13235,12124,34234

and maktx : aaaa,bbbb , cccc

and lgort : 234, 345, 456

But I have taken the structure as begin of itab

matnr like -


,

maktx like -


,

lgort like-----,

end of itab.

now the data as i need to append first row as 13235 to matnr

aaaa to maktx

234 to lgort,

and second row as 12124 to matnr

bbbb to maktx

345 to lgort

and same as third row

Iam spliting the data but the problem is here matnr is variable i.e based on counter of matnr it should append those no of rows

please give the solution,

prasad.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 17, 2008 at 09:14 AM

    Hi Prasad,

    Loop at i_matnr.
      itab-matnr = i_matnr-matnr. 
      Read table i_maktx with key matnr = i_matnr-matnr.
      if sy-subrc = 0.
       itab-maktx = i_maktx-maktx.
      endif.
    
      Read table i_lgort with key matnr = i_matnr-matnr.
      if sy-subrc = 0.
       itab-lgort = i_lgort-lgort.
      endif.
      append itab.
    Endloop.
    

    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.