concatenate 'TCode:' p_tcode tstct-ttext into w_gridtxt
separated by space.
endif.
* get program name for ALV grid title
if not p_pname is initial.
select single * from trdirt where name = p_pname
and sprsl = sy-langu.
concatenate 'Program:' p_pname tstct-ttext into w_gridtxt
separated by space.
endif.
* determine search words
keywords-word = 'CALL'.
append keywords.
keywords-word = 'FORM'.
append keywords.
keywords-word = 'PERFORM'.
append keywords.
keywords-word = 'SUBMIT'.
append keywords.
keywords-word = 'INCLUDE'.
append keywords.
keywords-word = 'AUTHORITY-CHECK'.
append keywords.
if not p_tcode is initial.
* get program name from TCode
select single pgmna from tstc into wa_tstc-pgmna
where tcode eq p_tcode.
if not wa_tstc-pgmna is initial.
p_pname = wa_tstc-pgmna.
* TCode does not include program name, but does have reference TCode
else.
select single param from tstcp into wa_tstcp-param
where tcode eq p_tcode.
if sy-subrc = 0.
check wa_tstcp-param(1) = '/'.
check wa_tstcp-param+1(1) = '*'.
if wa_tstcp-param ca ' '.
endif.
w_off = sy-fdpos + 1.
subtract 2 from sy-fdpos.
if sy-fdpos gt 0.
p_tcode = wa_tstcp-param+2(sy-fdpos).
endif.
select single pgmna from tstc into wa_tstc-pgmna
where tcode eq p_tcode.
p_pname = wa_tstc-pgmna.
if sy-subrc <> 0.
message s110(/saptrx/asc) with 'No program found for: ' p_tcode."#EC NOTEXT
stop.
endif.
else.
message s110(/saptrx/asc) with 'No program found for: ' p_tcode."#EC NOTEXT
stop.
endif.
endif.
endif.
* Call customer-function aus Program coding
read report p_pname into sourcetab.
if sy-subrc > 0.
message e017(enhancement) with p_pname raising no_program."#EC *
endif.
scan abap-source sourcetab tokens into i_stoken statements into i_sstmnt keywords from keywords overflow into c_overflow with includes WITH ANALYSIS. "#EC
if sy-subrc > 0. "keine/syntakt. falsche Ablauflog./Fehler im Skanner
程序代码: