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: 

Regarding ALV list display

Former Member
0 Kudos

hi,

i have an ALV list display.

At line selection (single mouse click on line), i want the line color to be intensified.

3 REPLIES 3

former_member628175
Active Participant
0 Kudos

Hi ,

refer this <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/5e/ebeb40c4f8712ae10000000a155106/frameset.htm">link</a>

Hope this helps .

Regards ,

Shounak M.

Former Member
0 Kudos

hi,

may be u will use fieldcatalog fields

fieldcatalog-emphasize some thing is there plz check it

former_member188685
Active Contributor
0 Kudos

Hi,

yes it is possible, check this sample code.

REPORT  ztest.

TYPE-POOLS:slis.
DATA: BEGIN OF itab OCCURS 0,
      vbeln LIKE vbak-vbeln,
      posnr LIKE vbap-posnr,
      color(4),
      END OF itab.


SELECT vbeln
 posnr
 INTO CORRESPONDING FIELDS OF TABLE itab
 FROM vbap
 UP TO 20 ROWS.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
      x_fieldcat TYPE slis_fieldcat_alv.
DATA: x_layout TYPE slis_layout_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    i_program_name         = sy-repid
    i_internal_tabname     = 'ITAB'
    i_inclname             = sy-repid
  CHANGING
    ct_fieldcat            = it_fieldcat
  EXCEPTIONS
    inconsistent_interface = 1
    program_error          = 2
    OTHERS                 = 3.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

loop at it_fieldcat into x_fieldcat.
if x_fieldcat-fieldname = 'COLOR'.
x_fieldcat-no_out = 'X'.
modify it_fieldcat from x_fieldcat index sy-tabix.
endif.
if x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-HOTSPOT = 'X'.
x_fieldcat-key = ''.
modify it_fieldcat from x_fieldcat index sy-tabix.
endif.
if x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-HOTSPOT = 'X'.
x_fieldcat-key = ''.
modify it_fieldcat from x_fieldcat index sy-tabix.
endif.
endloop.
x_layout-info_fieldname = 'COLOR'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    i_callback_program      = sy-repid
    is_layout               = x_layout
    it_fieldcat             = it_fieldcat
    i_callback_user_command = 'USER_COMMAND'
  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.


*&---------------------------------------------------------------------*
*&      Form  user_command
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->R_UCOMM    text
*      -->R_SELFIELD text
*----------------------------------------------------------------------*
FORM user_command USING r_ucomm TYPE sy-ucomm
                        r_selfield TYPE slis_selfield.
  READ TABLE itab INDEX r_selfield-tabindex.
  IF sy-subrc = 0.
    itab-color = 'C600'.
    MODIFY itab INDEX r_selfield-tabindex.
  ENDIF.
  r_selfield-row_stable = 'X'.
  r_selfield-refresh = 'X'.
ENDFORM.                    "user_command

Regards

vijay