‎2008 Nov 18 7:44 PM
Hello,
I need to create a flatfile from an ABAP table. The problem is that the order of the fields in the ABAP internal table is not the same as they should appear in the text file.
I could create another internal table with the order I want to, transfer the data and then download that one. However, I would like to avoid that.
Is there any possibility that I could use the original internal table and do the re-order of the fields in a simple transformation so that the transformation would create the text file in the layout I want and I would just download that one?
Thanks
Koen
‎2008 Nov 18 7:48 PM
The transformation you mention too will take the same effort as moving into another itab. However, you can populate fields in the desired order separated by a delimiter into a string (an internal table with single field as string) and do a GUI_DOWNLOAD.
‎2008 Nov 18 7:53 PM
Hello,
thanks for your reply. Can you tell me which simple transformation tag I should be using to create that string? Do you maybe have an example?
thanks
Koen
‎2008 Nov 18 8:06 PM
declare an itab like below
data: begin of itab2 occurs 0,
line type string/line(1000) type c,
end of itab2.
now populate this itab2 with fields from itab1.
loop at itab1.
concatenate itab-f2 '|' (delimiter) itab1-f7 '|' .... itab1-fn into itab2-line.
append itab2.
cleat itab2.
endloop.
‎2008 Nov 18 8:23 PM
Hello,
I see, that's not what I had in mind. I would like to use a simple transformation to do this, using the statement call transfromation.
Koen