‎2009 Mar 25 7:27 AM
hi
i am developing a report that will read another report code.
here i want to copy certain lines of code once again i.e. if there is upload function called in the report i want to copy all the parameters that are there in the report.
can some one tell me how can i copy code that is there in between 18 and 48(sy-tabix) of a report ?
thanks in advance
‎2009 Mar 25 7:33 AM
If you have data in internal table use:
Loop at itab inot ws_itab.
If ws_itab CS 'CAll FUNCTION'
Set the flag
ENDIF.
IF flag = 'X'.
copy the codes.
elseif flag = 'X' and ws_itab CS 'ENDIF'.
flag = 'X'.
Endif.Else:
Use :SCAN-ABAP SOURCE STATEMENT.
[SCAN-ABAP|http://help.sap.com/abapdocu/en/ABAPSCAN.htm]
Regards,
Gurpreet
‎2009 Mar 25 7:33 AM
If you have data in internal table use:
Loop at itab inot ws_itab.
If ws_itab CS 'CAll FUNCTION'
Set the flag
ENDIF.
IF flag = 'X'.
copy the codes.
elseif flag = 'X' and ws_itab CS 'ENDIF'.
flag = 'X'.
Endif.Else:
Use :SCAN-ABAP SOURCE STATEMENT.
[SCAN-ABAP|http://help.sap.com/abapdocu/en/ABAPSCAN.htm]
Regards,
Gurpreet
‎2009 Mar 25 7:35 AM
USE BELOW SYNTAX.
DATA: IT TYPE TABLE OF STRING.
READ REPORT 'REPORT NAME' INTO TABLE IT.
LOOP AT IT INTO WA.
HERE YOU CAN CHECK FOR THE CALL FUNCTION STATEMENT.
YOU CAN USE 'SEARCH' KEYWORD FOR IT..
ENDLOOP.
‎2009 Mar 25 7:37 AM
Assume the following simple report:
REPORT ZSTRUC1.
WRITE / 'Hello, I am a little structure!'.
and the following lines of another program:
DATA CODE(72) OCCURS 10.
READ REPORT 'ZSTRUC1' INTO CODE.
APPEND 'SKIP.' TO CODE.
APPEND 'WRITE / ''and I am a dynamic extension!''.' TO CODE.
INSERT REPORT 'ZDYN2' FROM CODE.
so in this way u can copy lines and edit from one report to other..
Regards,
Anirban.
‎2009 Mar 25 9:40 AM