03-14-2007 7:32 PM
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
03-14-2007 7:38 PM
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
03-14-2007 7:42 PM
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
03-14-2007 8:10 PM
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
03-14-2007 9:24 PM