‎2006 Oct 09 12:54 PM
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.
‎2006 Oct 09 3:22 PM
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^
‎2006 Oct 09 3:22 PM
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^
‎2006 Oct 09 3:33 PM
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
‎2006 Oct 10 5:23 AM
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)