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: 

Search in a String

0 Kudos
403

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.

4 REPLIES 4

raymond_giuseppi
Active Contributor
324

What did you already perform (Statements such as FIND, String functions, or?)

matt
Active Contributor
324

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

Patrice
Participant
0 Kudos
324

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

Sandra_Rossi
Active Contributor
0 Kudos
324

Many different solutions, depending on the exact use case. What is it for? (ATC/code inspector, extraction to external software, source scan, etc.)