‎2009 May 22 6:21 AM
hi all,
i have a report in which i have 2 include programs so can i use the variable of 1 include prog. into other and if yes then how can i ??
thanxx.....
‎2009 May 22 6:23 AM
yes this can be done.
if the variable is a global variable inside the include which is called first, then it can be used in the next include.
hope it helps...
‎2009 May 22 6:26 AM
>
> yes this can be done.
>
> if the variable is a global variable inside the include which is called first, then it can be used in the next include.
>
> hope it helps...
please can u show me that in brief how i can do it??
thanx...
‎2009 May 22 6:45 AM
Hi Nilesh,
Eg :
report main_program.
include inc_1.
include inc_2.
now suppose the incluce inc_1 has a variable defined in it. You can use the same in inc_2.
You might say it is not getting the variable in inc_2. That might happen when the firs include is in inactive state.
ry chking out and still if facing any issue, do get back.
best regards
‎2009 May 22 6:56 AM
>
> Hi Nilesh,
>
> Eg :
>
> report main_program.
>
> include inc_1.
>
> include inc_2.
>
>
>
>
> now suppose the incluce inc_1 has a variable defined in it. You can use the same in inc_2.
>
> You might say it is not getting the variable in inc_2. That might happen when the firs include is in inactive state.
>
> ry chking out and still if facing any issue, do get back.
>
> best regards
thanx now i got that i can use it in 2nd include but can u plzzz be more clear like give me a simple example or so.
like main prog.
incl 1.
var1
incl 2.
i want to use this var1 in incl 2.
thanx...
‎2009 May 22 6:31 AM
hi
ya u can
for eg : this is ur main program
PROGRAM TITLE : Main Program
here u use
INCLUDE: second Program.
this is ur second program
PROGRAM TITLE : second Program
here u declare one variable globally as below
DATA: V_DATE1(8) TYPE c,
now this variable can be used in Main Program wrvr u need....
Regards
Smitha
‎2009 May 22 6:32 AM
Yes it can be done...Just right the Include name into the other program.
Ex:
INCLUDE INC1.
Data: W_char(10) type c Value 'TEST'.Program1:
Report NAME1.
INCLUDE INC1.
Write : W_CHAR.Program2:
Report NAME2.
INCLUDE INC1.
Write : W_CHAR.
‎2009 May 22 6:32 AM
Hello,
If the variables are global then it is used in all the includes.
if is external subroutine then we cannot use it directly.
example
PERFORM y_f_convert_decimals IN PROGRAM ZINCLUDE
USING y_v_kbetr
y_v_waers1
y_lv_currdec
CHANGING y_v_fcurr1.
‎2009 May 23 11:34 AM