简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM