2023 Dec 19 4:15 PM
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.
2023 Dec 19 11:17 PM
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!
2023 Dec 19 11:42 PM
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".