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: 

regarding subtotals in alv

Former Member
0 Kudos

hi gurus,

i have a small problem i am developing a alv report and i need subtotla of the field fkimg so i wrote the following code

PERFORM CREATE_FIELDCAT USING: '1' 'KUNRG' 'BILL TO PARTY' ' ',

'2' 'VBELN' 'BILL NO' ' ',

'3' 'FKDAT' 'BILL DATE' ' ',

'4' 'XBLNR' 'YOUR ORDER' ' ',

'5' '' '' ' ',

'6' 'VBELV' 'ORD REF NO' ' ',

'7' 'POSNV' 'ITEM NO' ' ',

'8' 'ARKTX' 'ITEM DESC' ' ',

'9' 'MATNR' 'ITEM CODE' ' ',

'10' '' '' ' ',

'11' 'VRKME' 'UNIT' ' ',

'12' 'FKIMG' 'QUANTITY' 'X',

'13' '' '' ' ',

'14' '' '' ' ',

'15' '' '' ' ',

'16' 'NETWR ' 'AMOUNT' '',

'17' 'WERKS ' 'PLANT' ' ',

'18' 'NAME1 ' 'PLANT NAME' ' '.

W_SORTINFO-FIELDNAME = 'VBELN'.

W_SORTINFO-SUBTOT = 'X'.

APPEND W_SORTINFO TO T_SORTINFO.

CLEAR W_SORTINFO.

but i am not getting the output it is going to short dump directly. itried it with out the sub total then the output is coming so please help me with the problem

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
PERFORM CREATE_FIELDCAT USING: '1' 'KUNRG' 'BILL TO PARTY' ' ',
'2' 'VBELN' 'BILL NO' ' ',
'3' 'FKDAT' 'BILL DATE' ' ',
'4' 'XBLNR' 'YOUR ORDER' ' ',
'5' '' '' ' ',          "<----What happened to the fieldname 
'6' 'VBELV' 'ORD REF NO' ' ',
'7' 'POSNV' 'ITEM NO' ' ',
'8' 'ARKTX' 'ITEM DESC' ' ',
'9' 'MATNR' 'ITEM CODE' ' ',
'10' '' '' ' ',  "<----What happened to the fieldname 
'11' 'VRKME' 'UNIT' ' ',
'12' 'FKIMG' 'QUANTITY' 'X',
'13' '' '' ' ',  "<----What happened to the fieldname 
'14' '' '' ' ',  "<----What happened to the fieldname 
'15' '' '' ' ',  "<----What happened to the fieldname 
'16' 'NETWR ' 'AMOUNT' '',
'17' 'WERKS ' 'PLANT' ' ',
'18' 'NAME1 ' 'PLANT NAME' ' '.

if you give like that it will give Dumps. Mention some fieldname.

9 REPLIES 9

Former Member
0 Kudos

Hi Abhinay,

Give the Sorting order in the fieldcatalog

Cheers,

Kothand

0 Kudos

i have done that even though the output is not coming any other suggestion

0 Kudos

i am not able to understand what u r saying

0 Kudos

Hi,

Try this way

W_SORTINFO-FIELDNAME = 'VBELN'.

W_SORTINFO-SUBTOT = 'X'.

W_SORTINFO-SPOS = '1'.

APPEND W_SORTINFO TO T_SORTINFO.

CLEAR W_SORTINFO.

Cheers,

Kothand

Former Member
0 Kudos

Hi

Adding subtot information in field catalog for FKIMG is fine.

You don't need to add subtot information in sorting table. just add VBELN insert table and subtotal for FKIMG will appear on ALV.

If this does not solve your problem. Please pase the full code.

Regards

Vijai

0 Kudos

Mr.vijay thanks for the help but could you please elaborate a little bit what u have said

former_member188685
Active Contributor
0 Kudos
PERFORM CREATE_FIELDCAT USING: '1' 'KUNRG' 'BILL TO PARTY' ' ',
'2' 'VBELN' 'BILL NO' ' ',
'3' 'FKDAT' 'BILL DATE' ' ',
'4' 'XBLNR' 'YOUR ORDER' ' ',
'5' '' '' ' ',          "<----What happened to the fieldname 
'6' 'VBELV' 'ORD REF NO' ' ',
'7' 'POSNV' 'ITEM NO' ' ',
'8' 'ARKTX' 'ITEM DESC' ' ',
'9' 'MATNR' 'ITEM CODE' ' ',
'10' '' '' ' ',  "<----What happened to the fieldname 
'11' 'VRKME' 'UNIT' ' ',
'12' 'FKIMG' 'QUANTITY' 'X',
'13' '' '' ' ',  "<----What happened to the fieldname 
'14' '' '' ' ',  "<----What happened to the fieldname 
'15' '' '' ' ',  "<----What happened to the fieldname 
'16' 'NETWR ' 'AMOUNT' '',
'17' 'WERKS ' 'PLANT' ' ',
'18' 'NAME1 ' 'PLANT NAME' ' '.

if you give like that it will give Dumps. Mention some fieldname.

0 Kudos

thanks Mr.vijay you just solved my problem thanku

Former Member
0 Kudos

Hi,

here i am sending some code. u can impliment as per your declaration.

wa_layout-zebra = 'X'.

wa_layout-totals_text = 'TOTAL:'.

wa_layout-subtotals_text = 'SUBTOTALS:'.

wa_sort-fieldname = 'VBELN'.

wa_sort-up = 'X'.

wa_sort-subtot = 'X'.

wa_sort-expa = 'X'.

append wa_sort to it_sort.

thank you.

Ravi