‎2007 Jun 12 1:27 PM
Hi all,
I have to add 3 program symbols to display total. can any bosy please say me how to add fields
example
, Excise Duty @ 16% ,,,,,,,,&J_1IEXCHDR-EXBED(16.2R)&
,, Education Cess @ 2% ,,,,,,,,&J_1IEXCHDR-ECS(16.2R)&
,, S & H Edu Cess @ 1% ,,,,,,,,&J_1IEXCHDR-EXADDTAX1(16.2R)&
want to display totla of all this
can anybody say how it can be done
Thanks in Advance
‎2007 Jun 12 1:31 PM
Chk the following link.It might solve your problem.
http://www.sap-img.com/sapscripts/sapscript-how-to-calculate-totals-and-subtotals.htm
REgards,
Vasanth
‎2007 Jun 12 1:31 PM
Hi,
To calculate totals and sub totals in sap scripts you have to use subroutines.
Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine
/: DEFINE &TOT_PRICE&
/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM
Then write the variable where ever you want it to be printed (mostly it will be in footer window)
Then create subroutine pool program and you have to write the code.
FORM F_GET_PRICE tables int_cond structure itcsy
outt_cond structure itcsy. data : value type kbert.
statics value1 type kbert.
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.
I have given a rough outline, please be aware of the variable conversions as Int_cond-value and outt_cond-value are characters.
Regards,
Bhaskar
‎2007 Jun 12 1:33 PM
Hi
Define a Variable called Total like
/: DEFINE &TOTAL&
/ TOTAL = &J_1IEXCHDR-EXBED(16.2R)& + &J_1IEXCHDR-ECS(16.2R)& +
&J_1IEXCHDR-EXADDTAX1(16.2R)&
to display sum of them
/ &TOTAL(16.2R)&
Reward points for useful Answers
Regards
Anji
‎2007 Jun 12 1:36 PM
hi,
for adding program symbol, we can work with sap script control command
<b>/: summing <program-symbol> into <total symbol></b>
the command should be specified just once then each time the specified symbol is formated and its current value is add to the total symbol.
sap script can not create the field for total dynamically, for that one tou explicitly define in script.
regards,
Ashokreddy.
Message was edited by:
Ashok Reddy
‎2007 Jun 21 12:45 PM
‎2025 Jul 24 8:28 AM