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: 

ALV Sub total------urgent

Former Member
0 Kudos
104

Hello All ,

I have a litle bit problem. I have created one ALV which is showing all the fields including two Quantity Fld. There is one Fld posting Key haveing value 20 21 22 23.

I have taken the sum and make a subtotatal on fld Posting Key.

it is showing to sum of qty for 20 21 22 23.

My problem is My user want to display the subtotal of Only 21. not for all fld value in sub total also and in gross total also. and data will be display for 20 21 22 23.

ALV Subtotal option Give the Sub total of all Value of posting key like 20 21 22 23 , I want the sum of only 21

posting key qty

20 10

20 10

21 10

21 10

22 10

23 10

out put want

p k qty

20 10

20 10

21 10

21 10

#21 20 Sub total

22 10

23 10

    1. 20 Gross Total

Can some one tell me how can be match such requirement.

Regards

Swati...

Edited by: Swati Namdev on Feb 13, 2008 11:22 AM

Edited by: Swati Namdev on Feb 13, 2008 11:29 AM

Edited by: Swati Namdev on Feb 13, 2008 11:31 AM

5 REPLIES 5

Former Member
0 Kudos
81

use DO_SUM option

0 Kudos
81

Hello Guys ,

Can some one Please Suggest the correct Answer.

Regard

Swati..

Former Member
0 Kudos
81

Use this code

FCAT-col_pos = 5.

FCAT-fieldname = 'WRBTR'.

FCAT-tabname = 'I_BSIK'.

FCAT-ref_fieldname = 'WRBTR'.

FCAT-DO_SUM = 'X'.

FCAT-SELTEXT_S = 'NET'.

FCAT-SELTEXT_M = 'NET_P'.

FCAT-SELTEXT_L = 'NET AMOUNT'(010).

FCAT-ref_tabname = 'BSIK'.

APPEND FCAT TO X_FCAT.

Rewards point if useful

Former Member
0 Kudos
81

HI.

Check the datatype of field 'TPRC'. It should be either 'QUANT' or 'CURR'. Then only u will get the TOTALS in ALV output.

You have add another statemet as datatype:

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'TPRC'.

fieldcat-seltext_l = 'Total Price'.

fieldcat-do_sum = 'X'.

fieldcat_datatype = 'CURR'

fieldcat-col_pos = 7.

append fieldcat to t_fieldcat.

Reward all helpfull answers.

Jay

Former Member
0 Kudos
81

This is not possible for sub total you can take some specific value only.

Regards

Swati