cancel
Showing results for 
Search instead for 
Did you mean: 

how to calculate total for field for particular day. in smart forms

Former Member
0 Kudos

hi,

pls help in this problem,

how to calculate cumulative totals for the particular field in samrtforms

Accepted Solutions (1)

Accepted Solutions (1)

former_member196280
Active Contributor
0 Kudos

many way to do this, easiest way is to create program lines and loop your table.

Ex,

LOOP AT itab.

AT LAST.

SUM.

WRITE SUM TO <VARIABLE>

ENDAT.

ENDLOOP.

You can store the sum inside a variable and display the variable.

Regards,

SaiRam

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

Either you can calculate the sum in driver program with

Loop at where Condition .

Sum the required field .

endloop .

Then pass it to smartforms

Or

Double Click on table node .

In the conditions tab give the required condition .

select calculation tab.

In operation select Total , in field name give the name of the field you want to sum

and in targer field name specify the name of the field that should contain the result .

To convert the total in to words use the function module in program lines

CALL FUNCTION 'HR_IN_CHG_INR_WRDS'

EXPORTING

amt_in_num = w_total

IMPORTING

AMT_IN_WORDS = w_total_words

  • EXCEPTIONS

  • DATA_TYPE_MISMATCH = 1

  • OTHERS = 2

Regards

.

Former Member
0 Kudos

hi,

thank u , to pass that sum value from driver to smartform. pls explain in detail.

regards

sai.

SuhaSaha
Advisor
Advisor
0 Kudos

Hi Sai,

If you must be using a TABLE to display the data in the smarform.

In the table definition you have <b>CALCULATION</b> tab. In that you have the <b>Operations</b> column where there is <b>TOTAL</b> operation.

In the Field Value column you give <i><WA_OUTPUT-FIELDNAME></i> & in the target field you give the variable <i><V_TOTAL></i>. Then in the footer of your table you display this variable.

Hope u find this helpful. Do reward some points.

Regards,

Suhas