Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV : combox for specific field

Former Member
0 Kudos
87

Hi all,

I've problem to display combox for specific field :

a) no combobox

fieldcatalog-fieldname = 'AWART'.

fieldcatalog-seltext_m = 'Giustificativo'.

fieldcatalog-edit = 'X'.

  • fieldcatalog-input = ' '.

fieldcatalog-ref_fieldname = 'AWART'.

fieldcatalog-ref_tabname = 'ZT554S'.

fieldcatalog-col_pos = 1.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

b) combobox ok

fieldcatalog-fieldname = 'MATNR'.

fieldcatalog-seltext_m = 'Material Number'.

fieldcatalog-edit = 'X'.

  • fieldcatalog-input = ' '.

fieldcatalog-ref_fieldname = 'MATNR'.

fieldcatalog-ref_tabname = 'MARA'.

fieldcatalog-col_pos = 2.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

Best regards

Miki

2 REPLIES 2

Former Member
0 Kudos
43

Hi Maurizio Minichini,

Is this dropdown list? if so follow the below steps:

1.Define an extra field with type int4 in your output table

2. Set the fieldcatalog for the required field to be displayed as a dropdown with the following code.

ls_fldcat-drdn_field = here write you extra field name which is declared at output table.

3. Define a new dropdown table as below

lt_dropdown type lvc_t_drop and fill the value and handle fields then assign it to grid using this code.

grid_object->set_drop_down_table.

4. Loop thru the output table which have the extra field.

fill the extra field handle with the default values.

5. Display the grid. it have the dropdownlist (Combo box).

Thanks,

Sam.

Former Member
0 Kudos
43

Hi Maurizio,

Try this.

DATA : li_dropdown TYPE lvc_t_drop,

lwa_dropdown TYPE lvc_s_drop.

lwa_dropdown-handle = '1'.

MOVE c_unpcons TO lwa_dropdown-value.

APPEND lwa_dropdown TO li_dropdown.

CLEAR : lwa_dropdown.

lwa_dropdown-handle = '1'.

MOVE c_pr TO lwa_dropdown-value.

APPEND lwa_dropdown TO li_dropdown.

CLEAR : lwa_dropdown.

lwa_dropdown-handle = '1'.

MOVE c_skpcons TO lwa_dropdown-value.

APPEND lwa_dropdown TO li_dropdown.

CLEAR : lwa_dropdown.

CALL METHOD o_alvgrid->set_drop_down_table

EXPORTING

it_drop_down = li_dropdown.

IF sy-subrc NE 0.

ENDIF.

In the fiedl Catalog,

ls_fcat-drdn_hndl = '1'. " Add this for the column you want the drop down list

Reward If Useful.

Regards,

Chitra