Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Include program

Hi all,

I am tyring to develop an report.In this I want the definition of the subroutine in an include. This the code I have written :

<b>Main program :</b>

*********************************************************

REPORT zotcrgt003 .

INCLUDE z_i_otcrgt003. " include for data Declarations.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .

PARAMETERS : p_zbukr TYPE regup-zbukr ,

p_zlsch TYPE regup-zlsch ,

zw_laufd LIKE f110v-laufd ,

zw_laufi LIKE f110v-laufi .

SELECT-OPTIONS : s_kunnr FOR regup-kunnr.

SELECTION-SCREEN END OF BLOCK b1 .

PERFORM language_translation.

INCLUDE z_i_otcrgt0031. " include in whihc i Defined the above form

break-point.

*********************************************************

<b>Include program :</b>

*********************************************************

form language_translation.

SELECT SINGLE * FROM ZTFIN WHERE

fname = 'Z_F140_ACC_ST_01'

AND spras = 'E'.

SELECT SINGLE * FROM ztfin INTO t_ztfin WHERE

fname = 'Z_F140_ACC_ST_01'

AND spras = 'I'.

endform. " language_translation

*********************************************************

This is working fine, but when I keep the include statements together like this :

INCLUDE z_i_otcrgt003.

INCLUDE z_i_otcrgt0031.

I am getting an error saying statement is not accessible.

Can anyone explain me what is it so ?

Regards,

Varun.

Message was edited by: varun sonu

Tags:
Former Member
replied

INCLUDE statement is location specific which means that the statements in the INCLUDE will be expanded in the compiled code at the same location where you put this statement. So in your example what it is doing is soon after the data declarations, it is having FORM ... ENDFORM statements and then your START-OF-SELECTION, SELECTION-SCREEN etc.

That is why you are getting this error. Routines should be at the end of the program, which means your INCLUDE should also be at the end.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question