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

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

Former Member
0 Likes
2,591

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

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,091

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

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

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,092

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

Read only

Former Member
0 Likes
2,091

you first create a report program

there,

write all the includes there.

LIKE

INCLUDE ZDATA_DECLARATIONS

INCLUDE ZFORMS.

etc..

Read only

Former Member
0 Likes
2,091

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

Read only

Former Member
0 Likes
2,091

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

Read only

Former Member
0 Likes
2,091

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

Read only

Former Member
0 Likes
2,091

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

Read only

Former Member
0 Likes
2,091

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

Read only

Former Member
0 Likes
2,091

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