Application Development 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: 

how to use the data from one include in another include?

Former Member
0 Kudos
932

Hello,

Say I have an include that contains all the data declarations and another include contains some forms. Do I need to include the include with data declaration in the include with forms? If not, how can I use, say, an internal table that I have declared in the data declaration include in the forms include?

Thanks a lot!

Regards,

Anyi

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
432

Just include both in your main program. By doing this, all you are really doing is including all of the source code into your program. Make sure to INCLUDE the data declarations first.

INCLUDE ztesttop.   Top Declarations
INCLUDE ztestF01.   Forms

Regards,

Rich Heilman

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
433

Just include both in your main program. By doing this, all you are really doing is including all of the source code into your program. Make sure to INCLUDE the data declarations first.

INCLUDE ztesttop.   Top Declarations
INCLUDE ztestF01.   Forms

Regards,

Rich Heilman

Former Member
0 Kudos
432

you first create a report program

there,

write all the includes there.

LIKE

INCLUDE ZDATA_DECLARATIONS

INCLUDE ZFORMS.

etc..

Former Member
0 Kudos
432

Sample Code:

REPORT ZTEST.

INCLUDE ZTESTTOP. " Data declarations Include

INCLUDE ZTESTFORMS. " Subroutines

All the declarations in the TOP include are global variables and can be accessed in the FORMS include.

Any variables declared inside the FORMS include will not be available outside the FORMS include.

-Kiran

former_member181962
Active Contributor
0 Kudos
432

if an include has the data declaration, then include it in the report which has all the forms and logic .

report ztest

include zdata.

write: v_val. "v_val is declared in zdata

Regards,

ravi

Former Member
0 Kudos
432

Usually you include both these in the main program.

INCLUDE DATA_DECL_INCLUDE

INCLUDE FORMS_INCLUDE.

Main program.

If you do this all the variables you have declared in the data declaration include will be available for the forms include.

Regards,

Ravi

Former Member
0 Kudos
432

Hi

follow like this.

PROGRAM TEST.

INCLUDE INC_DECLARATIONS.

INCLUDE INC_FUNC_MODULES.

...

In INC_DECLARATIONS all data will be declared.

Func modules in INC_FUNC_MODULES can use those declarations.

Bala

Former Member
0 Kudos
432

hi,

if u say the first include is ZMIN1 and the second report or some include like ZMIN2 then

under second one

Report ZMIN2.

Include ZMIN1.

i think it would be helpful for you

Regards,

Naveen

Former Member
0 Kudos
432

Hi Anyi,

1) Yes,You can use both INCLUDEs in a report.

2) For this create a report and specify these two includes as

REPORT ZREPORT.

INCLUDE ZREPORT_DATA.

INCLUDE ZREPORT_FORMS.

Thanks,

Vinay