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.
- Find all FMs for existing Smart Forms in system
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.
- Fetch SF include source code
It can be done in a several ways: via CL_RECA_RS_SERVICES
class, via table REPOSRC
, but the simplest way is ABAP statement READ REPORT
.
- Search
SO10
text element name in the source code
- Get Smart Form names for the FMs from hit list. It can be done via
STXFADMI
table, like in below snippet, but the more correct way is SSF_FUNCTION_MODULE_NAME
FM
Bingo!
Sample solution could look like this:
DATA: lt_source TYPE TABLE OF string,
lt_smartforms TYPE TABLE OF d010inc,
so_text TYPE char50,
fs_form TYPE string,
used_in TYPE TABLE OF string,
len TYPE i.
* populating the list of SmartForm FMs
SELECT * FROM d010inc AS d
INTO TABLE lt_smartforms
WHERE master LIKE '/1BCDWB/%'
AND include LIKE '/1BCDWB/%'.
so_text = '85XX_FOOTER'. " <- our SO10 text element name
LOOP AT lt_smartforms ASSIGNING FIELD-SYMBOL(<fs_fm_name>).
* reading FM source code
READ REPORT <fs_fm_name>-include INTO lt_source.
* checking if SO11 exists in source code
FIND FIRST OCCURRENCE OF so_text IN TABLE lt_source.
IF sy-subrc = 0.
len = strlen( <fs_fm_name>-include ) - 7.
* searching for SmartForm related to the target FM
SELECT SINGLE formname
FROM stxfadmi
INTO fs_form
WHERE fmnumb = <fs_fm_name>-include+len(4).
IF sy-subrc = 0.
APPEND fs_form TO used_in.
ENDIF.
ENDIF.
ENDLOOP.
Yes, it is junky, not elegant and awkward, but who said it should be so?