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

sum function

Former Member
0 Likes
483

Hi All Expert's.

i want to use SUM (Total Qty) for other calculation. i am do sum with foll code.

wa_fieldcat-row_pos = 1.
  wa_fieldcat-col_pos = 5.
  wa_fieldcat-tabname = 'ITAB'.
  wa_fieldcat-fieldname = 'ORDER_QTY'.
  wa_fieldcat-seltext_m = 'ORDER QTY'.
  wa_fieldcat-outputlen = '9'.
  wa_fieldcat-do_sum = 'X'.
  APPEND wa_fieldcat TO i_fieldcat.
  CLEAR wa_fieldcat.

(same Calculation for Delv qty, Order Qty, Total.)

Then i disp SUM when u run report. i wnt to use this total qty in other function like calculation of percentage.

My criiterica is.

TOTAL ORDER QTY / TOTAL Delivery qty * 100. ????

hw to put this code in ALV

Thanks

Bhavesh panchal

2 REPLIES 2
Read only

Former Member
0 Likes
428

Dear ,

Writing a code Fucntionality In ALV is not seems to be possible .

Use this formula at the Final loop there might be any loop existing in the system where u can apply your formula .

And add one field and dislpay .

Rgds aryan

Read only

Former Member
0 Likes
428

Hi,

Capturing the SUM field and using that in another calculation is not possible. Why dont you have another field with the name SUM. When you loop thru the internal table just keep on assing the values to the SUM field and later use this field for your calculation