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

Subtotal Currency

Former Member
0 Likes
2,462

Hi All,

how to subtotal currency wise.

ex;

10 EURO

20 EURO

30 USD.

subtotal: 40 EURO

30 USD

HI,

I want subtotal in ALV.

13 REPLIES 13
Read only

bpawanchand
Active Contributor
0 Likes
1,941

Hi

FM

K_KKB_SUBTOTALS_CHECK

LVC_KKB_SUBTOTALS_CHECK

PRICAT_SUBTOTALS_READ

i hope they may use to get your sol

Regards

Pavan

Read only

0 Likes
1,941

HI,

I want subtotal in ALV.

Read only

Former Member
0 Likes
1,941

Hi,

check this link hope it will work...

Thanks,

Suman

Read only

Former Member
0 Likes
1,941

Hi gs_p,

Make use of control statements. first sort the internal table by currency field. while looping the table. Do as follows :

loop at itab,

   w_total  =  w_total + wa-price.

   at end of curr.

       write :/ w_total.

   endat.

endloop.

Regards,

Swapna.

Edited by: NagaSwapna Thota on Jul 8, 2008 7:45 AM

Read only

0 Likes
1,941

Hi,

if u want to subtotals in alv there is field in fieldcatlog

fieldcatlog-datatype = 'CURR'.

fieldcatlog-do_some = 'X'.

if you use these two fields to which field you want to subtotals.

you can get the sub totals.

Read only

Former Member
0 Likes
1,941

Hi ,

You can use sort table in ALV field catalog.Sort the table by

Currency and pass field curency to sort table

Read only

Former Member
0 Likes
1,941

Hi ,

If you use alv grid , subtotals will be given automatically.YOu can refer BCALV_GRID_02 .After excuting this you can click subtotal on currency field.You will get subtotal currency wise.

Reward points if help full

Read only

0 Likes
1,941

Hi but i want to display Currency text like 40 EURO or 20 USD in subtotal line.

Read only

0 Likes
1,941

Then you can check the Link in the Above post mentioned by Suman...

There you can give the subtotal text etc..

Read only

Former Member
0 Likes
1,941

pass the values to sort parameter of the alv display function module.

while filling the sort table pass the column name and pass value X to subtotal field.

here is the sample code

  • Sort table by two levels of hierarchy

REFRESH T_SORT.

PERFORM PREPARE_SORTTABLE CHANGING T_SORT.

CALL METHOD W_GRID

->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = FS_LAYOUT

CHANGING

IT_OUTTAB = T_FINAL[]

IT_FIELDCATALOG = T_FLDCAT[]

IT_SORT = T_SORT[]

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

OTHERS = 4.

  • Structure for sort table

DATA:

LFS_SORT TYPE LVC_S_SORT.

LFS_SORT-SPOS = '1'.

LFS_SORT-FIELDNAME = 'PRDHA1'.

LFS_SORT-UP = 'X'.

LFS_SORT-SUBTOT = 'X'.

APPEND LFS_SORT TO PV_T_SORT.

CLEAR LFS_SORT.

LFS_SORT-SPOS = '2'.

LFS_SORT-FIELDNAME = 'PRDHA2'.

LFS_SORT-UP = 'X'.

LFS_SORT-SUBTOT = 'X'.

APPEND LFS_SORT TO PV_T_SORT.

Read only

0 Likes
1,941

I want to display grid like BCALV_GRID_02 program when summation is clicked.

can any one please help me getting this

Read only

Former Member
0 Likes
1,941

Hi

Try using SORT on the currency field and pass the same to Function module

Regards

Shiva

Read only

Former Member
0 Likes
1,941

Thanks All