Application Development 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: 

How to match two internal tables

calvinkarlo
Explorer
0 Kudos

Dear All,

I have internal tables, 1st contains all table data with headers and 2nd table contain headers that I need.

I can't map this using column since there is a possibility that Headers might interchange.

My expected output is to retain the fields that exists in T_FRT_VLD table.

2 REPLIES 2

Tukutupap
Participant

If I understood this correctly, you have a table with dynamic columns and you are able to transpose it, and then you want to delete all columns that are not listed in table T_FRT_VLD, correct? I apologize if this is not correct but there is very little information to work on.

It looks like you have all you need. To start, you can dynamically create a table with the columns listed in table T_FRT_VLD, to follow your example that'd be a table with 3 columns named as described.

Secondly, you have all your data in T_INPTFL, and in GT_INTERN you have all indexes for each column. So you can query GT_INTERN and get the indexes of all the columns listed in T_INPTFL. That'd give you back columns 1, 3 and 4

Then you can loop at T_INPTFL and move the content of fields 1, 3 and 4 to your new dynamically created table.

Looks like you have repeated columns, but it also looks that the data is the same so you can use the first one you read.

Good luck!

Sandra_Rossi
Active Contributor
0 Kudos

As you present the detailed input data, it would be more clear if you indicate the detailed expected result instead of unclear "retain the fields that exists in T_FRT_VLD table".