‎2007 Aug 31 5:39 AM
hi experts,
i m using calculation tab in the smartforms for calculating total quantity for each material individually,means for first mat. it will calculate likewise for second third etc....
i m giving like this::
operand - total,
field name -wa_itab_final_sfm-labst_tm
target field name - v_labst1
time - after sorting
for field name - MATNR
reset - for sort criteria
for field name - MATNR
but it is not working it is giving total at the end of all material,what sud i add explicitly to achieve the above scenario....
‎2007 Aug 31 5:53 AM
Hi. Ravi..
In the TABLE node before the CALCULATIONS TAB you Have DATA tab.
Set the Following in that tab. under SORT Criteria...
SORT FIELD : MATNR
FLAG THE CHECKBOX: EVENT ON SORT END.
then It will work...
<b>Reward if Helpful</b>
‎2007 Aug 31 6:00 AM
HI narayan,
i have already done what u told now still it is not giving proper output.
‎2007 Aug 31 5:57 AM
instead of giving calculation to all .....keep a programline before u r code .....write control break statement like 'at new matnr' .....and at end.....write sum ...pick this sum in variable....................................
i hpe this would be helpful....
reward points if helpful...
‎2007 Aug 31 6:08 AM
hi raam ,
see i clicked 'event on sort end' in this i m using text , here i will add the program lines said by you or somewhere else...
‎2007 Aug 31 6:34 AM
after u data retrival logic u need to use this programline.....i mean before u r final internal table [ final internal table node].....
reward points helpful....
‎2007 Aug 31 6:52 AM
hi raam,
whenever i use at new matnr it is giving error,at new is possible only under loop endloop....
‎2007 Aug 31 7:04 AM
iam sorry ravi in u r loop ......i.e in u r data retyrival logic itself u need to use u r control break statement..............................do this it will definetly work...
i came across this scenario......i triggered sum for every kunnr .
reward points if helpful.....
‎2007 Aug 31 8:55 AM
Have you tried changing the Time column to 'After loop' instead of 'after sorting'?
Regards,
Nick
<i>Don't forget points for those that help you</i>
‎2007 Aug 31 9:49 AM
ya nick i also tried this but i didnt get rt result,now i m very much fedup using this so i added program lines now it is working.........
this is the solution:
program lines in the main area :
V_LABST1 = WA_ITAB_FINAL_SFM-labst_tm + V_LABST1.
program lines in the event.
clear v_labst1.