Application Development 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: 

sum of lines

Former Member
0 Kudos

i have itab and i want the sum of 1 field.

how?

2. i can do it by adding 1 cell only and not hole line in the alv report

11 REPLIES 11

former_member181962
Active Contributor
0 Kudos

<deleted>

former_member181962
Active Contributor
0 Kudos

For that partcicular column(field) put do_Sum = 'X' in the field catalogue.

0 Kudos

which line in the func is, can you show me example

0 Kudos

For the fields that needs to be totaled give DO_SUM = ‘X’ in the fieldcatalog FM.

Regards,

Saji.

0 Kudos

i made it

FORM aufbauen_fieldcat USING p_fieldname

p_ref_tabname

p_name

p_sum

p_emp.

i_fieldcat-fieldname = p_fieldname .

i_fieldcat-ref_tabname = p_ref_tabname .

i_fieldcat-reptext_ddic = p_name .

i_fieldcat-seltext_l = p_name .

i_fieldcat-seltext_m = p_name .

i_fieldcat-seltext_s = p_name .

i_fieldcat-do_sum = p_sum .-- i put X

i_fieldcat-emphasize = p_emp .

APPEND i_fieldcat .

ENDFORM. " AUFBAUEN_FIELDCAT

and it's not working

0 Kudos

Hi Liat,

how are calling the perform.

<b>

i_fieldcat-do_sum = 'X' .-- i put X</b> "give this

and try ,

regards

vijay

0 Kudos

i tried it and it's not working

it dosnt matter because i'm calling the form

PERFORM aufbauen_fieldcat USING 'CALC' 'ITAB' ' '(006)

'X' ''.

0 Kudos

Hi liat,

you can sum only non char fields. what is the type of field is that.

regards

vijay

0 Kudos

VBAP-KWMENG

maybe because i'm making coloring on it?

0 Kudos

not because of color, you just have tp select the column, and click on sum button. it will show the sum .

regards

vijay

former_member188685
Active Contributor
0 Kudos

hi,

use do_sum = 'X'.

populate the fieldcat for the column,

with do_sum = 'X' option.

regards

vijay