2020 Jun 16 11:49 AM
Hi ,
I want to write report program to read constants and text elements from includes,report programs and function modules.
Input should be program,include or FM name and output should give list of text elements and constants.
Please let me know how this can be developed.
Thank you.
2020 Jun 16 11:55 AM
Hello sanjana.lingras
If I were in your shoes, I'd first see how SE38 transaction works, when the Text Elements options is selected.
As to the constants, I'd check how RPR_ABAP_SOURCE_SCAN report works. You could basically copy and tweak its logic.
Kind regards,2020 Jun 16 12:02 PM
I need to scan 21,000 objects for constants and text elements, also it should scan into the FMs and includes called inside program if possible.
2020 Jun 16 12:13 PM
I don't mean you should go to SE38 and manually check for text elements. No. I meant to debug the transaction and check its logic.
Better yet, use your favorite search engine and search for "sap abap function to list text elements of program". In one of the results of my favorite search engine I found function READ_TEXT_ELEMENTS.
As to the includes and functions, in this case you will need to look for INCLUDE and CALL FUNCTION keywords in the source code. Then get the include/function name and add it to the list of objects to be processed. Run your report's logic for the found objects.
Kind regards,
Mateusz2020 Jun 16 12:37 PM
I would go with Mateusz suggestion, and copy the report RS_ABAP_SOURCE_SCAN (which is the report that is actually called from RPR_ABAP_SOURCE_SCAN as well), and adapt it to your need.
First get acquainted and try the report with searching for "CONSTANTS" in a subset of programs or packages you want to analyse.
For your program you will have to do the following for constants:
CONSTANTS: const_fixval TYPE char1 VALUE '1',
const_dynval TYPE char1 VALUE const_fixval.
For text you will have to do at leas this:
DATA: prog TYPE PROGNAME VALUE 'PROGRAM_NAME',
itab TYPE STANDARD TABLE OF TEXTPOOL.
READ TEXTPOOL prog INTO itab LANGUAGE sy-langu.
Be aware, that there can be lots of different implementations, that might not adhere to how you would expect constants and text to be implemented. As always, there are many roads that lead to Rome.
2020 Jun 16 4:05 PM