cancel
Showing results for 
Search instead for 
Did you mean: 

need help for ALV List

Former Member
0 Kudos

Hi ,

I need help in ALV list for showing ICON in two of my coloumn and another one column i need check box.

how to proceed with coding. I tried with sap exercise doc but it is not workig for me.

pl help me to give details for the above.

Thanks in advance.

Kar

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Go through the CONFIGURE_ALV method in the COMPONENTCONTROLLER method of SALV_WD_TEST_TABLE_EDIT. (or any other WDP component in the SALV_WD_TEST package).

What is the code that you have used to configure your ALV?

Regards

Wenonah

Former Member
0 Kudos

Hi,

Thanks . I am using this code for ICON dynamically.

i am coding in wddoinit.

DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV_COMP_USED( ).

IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

LO_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV_COMP_USED( ).

DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(

).

*DATA: lr_column TYPE REF TO cl_salv_wd_column,

  • lr_column1 TYPE REF TO cl_salv_wd_column,

*lr_image TYPE REF TO cl_salv_wd_uie_image,

*lr_image1 TYPE REF TO cl_salv_wd_uie_image,

*lv_icon TYPE string,

*lv_icon1 TYPE string.

*

*lr_column = lO_value->if_salv_wd_column_settings~get_column( 'col1' ).

*CREATE OBJECT lr_image.

*lr_image->SET_SOURCE_FIELDNAME( 'IMG1' ).

*lr_column->set_cell_editor( lr_image ).

*

*lr_column1 = lO_value->if_salv_wd_column_settings~get_column( 'col2' ).

*CREATE OBJECT lr_image1.

*lr_image1->SET_SOURCE_FIELDNAME( 'IMG2' ).

*lr_column1->set_cell_editor( lr_image1 ).

  • fill column STATUS

  • LOOP AT lt_alv INTO ls_alv.

*

  • LVALUE1 = lS_alv-col1.

  • LVALUE2 = lS_alv-col2.

*

  • IF LVALUE1 = 'y'.

*lS_alv-IMG1 = 'ICON_RED_LIGHT'.

  • ELSE.

  • lS_alv-IMG1 = 'ICON_GREEN_LIGHT'.

  • ENDIF.

*

  • IF LVALUE2 = 'y'.

*lS_alv-IMG2 = 'ICON_RED_LIGHT'.

  • ELSE.

  • lS_alv-IMG2 = 'ICON_GREEN_LIGHT'.

  • ENDIF.

*

*modify lt_alv from ls_alv transporting IMG1 IMG2.

*

  • ENDLOOP.

I am using above ode to craete the ICON dynamicaly creating with two columns.

but this code will craete the columns IMG1 and IMG2.

but I did n't get the icons.

thanks in advance.

Kar

Former Member
0 Kudos

Hi,

After setting the icons, in the loop, I do not see a bind_elements or bind_table statement. Are you doing that? You need to have a statement like:

lo_node->bind_elements( lt_alv ).

This will bind the table contents to the node so that it is displayed in the alv.

Regards

Wenonah