Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Read report

Former Member
0 Likes
884

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

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 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

4 REPLIES 4
Read only

Former Member
0 Likes
825

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

Read only

Former Member
0 Likes
825

Hi,

Use SCAN ABAP_SOURCE statement..

For more help refer to this link..[SCAN ABAP_SOURCE|http://help.sap.com/abapdocu/en/ABAPSCAN.htm.]

Read only

matt
Active Contributor
0 Likes
825

If you syntax check a program that has a faulty include - won't that give you a syntax error anyway?

Read only

Former Member
0 Likes
826

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