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: 

ALV underline

Former Member
0 Kudos
135

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
64

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

2 REPLIES 2

Former Member
0 Kudos
65

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

0 Kudos
64

Hi Vijaya,

Thank you so much. That solved the problem. thanks.