1

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

1
  • Are you looking for all literals in a program, or just specific hard-coded values?
    – Esti
    Sep 13, 2013 at 5:59

1 Answer 1

1

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

1
  • thank you for the answer, unfortunately my system is pretty ancient... 4.6C and i don't have a regular expression engine. The idea could have been very good though. Sep 5, 2013 at 8:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.