2008 Apr 08 11:04 AM
Hello ,
I have a internal table with data to be displayed on the screen .Simple list just to check data , There are lot of rows
with same value in the first colon. I want group them by that colon to have more visibility on the screen.
What I am doing now is loop in the internal table and simply write on the screen , I can find any addition on WRITE statement or
any other way to do grouping.
Please advice .
Krsto
2008 Apr 08 11:10 AM
hi there,,,,,
This is sample code u may get solution modifying this
CLEAR LS_SORT.
LS_SORT-SPOS = 1.
LS_SORT-FIELDNAME = 'DISPO'.
LS_SORT-UP = 'X'.
LS_SORT-SUBTOT = 'X'.
LS_SORT-GROUP = '*'.
LS_SORT-TABNAME = 'INT_GETDATA'.
APPEND LS_SORT TO G_SORT.
CLEAR LS_SP_GROUP.
LS_SP_GROUP-SP_GROUP = 'A'.
APPEND LS_SP_GROUP TO GT_SP_GROUP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_USER_COMMAND = 'SUB_USER_COMMAND'
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = GT1_FIELDCAT[]
IT_EVENTS = GT_EVENTS[]
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT = G_SORT[]
IS_PRINT = GS_PRINT
TABLES
T_OUTTAB = INT_GETDATA[].
reward if useful,
cheers,
rekha
Hello ,
I have a internal table with data to be displayed on the screen .Simple list just to check data , There are lot of rows
with same value in the first colon. I want group them by that colon to have more visibility on the screen.
What I am doing now is loop in the internal table and simply write on the screen , I can find any addition on WRITE statement or
any other way to do grouping.
Please advice .
Krsto
2008 Apr 08 11:10 AM
hi there,,,,,
This is sample code u may get solution modifying this
CLEAR LS_SORT.
LS_SORT-SPOS = 1.
LS_SORT-FIELDNAME = 'DISPO'.
LS_SORT-UP = 'X'.
LS_SORT-SUBTOT = 'X'.
LS_SORT-GROUP = '*'.
LS_SORT-TABNAME = 'INT_GETDATA'.
APPEND LS_SORT TO G_SORT.
CLEAR LS_SP_GROUP.
LS_SP_GROUP-SP_GROUP = 'A'.
APPEND LS_SP_GROUP TO GT_SP_GROUP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_USER_COMMAND = 'SUB_USER_COMMAND'
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = GT1_FIELDCAT[]
IT_EVENTS = GT_EVENTS[]
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT = G_SORT[]
IS_PRINT = GS_PRINT
TABLES
T_OUTTAB = INT_GETDATA[].
reward if useful,
cheers,
rekha
2008 Apr 09 11:14 AM
2008 Apr 08 11:13 AM
Hi,
What ever u are doing to show the list is correct way of doing. I have solve a similar kind of issue by following the same procedure.
Regards,
Pratyush.
2008 Apr 08 11:15 AM
write like below
sort internal table by keyfield.
at new keyfield
write keyfield..
endat.
here keyfield is the field you want to group by
do reward if helpful