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 dynamic internal table where column names are row values

ashok2021
Explorer
0 Likes
2,035

Hi,

I have a requirement where the values come via a flat file:

The first row has the column names and the subsequent rows the values. I want to create a internal table where the column names of the internal table are the first row of the flat file and then the values are assigned accordingly. Please let me know how to achieve this.

Thanks,

Ashok

Hi,

I have a requirement where the values come via a flat file:

The first row has the column names and the subsequent rows the values. I want to create a internal table where the column names of the internal table are the first row of the flat file and then the values are assigned accordingly. Please let me know how to achieve this.

Thanks,

Ashok

4 REPLIES 4
Read only

Tukutupap
Participant
1,930

Had you spent 30 seconds making a google search instead of writing this you'd have your solution by now, but anyway...

Dynamic table creation is a very broad topic and has plenty of documentation, you can take a look at this for reference.

Read only

Sandra_Rossi
Active Contributor
1,930

Be careful, a column name doesn't accept lots of characters, so be careful to catch the exceptions so that to reject the file gently.

Read only

ashok2021
Explorer
0 Likes
1,930

Hi All,

Thanks for the answers. I have created dynamic internal tables and work areas based on the RTTS classes where I have taken DD tables as reference. But in this new requirement of mine data (including field names) comes from an external application in the form of a string. I created a flat structure and stored the data in it by appending the data. The data now comes in the following format:

From this I have to create a dynamic internal table where the first row becomes the column headings and the subsequent rows have values. My main issue is how do I transpose the first row as the new column name of the dynamic internal table.

Read only

0 Likes
1,930

If you are expanding on the original problem, you should edit your question instead of posting additional information as an aswer.