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 communicate one include program with other include program

Aditya
Participant
0 Likes
1,907

Hi all,

As we know, we can communicate from one report to another report program using Export and import parameters.

But the same is not working for Include program instead showing a dump.

Please suggest any idea to hold one value from a variable from one include program to other variable to another include program under same report program.

Please respond back for any clarifications needed from my side.

Regards,
Aditya

9 REPLIES 9
Read only

SharathYaralkattimath
Contributor
0 Likes
1,824

Hi Aditya,

Try declaring global variables in the TOPINCLUDE.

you can access those in all INCLUDEs......

Thanks,

Sharath

Read only

mahesh_madhavan
Participant
0 Likes
1,824

This message was moderated.

Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,824

Hi,

Sample code.

data: m1 type i,

       m2 type i,

       m3 type i.

start-of-selection.

m1 = '10'.

m2 = '20'.

include ysample.

write: m3.

**----------------------------*********

INCLUDEProgram: YSAMPLE

m3 = m1 + m2.

Regards,

Venkat

Read only

0 Likes
1,824

Hi Venkat/Mahesh/Sharath,

Mine is an Enhancement for a standard program.

I need to have all the values of the internal table of the standard include program to my created enhancement internal table.

I observed that, values from standard include pgm are getting vanished when it come to my enhancement.

I need to use all the values from standard include program itab and my custom itab to update the standard databse table.

Regards,

Aditya

Read only

Aditya
Participant
0 Likes
1,824

hi all,

I got cleared it myself.

I have used shred memory concept using EXPORT space TO MEMORY ID <id>.

Thank you.

Read only

Former Member
0 Likes
1,824

Hi Aditya,

within the same main program you can either use a top include or the main program itself for global data definitions. These will be known for all includes, if you don't have local data definitions (for example in form routines) with the same name.

But EXPORT / IMPORT is also working here. I have used that many times.

You have to make sure, that data source and target have the same structure, the fields have the same order, length and type.

Regards,

Klaus

Read only

matt
Active Contributor
0 Likes
1,824

Simple solution: don't.

INCLUDES should only be used to breaking large amounts of source code into manageable chunks. They are really not suitable for modularisation or creating re-usable objects.

Far better would be to create a function module that does the work, or, better, a class.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,824

First, include programs are not executable, they can only be executed when part of a main program, they are not function pool nor module pool.

So which kind of statement did you wrote to get a dump, could you paste significant part of code, or elaborate on your requirement, I cannot imagine how an EXPORT or INPORT statement generating a dump is related to usage of Include ?

Regards,

Raymond

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,824

I would suggest to share with us all the information, i.e. what enhancement are you trying to do exactly, instead of spoon-feeding it. Maybe there is a totally different solution.

Also agree with Raymond - it seems unlikely dump is related to usage of EXPORT/IMPORT in the include specifically. But again, maybe this is not even a problem to begin with and we can't tell unless there is a full disclosure of what's really going on.