2005 Aug 11 3:07 AM
Hi guys. I was just wondering if there is a way for me to segregate records in ALV using an underline.
For instance, if I have 3 records
LIFNR MATNR
C1000 12345
C1000 12345
C1000 12222
C1000 12222
C1001 12222
Its should display in alv like:
C1000 12345
C1000 12345
-
<--- underline since new matnr
C1000 12222
C1000 12222
-
<--- underline since new vendor
C1001 12222
please help. Thanks.
2005 Aug 11 7:09 AM
Hi, Ferdinand,
Fill the ALV sort internal table with this attribute LS_SORT-group = 'UL' and pass it to ALV List function module.
Here is some sample code
data : gt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv.
ls_sort-fieldname = 'LIFNR'.
ls_sort-spos = 1.
ls_sort-group = 'UL'.
ls_sort-tabname = 'GT_OUTTAB'.
ls_sort-up = 'X'.
APPEND ls_sort TO gt_sort.
ls_sort-fieldname = 'MATNR'.
ls_sort-spos = 2.
ls_sort-group = 'UL'.
ls_sort-tabname = 'GT_OUTTAB'.
ls_sort-up = 'X'.
APPEND ls_sort TO gt_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = gt_fieldcat
it_sort = gt_sort
TABLES
t_outtab = gt_outtab
Let me know if u have any issues. Reward me with points if it is helpful.
Best Regards,
Vijay
2005 Aug 11 7:09 AM
Hi, Ferdinand,
Fill the ALV sort internal table with this attribute LS_SORT-group = 'UL' and pass it to ALV List function module.
Here is some sample code
data : gt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv.
ls_sort-fieldname = 'LIFNR'.
ls_sort-spos = 1.
ls_sort-group = 'UL'.
ls_sort-tabname = 'GT_OUTTAB'.
ls_sort-up = 'X'.
APPEND ls_sort TO gt_sort.
ls_sort-fieldname = 'MATNR'.
ls_sort-spos = 2.
ls_sort-group = 'UL'.
ls_sort-tabname = 'GT_OUTTAB'.
ls_sort-up = 'X'.
APPEND ls_sort TO gt_sort.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = gt_fieldcat
it_sort = gt_sort
TABLES
t_outtab = gt_outtab
Let me know if u have any issues. Reward me with points if it is helpful.
Best Regards,
Vijay
2005 Aug 11 11:15 AM