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

ALV-SORT

Former Member
0 Likes
498

Hi

I have a requirement like this.

In my list i have a column which displays active(1) and inactive(0) employyes.

i want to add at the end.

i have 5 active employyes(1,1,1,1,1)..But at sub total it should be 5,but iam getting 1 and also in total its not displaying at all.

Please see my code..

READ TABLE I_FCAT INTO WA_FCAT WITH KEY FIELDNAME = 'PERSG'.

IF SY-SUBRC EQ 0.

WA_FCAT-REPTEXT_DDIC = 'X'.

WA_FCAT-SELTEXT_S = TEXT-041.

WA_FCAT-SELTEXT_M = TEXT-041.

WA_FCAT-SELTEXT_L = TEXT-041.

WA_FCAT-OUTPUTLEN = 12.

WA_FCAT-JUST = 'L'.

WA_FCAT-DO_SUM = 'X'.

MODIFY I_FCAT FROM WA_FCAT INDEX SY-TABIX.

CLEAR WA_FCAT.

ENDIF.

X_SORT-SPOS = 41.

X_SORT-FIELDNAME = 'PERSG'.

X_SORT-SUBTOT = 'X'.

APPEND X_SORT TO I_SORT.

Please help me its very urgent..

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
470

hi

good

go through this link, which ll give you complete idea about the ALV sort which you can use in your report.

http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/dual-alv-grid-in-same-screen-785923#

http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm

thanks

mrutyun^

3 REPLIES 3
Read only

Former Member
0 Likes
471

hi

good

go through this link, which ll give you complete idea about the ALV sort which you can use in your report.

http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/dual-alv-grid-in-same-screen-785923#

http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm

thanks

mrutyun^

Read only

Former Member
0 Likes
470

Hi,

PERSG is of type Char 1.

so it is not possible to Sum it up.

the below code will not work.

READ TABLE I_FCAT INTO WA_FCAT WITH KEY FIELDNAME = 'PERSG'.

IF SY-SUBRC EQ 0.

WA_FCAT-REPTEXT_DDIC = 'X'.

WA_FCAT-SELTEXT_S = TEXT-041.

WA_FCAT-SELTEXT_M = TEXT-041.

WA_FCAT-SELTEXT_L = TEXT-041.

WA_FCAT-OUTPUTLEN = 12.

WA_FCAT-JUST = 'L'.

WA_FCAT-DO_SUM = 'X'.

MODIFY I_FCAT FROM WA_FCAT INDEX SY-TABIX.

CLEAR WA_FCAT.

ENDIF.

the field should be of type Numeric.

Regards

Vijay

Read only

0 Likes
470

Hi Vijay

Thanks for that..its adding now..

but my requirement is like this..

i have 5 active employyes and at end i want subtotal as 5 and below total as 5..

now in subtotal place its taking 1 and in total place it showing 6(i mean 5 + subtotal also adding)