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: 

Regarding dropdown in ALV list.

Former Member
0 Kudos

Hi All,

I am displaying ALV (LIST) output in a LIST using a FM 'REUSE_ALV_LIST_DISPLAY'.

The requirement now is, on one of the fields in the ouptut the user is asking me to provide a drop-down or F4 help. that is if the user selects a drop-down or F4 then a list of all possible entries for that field should be shown. And if the user selects one value among the drop-down or F4 help then that value should be populated on the field on which that F4 is provided.

Either drop-down or F4 help one of these is needed.

For example consider a field Emp-Grp: he may belong to SE,HR OR Manager grp. for a employee id i am presently showing him as SE Grp. and on that field i have provided either drop-down or F4 help and if i select HR now for that Emp-id, i should now show HR as his group.

Please consider that i am working with Function Modules and not Objects and Methods and one more thing i am using LIST display and not grid display.

Thanks in Advance for your esteemd replies.

Regards,

Goutham.

1 REPLY 1

Former Member
0 Kudos

Hi raghavendra,

below procedure helps you to apply dropdown list for a column.

To set a dropdown list for a column below is the procedure.

Step 1 :

Define an internal table of type LVC_T_FCAT for the field catalog:

data : gt_fieldcat type lvc_t_fcat.

Step 2 :

1. DATA: BEGIN OF GT_OUTTAB OCCURS 0.

INCLUDE STRUCTURE <DDIC structure> .

DATA: END OF GT_OUTTAB.

Step 3 :

Set status of column to editable and set a dropdown handle

Data ls_fcat type lvc_s_fcat.

Loop at pt_fieldcat into ls_fcat.

If ls_fcat-fieldname eq ' <name of column in the output table> '.

Ls_fcat-edit = 'x'.

Ls_fcat-drdn_hndl = '1'.

Ls_fcat-outputlen = 7.

Modify gt_fieldcat from ls_fcat.

Endif.

Endloop.

Step 4 :

Set up your dropdown table. Entries that refer to the same dropdown handle will be displayed in the same list box

Data : lt_dropdown type lvc_t_drop,

ls_dropdown type lvc_s_drop.

  • First listbox (handle '1').

ls_dropdown-handle = '1'.

ls_dropdown-value = 'ONE'.

append ls_dropdown to lt_dropdown.

ls_dropdown-handle = '1'.

ls_dropdown-value = 'TWO'.

append ls_dropdown to lt_dropdown.

  • Second listbox (handle '2').

ls_dropdown-handle = '2'.

ls_dropdown-value = 'THREE'.

append ls_dropdown to lt_dropdown.

ls_dropdown-handle = '2'.

ls_dropdown-value = 'FOUR'.

append ls_dropdown to lt_dropdown.

Call method g_grid->set_drop_down_table

EXPORTING

it_drop_down = lt_dropdown.

endform. " set_drdn_table

below link might help you.

http://help.sap.com/saphelp_erp2004/helpdata/en/a0/db3f37c6c80c71e10000009b38f936/frameset.htm

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

hope this helps you.

reward with points for helpful answers and close the thread if your question is solved.

regards,

venu.