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: 

Not getting tha sum of columns of currency fields in output

Former Member
0 Kudos

Hi experts,

When I am running my program, for some columns like quantity i am getting the sum of that column when i choose the column and choose the sum button.

But when I am choosing any column like currency,and then choosing the sum button,It is not giving me the sum of the values.

It is giving an error .i.e. "DESIRED OPERATIONCANNOT BE PERFORMEDFOR COLUMN 'UNIT VOLUME IN GBP' "

UNIT VOLUME IN GBP is the column name.

Can u please suggest me what to do

Thanks

13 REPLIES 13

Former Member
0 Kudos

HI,

Total sum will be done on Totalizable fields.

Sub total will be done on Non-Totalizable fields in ALV Report.

If u choose Currency then u have to do sub-total then u'll get sub total for all currency types.

We have two std buttons on ALV report Total Sum and sub-total.

Edited by: Selva M on Aug 25, 2009 1:59 PM

Edited by: Selva M on Aug 25, 2009 2:00 PM

0 Kudos

ya thanks for the answer...it is subtotalling,But Currency can also be totalized....

In the standard program SD_SALES_ORDERS_VIEW net value is doing the totaling.

Can u sugest how is it done???

thanks

0 Kudos

Hi Smitha,

What is the data type that you have used for that particular field.. Data type in the final internal tabel that you are using for ALV display?

Regards

Ansari

0 Kudos

Hi,

How can u totalize the currency field

if currency field having the values INR, USD,EUR then how u can calculate the total.

or u r saying currency field is amount field.

U can do sum only on Totalizable fields

0 Kudos

lets say i have a fild as netpr whose data type in table vbap is curency,but in the final internal table i have defined as

"netpr TYPE netwr_ap".

So now if i want to add it ,its giving that error as i mentioned erlier

0 Kudos

Hi,

Then change the declaration part in the final internal Table.

Make it currency or quan fields then It'll work

0 Kudos

yes the values of the currency field has to be added.....The data type is currency in the corresponding tables.

0 Kudos

can you please tell us how you have defined the field and field catalog?

0 Kudos

SD_SALES_ORDERS_VIEW is the standard program.When i run it,and give some values from 6000 to 6600(doc no),

then when i choose the net value column and click on the sum button then,i get the output as

AUD 4,000.00

DKK 0.00

EUR 19,652.65

GBP 82,555,203.80

JPY 987,002,912

USD 18,895.00

For my program, this is not coming.

i n the final internal table the fields are defined as

netpr TYPE netwr_ap,

netpr_gbp TYPE netwr_a,

like this.So what to do now.Can u pls help

thnks

0 Kudos

Hi Smitha,

I wrote a sample code to test this..

I am able to total the amount fields. It has something to do with your data type..

Use for amount field data type NETPR

and for curency filed WAERK

below is the sample code i used.

REPORT YSDN_ALV.

DATA :oref TYPE REF TO cx_root,

text TYPE string.

DATA lr_table TYPE REF TO cl_salv_table.

DATA: lr_columns TYPE REF TO cl_salv_columns.

data gt_vbap type table of vbap.

data gs_functions type ref to cl_salv_functions.

select *

from vbap into table gt_vbap

UP TO 10 rows.

TRY.

cl_salv_table=>factory(

IMPORTING

r_salv_table = lr_table

CHANGING

t_table = gt_vbap ).

CATCH cx_salv_msg INTO oref. "#EC NO_HANDLER

text = oref->get_text( ).

CATCH cx_root INTO oref.

text = oref->get_text( ).

ENDTRY.

*Functions

gs_functions = lr_table->get_functions( ).

*activate ALV generic Functions

gs_functions->set_all( 'X' ).

lr_table->display( ).

It is working fine.

Former Member
0 Kudos

Please check the data type of your field. Check whether it is not numc or char .

0 Kudos

the data type in the table is currency

Former Member
0 Kudos

Hi Smita,

In the output only those fields will have total option which has numeric data type.

So for your final internal table of that field, it has to be a numeric field. check the declaration.