08-23-2008 6:12 PM
hi all
can any body tell me how can i display teh subtotals in smartform, please tell me the steps how to do that and aslo is there any special events in smartforms that are helpfull in getting and displaying the subtotals in smartforms
thanks in advance
08-23-2008 6:37 PM
08-24-2008 6:27 AM
Hi,
For doing subtotal calculation in SMARTFORMS, do like this.
Create one "Program Lines" to your main window table row.
Already you are maintaing "Internal table" for you table in main window.
Before that, sort the particular internal table with key fields through which you want to find out the sub total, now within the program lines code, first identify how many quantity and currency fields are there.
Declare respective temporary variables for each and every quantity and currency field.
then write logic like this.
at new matnr.
v_menge = wa_out-menge + v_menge.
v_netwr = wa_out-netwr + v_netwr
end at.
Also dont forget to declare character variables for quantity and currency fields. We cannot directly display them in smartforms. we need to pass them to the respective quantity and currency fields.
After end at statement write like this,
write: / v_menge decimals 2 to v_mengetext,
v_netwr decimals 2 to v_netwrtext.
after this dont forget to clear,
clear: v_menge, v_netwr.
no populate v_mengetext and v_netwrtext in your text elements.
Regards,
Santosh Kumar M.