如何將report程序的源碼讀入內表,並進行修改操作?ABAP中提供一系列指令來實現此功能。語法如下:
INSERT REPORT prog FROM itab. 根據內表內容更新程序
READ REPORT prog INTO itab. 將程序讀入內表
DELETE REPORT prog. 刪除程序
示例程序:
DATA sourcecode(120) OCCURS 0 WITH HEADER LINE.
DATA length TYPE i.
READ REPORT 'ZTEST' INTO sourcecode.
DESCRIBE TABLE sourcecode LINES length.
length = length + 1.
INSERT '*Comment Line.' INTO sourcecode INDEX length.
INSERT REPORT 'ZTEST' FROM sourcecode.