Keywords for creating Reports Dynamically
Here we will set visit a set of ABAP keywords which will help you to create a ABAP Report dynamically.
This keyword will help you to read a existing Report name into a internal table.
DATA: IT_REPORT TYPE TABLE OF string.
READ REPORT ‘REPORT NAME’ INTO IT_REPORT.
You can add few lines to this table or you can create a new report from scratch.
Once you have the table IT_REPORT filled with the program lines, we need to make sure whether any Syntax error exist or not.
SYNTAX-CHECK FOR IT_REPORT.
If the internal table contains syntax errors, the first message is assigned to variable err_msg, the corresponding error line assigned to variable line_no(TYPE I) and the first defective token is assigned to variable err_word.
For creating a new report we use the INSERT REPORT Keyword.
INSERT REPORT ‘Report Name’ FROM IT_REPORT.
We can also read Text elements of a program using READ TEXTPOOL and create new texts using INSERT TEXTPOOL keywords.
READ TEXTPOOL ‘ReportName’ INTO IT_POOL LANGUAGE sy-langu.
INSERT TEXTPOOL ‘ReportName’ FROM IT_POOL LANGUAGE sy-langu
IT_POOL is an internal table of structure textpool.