cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform line item -group total

Former Member
0 Kudos

Hai All,

I need logic for the following requirement in smartform,

  • I should print the subtotal of each group of line items that i have calculated in my report.\

for example Group-A has 1,2,3 line items.now i should print t total at the end of this particular group item in SMF.

similarly Group-B has 1,2,3,4 line items.now i should print t total at the end of this particular group item in SMF .

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check the below link.

[http://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALINSAP+SMARTFORMS]

Jshree

Former Member
0 Kudos

Hi Raghav,

I guess you need to use Events option of table .

You could use 'Event on Sort End' followed by Command Node and 'Go to New Page' option of command node to print your data at group levels in different pages.

Regards,

Dep

koolspy_ultimate
Active Contributor
0 Kudos

hi ,

in your code , just use at end of <field name>


loop at itab."your loop.
"your write stmts
at end of <fieldname>."mention your group field name
sum.
write: wa_<yourfield>."which is used to pass into your form.
endat.
"your write stmts.
endloop.

hope this solves your problem.

regards,

kool.

Former Member
0 Kudos

Hi,

If you have the Driver program, then do the logic in your driver program and finally print those details in the smartform.

sort itab by group.

Loop at itab assigning <fs_tab>.

v_total = v_total + <fs_tab>-field.

at end of Group.

<fs_tab>-newfield = v_total.

clear v_total.

endat.

endloop.

Now use this new field in your smartform to print the totals.

Regards,

Venkatesh

Former Member
0 Kudos

dear friend,i have calculated the subtotal,but my question is how am i going to display this value in SMF?after each group

koolspy_ultimate
Active Contributor
0 Kudos

just pass the value into the smartform using your internal table and display it using condition in sf.

Former Member
0 Kudos

Hi,

If you can look into my previous post,

at end,

you are setting the total values.

You just need to find whether the value is there in the field or not

( you can do this by using the conditions in the smartform )

and then finally print the value.

Regards,

Venkatesh