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: 

Adding new icon (buttons) on ALV

Former Member
0 Kudos

Hello friends

Can some one give me some hints on adding new icons on ALV report.

Any sample program will be greatly appreciated.

Thanks

Ram

4 REPLIES 4

Former Member
0 Kudos

Hi,

You can achieve this by adding the Include ICON in your program and in the final internal table which you display as grid create a character field of length 4 and move the icon value to this field.

Include  .
* pass  the icon name to the final int.table field
it_final-char4 = icon_column_right .

* display the grid  by calling the FM / Method 
  CALL METHOD go_alvdata_ingst->set_table_for_first_display
      EXPORTING
        i_structure_name     = '/CD487/S_INGR_STMT'
        io_alvdata           = go_lcl_alv
      CHANGING
        ct_outtab            = it_final 
        ct_fieldcatalog     = gt_fcat
      EXCEPTIONS
        exc_failure          = 1
        OTHERS               = 2 .

and also you can see the below code for this one

CONSTANTS:
     icon_id_failure            LIKE icon-id   VALUE ' ((Content component not found.)) @',
     icon_id_okay              LIKE icon-id   VALUE ' ((Content component not found.)) @'.


TYPES: BEGIN OF ls_tab,
       matnr LIKE equi-matnr,
       maktx LIKE makt-maktx,
       b_werk  LIKE equi-werk,
       b_lager LIKE equi-lager,
       lgobe LIKE t001l-lgobe,
       sernr LIKE equi-sernr,
       icon LIKE icon-id,
       objnr LIKE equi-objnr,
      END OF   ls_tab.
 
*Table that display the data for the ALV.
DATA: itab  TYPE ls_tab OCCURS 0 WITH HEADER LINE. 

    PERFORM get_h_date .

    IF h_date => sy-datum .
      itab-icon = icon_id_okay.
    ELSE .
      itab-icon = icon_id_failure.
     ENDIF.

Regards

Sudheer

raymond_giuseppi
Active Contributor
0 Kudos

There is a blog on this subject, look a t http://weblogs.sdn.sap.com/pub/wlg/6058?page=last&x-maxdepth=0"; [original link is broken] [original link is broken] [original link is broken]>Using [original link is broken] [original link is broken]

Regards

Former Member
0 Kudos

Hi Ram, there is one standard program that shows you how to do this.

The program is:

BCALV_GRID_05

The only thing is that it uses the Object Oriented paradigm to build the ALV.

Hope it helps.

Regards,

Gilberto Li

Former Member
0 Kudos

Thanks a lot..IT helped a lot