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: 

Tree Structure and triffic lights

Former Member
0 Kudos

Hi,

I wanted to create tree structure in ALV and put some lights ( Exceptions ) in different colors when user browse the tree . How to develop this ALV using oops.

Regards,

Prasad

1 ACCEPTED SOLUTION

Former Member
0 Kudos

check this link

http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm

check transaction DWDM for some examples...

5 REPLIES 5

Former Member
0 Kudos

hi Satya,

Check these threads out

Regards,

santosh

Former Member
0 Kudos

check this link

http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm

check transaction DWDM for some examples...

Former Member
0 Kudos

Check this code it may help u.

TYPE-POOLS: slis,icon.

DATA: x_fieldcat TYPE slis_fieldcat_alv,

it_fieldcat TYPE slis_t_fieldcat_alv,

l_layout TYPE slis_layout_alv.

DATA: BEGIN OF itab OCCURS 0,

vbeln LIKE vbak-vbeln,

posnr LIKE vbap-posnr,

icon(1),

END OF itab.

data:program type sy-repid.

SELECT vbeln

posnr

FROM vbap

UP TO 20 ROWS

INTO TABLE itab.

LOOP AT itab.

IF sy-tabix = 1 OR sy-tabix = 2.

itab-icon = '1'.

ELSEIF sy-tabix = 10 OR sy-tabix = 20.

itab-icon = '2'.

ELSE.

itab-icon = '3'.

ENDIF.

MODIFY itab INDEX sy-tabix.

ENDLOOP.

program = sy-repid.

x_fieldcat-fieldname = 'VBELN'.

x_fieldcat-seltext_l = 'VBELN'.

x_fieldcat-hotspot = 'X'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 1.

APPEND x_fieldcat TO it_fieldcat.

CLEAR x_fieldcat.

x_fieldcat-fieldname = 'POSNR'.

x_fieldcat-seltext_l = 'POSNR'.

x_fieldcat-tabname = 'ITAB'.

x_fieldcat-col_pos = 2.

APPEND x_fieldcat TO it_fieldcat.

CLEAR x_fieldcat.

l_layout-lights_fieldname = 'ICON'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = program

is_layout = l_layout

it_fieldcat = it_fieldcat

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,