Skip to Content
avatar image
Former Member

attach legend ui element to alv table webdynpro abap

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    May 26, 2011 at 02:33 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 27, 2011 at 06:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 27, 2011 at 06:10 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded