‎2014 Jun 04 11:36 AM
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
‎2014 Jun 04 11:38 AM
Hi Aditya,
Try declaring global variables in the TOPINCLUDE.
you can access those in all INCLUDEs......
Thanks,
Sharath
‎2014 Jun 04 11:41 AM
‎2014 Jun 04 11:43 AM
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
‎2014 Jun 04 11:51 AM
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
‎2014 Jun 04 11:54 AM
hi all,
I got cleared it myself.
I have used shred memory concept using EXPORT space TO MEMORY ID <id>.
Thank you.
‎2014 Jun 04 11:56 AM
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
‎2014 Jun 04 12:29 PM
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.
‎2014 Jun 04 1:10 PM
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
‎2014 Jun 04 6:52 PM
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.