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

Inserting a line in a internal table

Former Member
0 Likes
627

Hello guys , I want to insert in the forst line of my internal table son titles in order to move the entire table to txt file , But I dont kno how I can put the titles in the first line, any suggestion ? DO I have to use a index?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
602

Yes, you need to use an index

Here are the variants for insert

1. INSERT [wa INTO|INITIAL LINE INTO] itab [INDEX idx].

2. INSERT [wa INTO|INITIAL LINE INTO] TABLE itab.

3. INSERT LINES OF itab1 [FROM idx1] [TO idx2]

INTO itab2 [INDEX idx3].

4. INSERT LINES OF itab1 [FROM idx1] [TO idx2]

INTO TABLE itab2.

3 REPLIES 3
Read only

Former Member
0 Likes
603

Yes, you need to use an index

Here are the variants for insert

1. INSERT [wa INTO|INITIAL LINE INTO] itab [INDEX idx].

2. INSERT [wa INTO|INITIAL LINE INTO] TABLE itab.

3. INSERT LINES OF itab1 [FROM idx1] [TO idx2]

INTO itab2 [INDEX idx3].

4. INSERT LINES OF itab1 [FROM idx1] [TO idx2]

INTO TABLE itab2.

Read only

Former Member
0 Likes
602

Where are you writing the text file??

If you are using GUI_download, then you can pass the header text( in a different internal table) to the FM.

If you are using open dataset you can write the header first and then the internal table.

I dont think inserting text in the data table is a good idea.

Read only

Former Member
0 Likes
602

First create an internal table with header line only and in the second u keep all data.After that use FM GUI_Download and mark Append = 'X' in the FM.Thats it,u will get the desired output.

Reward If found helpful.