Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create a text file using a simple transformation

Koen_VL
Participant
0 Likes
641

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

4 REPLIES 4
Read only

former_member189629
Active Contributor
0 Likes
583

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.

Read only

0 Likes
583

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

Read only

0 Likes
583

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.

Read only

0 Likes
583

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