2009 Apr 14 3:36 PM
Hi all,
I have to read a report code along with all include files.
Is there any other way besides
Read report prg_name into itab.
As this is just providing main program source code.
I need main program source code along with include file code
so that i can perform a syntax check on a include file at runtime.
Thanks,
Smita
2009 Apr 14 5:30 PM
Hi,
Use this FM.
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
LANGUAGE = SY-LANGU
PROGRAM_NAME = ITAB-PROGNAME
WITH_INCLUDELIST = 'X'
ONLY_SOURCE = ' '
ONLY_TEXTS = ' '
READ_LATEST_VERSION = ' '
WITH_LOWERCASE = ' '
IMPORTING
PROG_INF = WS_RPY_PROG
TABLES
INCLUDE_TAB = ITAB_INCLUDE
SOURCE_EXTENDED = ITAB_SOURCE
TEXTELEMENTS = ITAB_TEXTS
EXCEPTIONS
CANCELLED = 1
NOT_FOUND = 2
PERMISSION_ERROR = 3
OTHERS = 4.
Hope it will help.
Issa
Hi,
Use this FM.
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
LANGUAGE = SY-LANGU
PROGRAM_NAME = ITAB-PROGNAME
WITH_INCLUDELIST = 'X'
ONLY_SOURCE = ' '
ONLY_TEXTS = ' '
READ_LATEST_VERSION = ' '
WITH_LOWERCASE = ' '
IMPORTING
PROG_INF = WS_RPY_PROG
TABLES
INCLUDE_TAB = ITAB_INCLUDE
SOURCE_EXTENDED = ITAB_SOURCE
TEXTELEMENTS = ITAB_TEXTS
EXCEPTIONS
CANCELLED = 1
NOT_FOUND = 2
PERMISSION_ERROR = 3
OTHERS = 4.
Hope it will help.
Issa
2009 Apr 14 4:15 PM
Hi Smitha,
try this fucntion module....
* Store report i ascii formt in table i_ascii_list
CALL FUNCTION 'LIST_TO_ASCI'
* EXPORTING
* LIST_INDEX = -1
TABLES
listasci = i_ascii_list
listobject = i_abaplist
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
endorm.
Regards,
Prabhudas
2009 Apr 14 5:01 PM
Hi,
Use SCAN ABAP_SOURCE statement..
For more help refer to this link..[SCAN ABAP_SOURCE|http://help.sap.com/abapdocu/en/ABAPSCAN.htm.]
2009 Apr 14 5:26 PM
If you syntax check a program that has a faulty include - won't that give you a syntax error anyway?
2009 Apr 14 5:30 PM
Hi,
Use this FM.
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
LANGUAGE = SY-LANGU
PROGRAM_NAME = ITAB-PROGNAME
WITH_INCLUDELIST = 'X'
ONLY_SOURCE = ' '
ONLY_TEXTS = ' '
READ_LATEST_VERSION = ' '
WITH_LOWERCASE = ' '
IMPORTING
PROG_INF = WS_RPY_PROG
TABLES
INCLUDE_TAB = ITAB_INCLUDE
SOURCE_EXTENDED = ITAB_SOURCE
TEXTELEMENTS = ITAB_TEXTS
EXCEPTIONS
CANCELLED = 1
NOT_FOUND = 2
PERMISSION_ERROR = 3
OTHERS = 4.
Hope it will help.
Issa
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |