Skip to Content
author's profile photo Former Member
Former Member

customized images in ALV

Dear ALL

i have developed one ALV Report ( Grid Layout ) .. In that ALV containg 5 fields.

Ex for - defect no containg some number - in that number contains customized images .

how to get customized images in ALV grid display..

thanks

sri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 06:04 AM

    Hi Sri,

    try this sample code

    *&---------------------------------------------------------------------* 
    TABLES : ekpo. 
    *&---------------------------------------------------------------------* 
    TYPE-POOLS : slis.
     *&---------------------------------------------------------------------*
     Type-pools: icon. TYPES : BEGIN OF t_ekpo, ebeln TYPE ekpo-ebeln, ebelp TYPE ekpo-ebelp, matnr TYPE ekpo-matnr, werks TYPE ekpo-werks, menge TYPE ekpo-menge, status(4) type c, END OF t_ekpo. *&---------------------------------------------------------------------* *VARIABLES DATA : check(1), rep_id TYPE sy-repid. *&---------------------------------------------------------------------* *INTERNAL TABLE TYPE OF ZEKPO DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo WITH HEADER LINE. *&---------------------------------------------------------------------* *FIELD CATALOG DATA : it_field TYPE slis_t_fieldcat_alv, wa_field TYPE slis_fieldcat_alv. *&---------------------------------------------------------------------* *SORTING DATA : it_sort TYPE slis_t_sortinfo_alv, wa_sort TYPE slis_sortinfo_alv. *&---------------------------------------------------------------------* INITIALIZATION. check = 'X'. rep_id = sy-repid. *&---------------------------------------------------------------------* START-OF-SELECTION. SELECT ebeln ebelp matnr werks menge FROM ekpo INTO CORRESPONDING FIELDS OF it_ekpo. Write icon_green_light as icon to it_ekpo-status. " Here is Solution APPEND it_ekpo to it_ekpo. ENDSELECT. *&---------------------------------------------------------------------* * FIELD CATALOG *&---------------------------------------------------------------------* wa_field-fieldname = 'EBELN'. wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 10. wa_field-seltext_l = 'PO #'. APPEND wa_field TO it_field. CLEAR wa_field. wa_field-fieldname = 'EBELP'. wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 10. wa_field-seltext_l = 'Line Item'. APPEND wa_field TO it_field. CLEAR wa_field. wa_field-fieldname = 'MATNR'. wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 15. wa_field-seltext_l = 'Material'. APPEND wa_field TO it_field. CLEAR wa_field. wa_field-fieldname = 'WERKS'. wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 6. wa_field-seltext_l = 'Plant'. APPEND wa_field TO it_field. CLEAR wa_field. wa_field-fieldname = 'MENGE'. wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 10. wa_field-seltext_l = 'Qty.'. * wa_field-outputlen = 17. * wa_field-edit = 'X'. wa_field-do_sum = check. APPEND wa_field TO it_field. CLEAR wa_field. wa_field-fieldname = 'STATUS'. " Here Appearing the Field wa_field-tabname = 'IT_TAB'. wa_field-outputlen = 15. wa_field-seltext_l = 'Qty.'. * wa_field-outputlen = 17. * wa_field-edit = 'X'. wa_field-do_sum = check. APPEND wa_field TO it_field. CLEAR wa_field. *&---------------------------------------------------------------------* * SORT W.R.T. PURCHASE ORDER NUMBER *&---------------------------------------------------------------------* wa_sort-spos = 1. wa_sort-fieldname = 'EBELN'. wa_sort-tabname = 'IT_EKPO'. wa_sort-up = check. wa_sort-subtot = check. APPEND wa_sort TO it_sort. CLEAR wa_sort. *&---------------------------------------------------------------------* * DISPLAY RECORDS IN ALV GRID *&---------------------------------------------------------------------* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = rep_id it_fieldcat = it_field it_sort = it_sort TABLES t_outtab = it_ekpo EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc = 0. ENDIF.

    Regards

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 17, 2009 at 06:17 AM

    Dear prakash

    i dont want put icon in that row

    I need to get the images on that row

    how to get the Images insteaded of icon.

    Thanks

    sri

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.