‎2007 May 02 2:15 PM
I dont get the expected value 5 from the PERFORM command. I tested explicitly putting value '123456' right on the OUT_PAR-VALUE and it showed on the report. but when I assign the VAR3 (which is the summation of VAR1 and VAR2) on OUT_PAR-VALUE, it wont realy appear. Where did i go wrong.
I tested the value of V3 on the debugger and it is giving me value 5. OUT_PAR-VALUE on the debugger is blank. I wonder why. <b>pls help. thanks. </b>
<b>screenshot of the sapscript code:</b>
http://i150.photobucket.com/albums/s116/painkiller2007/SAP/sapscript23.jpg
-
code of the called program
-
data: V1 type I,
V2 type I,
V3 type I.
form CALLSUB1 tables IN_PAR structure ITCSY
OUT_PAR structure ITCSY.
read table IN_PAR with key 'VAR1'.
if SY-SUBRC = 0.
V1 = IN_PAR-VALUE.
endif.
read table IN_PAR with key 'VAR2'.
if SY-SUBRC = 0.
V2 = IN_PAR-VALUE.
endif.
V3 = V1 + V2.
read table OUT_PAR with key 'OUTPUT1'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = V3.
MODIFY OUT_PAR INDEX SY-TABIX.
endform.
‎2007 May 02 2:45 PM
Hi,
Declare all the fields as TYPE C
data: V1(2) type C,
V2(2) type C,
V3(2) type C.
Regards
Sudheer
‎2007 May 02 2:20 PM
Hi,
form CALLSUB1 tables IN_PAR structure ITCSY
OUT_PAR structure ITCSY.
data: V1 type I, " Inside the Form and Endform
V2 type I,
V3 type I.
read table IN_PAR with key 'VAR1'.
if SY-SUBRC = 0.
V1 = IN_PAR-VALUE.
endif.
read table IN_PAR with key 'VAR2'.
if SY-SUBRC = 0.
V2 = IN_PAR-VALUE.
endif.
V3 = V1 + V2.
read table OUT_PAR with key 'OUTPUT1'.
CHECK SY-SUBRC = 0.
OUT_PAR-VALUE = V3.
MODIFY OUT_PAR INDEX SY-TABIX.
endform.
Regards
Sudheer
‎2007 May 02 2:20 PM
Try to use tranporting value in modify statement,,
also is the data local or global???
Hope solves your problem
Regards,
Jayant
Please award if helpful
Message was edited by:
JAYANT KUMAR
‎2007 May 02 2:24 PM
Did you define the OUTPUT1 variable also in the script itself?
Regards,
Ravi
‎2007 May 02 2:32 PM
<b>SUDHEER:</b> I put the variable declaration inside just like you said but still the same.
<b>RAVI: </b> I defined the OUTPUT1 too. the code is at the top. in fact, when you hardcode a value on OUT_PAR-VALUE, the value will be displayed on the sapscript report page.
‎2007 May 02 2:33 PM
Hi
Without touching the Print Program, we can change the sap script by using
Perform statements.
Using ITCSY structure.
Regards,
Sreeram
‎2007 May 02 2:40 PM
Everything ooks ok to me.
is there enough space in the window to print?
Regards,
Ravi
‎2007 May 02 2:45 PM
Hi,
Declare all the fields as TYPE C
data: V1(2) type C,
V2(2) type C,
V3(2) type C.
Regards
Sudheer
‎2007 May 02 2:45 PM
Hi,
as u have written in u r form endperform as a command line, write like this :
/: perform callsub1 in program z_sub
= using &var1&
= using &var2&
= changing &output1&
= endperform
Reward points if useful..
Regards
Nilesh
‎2007 May 02 2:56 PM
As advised by<b> SUDHEER,</b> I changed the variabled type from integer to character. I doubted it because as far as i know, I cant do math operations on character type but it did and it solved my issue. can someone explain this to me? that confuses me dramatically.
thanks to all of the contributors.