vlad-ardelean
vlad-ardelean

Reputation: 7622

How to find literals in source code of Smartforms and in SAPScripts (or reports, if the others can't be done)

I'd like to check hardcoded values in (a lot of) Smartforms and SAPScript forms.

I have found a way to read the source code of both of these, but it seems that i will have to go through a lot of parsing before I get anything reliable.

I've come across function module GET_LITERAL but that doesn't seem to help me much since i have to specify the offset of the value, if i got right what the function is doing in the first place.

I also found RS_LITERAL_LIST but that also doesn't do what i expect.

I also tried searching for reports and methods, but haven't found anything that seemed to help.

A backup plan would be to get some good parsing tool, so do you know of anything like that.

Anyway, any hints would be helpful and appreciated.

[EDIT] Forgot to mention, the version of my system is 4.6C

Upvotes: 1

Views: 1536

Answers (1)

Eric
Eric

Reputation: 1521

If you have a fairly recent version of ABAP, you can use a regex.

Follow the pattern of this example, but use your source as the text and create your own regex. Have it look for any single quotes on the end of a word separated by spaces or any integers with spaces on either side. That's just a start, you might need to work on a better pattern.

String functions count, find, and match

Upvotes: 1

Related Questions