2022 Sep 13 5:16 AM
Hi,
I know this is a basic abap question but please let me know how to change the field names of a internal table with field symbols in runtime. In the past I have done creating dynamic internal tables, assign values based on internal table field names but I have never done changing the field names on a internal table dynamically.
Example would be I have a internal table coming from an external app with the following structure:
I want the field names to be renamed as below dynamically at runtime:
Please let me know how to solve this.
Thanks,
Ashok
2022 Sep 13 5:39 AM
1. go and find the structure table from your code
2. and then edit the field names of your structure table and also text if needed.
3. save and active your structure table.
4. replace your changed fields from your code then save and active.
if any issues then never hasitate to contact me.
2022 Sep 13 5:54 AM
Hi Zeshan,
Thanks for the reply but all the changes like the field names need to be changed dynamically. There is no DD structure involved here. Its all at runtime. As I mentioned the first structure (refer screenshot 1) comes from an external vendor app. Inside my code at runtime I need to change the field names and make it similar to the 2nd Screenshot.
Regards
2022 Sep 13 7:07 AM
Hi Ashok,
The internal table field name cannot be changed dynamically at runtime. Instead, you can create a new internal table (dynamically if necessary) with a new structure and move the data using field symbols.
Thank you.
Best Regards,
Bhargava
2022 Sep 13 5:15 PM
Internally, the names of variables and structure components are always upper case, dot is not permitted, etc.
If you mean changing the column headings which are output to the users (screen, print form, etc.), then it's feasible.
2022 Sep 16 6:18 AM
you can also place these in another variable. The variable name can be modifiable in your code.
2022 Sep 19 1:58 PM
Create a second itab dynamically (but with correct field names, uppercase etc.) and then move data from first itab to this new one.
Where are you stuck?