Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

regarding calculation tab in smartforms....

Former Member
0 Likes
2,089

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....

9 REPLIES 9
Read only

varma_narayana
Active Contributor
0 Likes
1,522

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>

Read only

0 Likes
1,522

HI narayan,

i have already done what u told now still it is not giving proper output.

Read only

Former Member
0 Likes
1,522

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...

Read only

0 Likes
1,522

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...

Read only

Former Member
0 Likes
1,522

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....

Read only

0 Likes
1,522

hi raam,

whenever i use at new matnr it is giving error,at new is possible only under loop endloop....

Read only

Former Member
0 Likes
1,522

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.....

Read only

0 Likes
1,522

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>

Read only

0 Likes
1,522

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.