I need to track down where within a large number of custom sapscripts and smartforms a specific standard text (SO10) is being used.
Apart from the equivalent of "check the code for each print script", I've not found a workable solution online. Any suggestions?
What concerns SmartForms, you cannot. You cannot just find it like you want it.
Unfortunately, in such ̶g̶o̶o̶d̶ ̶o̶l̶'̶ legacy technology as SmartForms everything is working legacy way, and standard texts are simply hard-coded. Yes, it looks awkward but they are really hard-coded, and these names are written out to SmartForm FM code every time it is re-generated.
So the only workaround here is to analyze the code.
There is a
D010INC
table containing all forms with their includes. The main point here is that all SmartForm FMs start with/1BCDWB/
prefix.The main logic is in the includes, so we need to find correspondent INCLUDE for the target form.
It can be done in a several ways: via
CL_RECA_RS_SERVICES
class, via tableREPOSRC
, but the simplest way is ABAP statementREAD REPORT
.SO10
text element name in the source codeSTXFADMI
table, like in below snippet, but the more correct way isSSF_FUNCTION_MODULE_NAME
FMBingo!
Sample solution could look like this:
Yes, it is junky, not elegant and awkward, but who said it should be so?
After posting, I found a partial solution. The code below will search for a standard text within sapscripts, but not smartforms.
This is a (fixed) version of the code found here: http://scn.sap.com/thread/179142