Skip to Content
0
Former Member
Feb 16, 2009 at 11:37 AM

Dropdown list is blank for ALV dropdown column?

38 Views

Hi All,

I am trying to populate the dropdown values for 4 ALV columns.

The code is below for COLUMN1,COLUMN2,COLUMN3 and COLUMN4

n_row_cnt = lo_nd_src_icx_rpt->get_element_count( ).

CLEAR: x_valueset_reason,x_valueset_typ_of_dt,x_valueset_tar,x_valueset_tara.

  DO n_row_cnt  TIMES.                  "IF there are rows in ALV

"Populate Dropdown valuset for each ALV row
    lo_el_src_icx_rpt = lo_nd_src_icx_rpt->get_element( v_index ).

    x_valueset_TAR-value = co_yes.
    x_valueset_TAR-text = co_yes.
    APPEND x_valueset_TAR to i_valueset_TAR.

    x_valueset_TAR-value = co_no.
    x_valueset_TAR-text = co_no.
    APPEND x_valueset_TAR to i_valueset_TAR.

    lo_el_src_icx_rpt->set_attribute(  EXPORTING
    name = 'COLUMN1_LIST'
    value = i_valueset_TAR ).

    x_valueset_TARA-value = co_yes.
    x_valueset_TARA-text = co_yes.
    APPEND x_valueset_TARA to i_valueset_TARA.

    x_valueset_TARA-value = co_no.
    x_valueset_TARA-text = co_no.
    APPEND x_valueset_TARA to i_valueset_TARA.


    lo_el_src_icx_rpt->set_attribute( EXPORTING
      name = 'COLUMN2_LIST'
      value = i_valueset_TARA
    ).

    x_valueset_Reason-value = co_bonus.
    x_valueset_Reason-text = co_bonus.
    APPEND x_valueset_Reason to i_valueset_Reason.

    x_valueset_Reason-value = co_loss.
    x_valueset_Reason-text = co_loss.
    APPEND x_valueset_Reason to i_valueset_Reason.

    x_valueset_Reason-value = co_scrap.
    x_valueset_Reason-text = co_scrap.
    APPEND x_valueset_Reason to i_valueset_Reason.

    x_valueset_Reason-value = co_src_data_err.
    x_valueset_Reason-text = co_src_data_err.
    APPEND x_valueset_Reason to i_valueset_Reason.

    x_valueset_Reason-value = co_othr.
    x_valueset_Reason-text = co_othr.
    APPEND x_valueset_Reason to i_valueset_Reason.

    lo_el_src_icx_rpt->set_attribute( EXPORTING
     name = 'COLUMN3_LIST'
     value = i_valueset_Reason ).

    x_valueset_typ_of_dt-value = co_eoh.
    x_valueset_typ_of_dt-text  = co_eoh.
    APPEND x_valueset_typ_of_dt TO i_valueset_typ_of_dt.

    x_valueset_typ_of_dt-value = co_subcon.
    x_valueset_typ_of_dt-text  = co_subcon.
    APPEND x_valueset_typ_of_dt TO i_valueset_typ_of_dt.

    x_valueset_typ_of_dt-value = co_intransit.
    x_valueset_typ_of_dt-text  = co_intransit.
    APPEND x_valueset_typ_of_dt TO i_valueset_typ_of_dt.

    lo_el_src_icx_rpt->set_attribute( EXPORTING
     name = 'COLUMN4_LIST'
     value = i_valueset_typ_of_dt ).

    CLEAR i_valueset_tar.
    CLEAR i_valueset_tara.
    CLEAR i_valueset_reason.
    CLEAR i_valueset_typ_of_dt.
    CLEAR: x_valueset_reason,x_valueset_typ_of_dt,x_valueset_tar,x_valueset_tara.

    v_index = v_index + 1.

  ENDDO.

Here COLUMN1_LIST, COLUMN2_LIST, COLUMN3_LIST and COLUMN4_LIST are also attributes.

In ALV settins i have done sm thing like this

CREATE OBJECT lr_edit_reason_for_adj

EXPORTING

selected_key_fieldname = 'COLUMN4'.

lr_edit_reason_for_adj->set_valueset_fieldname( 'COLUMN4_LIST' ).

lr_column_reason_for_adj->set_cell_editor( lr_edit_reason_for_adj ).

I am not getting the values in dropdown for COLUMN4.

Please guide.

Regards,

Sumit Oberoi