cancel
Showing results for 
Search instead for 
Did you mean: 

attach legend ui element to alv table webdynpro abap

0 Kudos

Hi,

I am trying to insert a legend UI element into the webdynpro for colored cells in the ALV table. I know how to attach the legend to a normal table in the webdynpro(i just have to specify the legend ID in the table properties). But how do i attach the legend to the ALV table.

Thanks in advance,

Vijetha

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi ,

Here legend means is it an 'ICON ' you were referring about ?. Fine if it is the ICON which you were describing then fine . Here is the procedure to implement it in ALV.

There are two ways to embed the icons.

1. Either you want to use the standard SAP ICONS.

2. Either you want to upload the MIME objects into ALV. These two has different procedures to upload it.

Assume we have a node for displaying the ALV data. eg: 'Node_ALV' which has some 5 attributes below it.

1.Using standard icons.:

Initially create one more additional attribute with name ICON of type string. under the node "Node_Alv'".

then while passing the data into the internal table based on the conditions u pass the icon name.

for eg: data: lt_table type ........,

ls_table like line of lt_table.

ls_table-icon = 'ICON_OK"

ls_table-field1 = '''''''''''

ls_table-field2 = ''''''''''''''

-


-


append ls_table to lt_table.

lo_node->bind_table( lt_table ).

Instantiate the ALV component usage.

get_model of that ALV.

get the column reference and loop the columns. when ' '.

data: lr_image type ref to cl_salv_wd_uie_image.

create object lr_image.

loop at lt_columns into ls_columns.

lr_column = <ls_column>-r_column.

CASE lr_column->id.

when ' ". """"column name where u want the image or legend to be set

CREATE OBJECT lr_image.

lr_image->set_source(' ').

lr_column->set_cell_editor( lr_image ).

endcase.

2. If u want to upload the MIME object

follow same procedure but instead of giving the name as ls_table-icon = 'ICON_OK"

give the full path of the MIME object incluging taking care of the case sensitive .

'/SAP/BC/WebDynpro/WDC_component_name/icon_name.BMP'

Hope you understood the procedure.

Cheers,

Sana.

Former Member
0 Kudos

Hi ,

Here legend means is it an 'ICON ' you were referring about ?. Fine if it is the ICON which you were describing then fine . Here is the procedure to implement it in ALV.

There are two ways to embed the icons.

1. Either you want to use the standard SAP ICONS.

2. Either you want to upload the MIME objects into ALV. These two has different procedures to upload it.

Assume we have a node for displaying the ALV data. eg: 'Node_ALV' which has some 5 attributes below it.

1.Using standard icons.:

Initially create one more additional attribute with name ICON of type string. under the node "Node_Alv'".

then while passing the data into the internal table based on the conditions u pass the icon name.

for eg: data: lt_table type ........,

ls_table like line of lt_table.

ls_table-icon = 'ICON_OK"

ls_table-field1 = '''''''''''

ls_table-field2 = ''''''''''''''

-


-


append ls_table to lt_table.

lo_node->bind_table( lt_table ).

Instantiate the ALV component usage.

get_model of that ALV.

get the column reference and loop the columns. when ' '.

data: lr_image type ref to cl_salv_wd_uie_image.

create object lr_image.

loop at lt_columns into ls_columns.

lr_column = <ls_column>-r_column.

CASE lr_column->id.

when ' ". """"column name where u want the image or legend to be set

CREATE OBJECT lr_image.

lr_image->set_source(' ').

lr_column->set_cell_editor( lr_image ).

endcase.

2. If u want to upload the MIME object

follow same procedure but instead of giving the name as ls_table-icon = 'ICON_OK"

give the full path of the MIME object incluging taking care of the case sensitive .

'/SAP/BC/WebDynpro/WDC_component_name/icon_name.BMP'

Hope you understood the procedure.

Cheers,

Sana.

Former Member
0 Kudos

i am not sure if you can use legend in ALV.