Skip to Content
0
Former Member
Sep 28, 2005 at 10:11 AM

Downloading two internal tables in same text file

382 Views

I have one internal table as like below.

Data:begin of itab1 occurs 0,

rec(5),

end of itab1.

-


Itab1 is getting updated from input text file(Continuous text).

Here Itab1 contains one record with Indicator '01 and n number of records with indicator '02'.

This needs to be seperated in to two internal tables.

data:Begin of Itab_Head occurs 0,

Rec_ind(2) type C,

Name(3) type C,

end of itab_Head.

data:Begin of Itab_Item occurs 0,

Rec_ind(2) type C,

Id(3) type C,

Status(10,

end of itab_Item.

loop at itab1.

If itab1-Rec+0(2) = '01'.

Itab_Head-Rec_Ind = itab1-rec+0(2).

Itab_Head-Name = itab1-rec+2(3).

Append Itab_Head.

elseif itab1-rec+0(2) = '02'.

Itab_Item-Rec_Ind = itab1-rec+0(2).

Itab_Item-Id = itab1-rec+2(3).

Append Itab_Item.

endif.

endloop.

After moving to the internal tables I am doing some processing and updating the status of Itab_item.

After all these again I have to download the internal table as a text file.Now my question is.

I have values in 2 diff internal tables.How to download the two in same file.