on 07-01-2008 4:57 PM
Hi,
I have 2 columns &BSID-DMBTR and &BSID-SKNTO& in a script and need to have a 3 column which is the difference of both these columns.
So in the script I have coded like this.
/: DEFINE &W_BALANCE&
/: &W_BALANCE& = &BSID-DMBTR& - &BSID-SKNTO&
And then write.
&W_BALANCE&
But I am not getting the value w_balance as the above statement in bold is not being executed by the system.
Any ideas how we can achieve the same?
Thanks!!!
Hello.
Use perform statement and create a report to make the change like this:
/: PERFORM f_difference IN PROGRAM zprogram
/: USING &BSID-DMBTR&
/: USING &BSID-SKNTO&
/: CHANGING &W_BALANCE&
/: ENDPERFORM
Check link about perform in script:
http://help.sap.com/saphelp_nw70/helpdata/EN/d1/80318f454211d189710000e8322d00/frameset.htm
Regards.
Valter Oliveira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Arthematic operations are not possible inside form, you have to do the calculation explicitly and call it inside the form.
Go through this example
Ex. In FORM
/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &<field name>&
/:CHANGING &<field name1&
/:ENDPERFORM
Program:::
Then create subroutine pool program and you have to write the code.
FORM ><subroutine name> tables int_cond structure itcsy
outt_cond structure itcsy.
data : value(20), value1(20). "do your own declarations
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
Just rough idea given above.
Close the thread once your question is answered.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In Scripts you cannot do Arithmatic Calculations so in order to do so use
/:PERFORM
/:ENDPERFORM
In this Command we pass two values
1 USING
2 CHANGING
In Using pass the &BSID-DMBTR&
and &BSID-SKNTO&
In changing pass &W_BALANCE&
You also need to have a ZPROGRAM of Include or Executable type in which you'll have to write the logic.
Please Close the task if your issue is Solved.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.