2023 Sep 12 3:27 PM
Hey Guys,
I have the following String : DATA : lt_kl TYPE STANDARD TABLE OF /bic/pmihklassi.
I am searching for a way to just take the name of the Internal table 'lt_kl' out of that
String and writing it into a variable.
Thank you for your help.
2023 Sep 12 4:00 PM
What did you already perform (Statements such as FIND, String functions, or?)
2023 Sep 12 4:39 PM
Do some code analysis, I guess?
Tokenise the code and it becomes a bit easier. See here: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapscan.htm
2023 Sep 12 4:41 PM
Hi Michel,
From what I understand, you have a string containing an ABAP command ("DATA : lt_kl TYPE STANDARD TABLE OF /bic/pmihklassi") and you want to parse that string to get the table name.
There are many possible solutions. I would recommend command SPLIT.. AT space INTO TABLE... , to have an internal table that would contain "DATA" in the first record, ":" in the second and "lt_kl" in the third. If you are not sure if you have a ":" or not between "DATA" and the table name, you can loop on the records, starting on the second one, and take the first record that is not equal to ":".
I hope this helps.
Patrice Poirier
2023 Sep 12 5:55 PM
Many different solutions, depending on the exact use case. What is it for? (ATC/code inspector, extraction to external software, source scan, etc.)