Application Development and Automation 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: 
Read only

Help needed in Drop down list value input

Former Member
0 Likes
1,093

Hi experts,

My problem is, I added a field on a screen as a drop down list box and passed all the values to it. Everything is fine. But I need to display the field like if there are no input values to be used by the user, the user should be able to enter some value manually which is not in the list. I'm unable to get this facility. Plzz Help me out.

It's really urgent. Points will be rewarded to the solution.

1 ACCEPTED SOLUTION
Read only

former_member196299
Active Contributor
0 Likes
810

hi ,

After you fill the internal table clear the work area , so that it will not show the values from the list in the input box as the user can input values into it manually . you need to clear/refresh your itab once you have used it .

Ranjita

7 REPLIES 7
Read only

former_member196299
Active Contributor
0 Likes
811

hi ,

After you fill the internal table clear the work area , so that it will not show the values from the list in the input box as the user can input values into it manually . you need to clear/refresh your itab once you have used it .

Ranjita

Read only

0 Likes
810

If this is a module pool, function module vrm_values is the answer !!!!

Read only

0 Likes
810

Hi Sameer ,

VRM_VALUES is not a FM , rather VRM is the type-pool.

here is few info about vrm_values :

type-pools : vrm.

types:

*-- Single Value in Value Set

begin of vrm_value,

key(40) type c,

text(80) type c,

end of vrm_value,

*-- Table of Values

vrm_values type vrm_value occurs 0 .

vrm_values is one of the parameters of type vrm_value in VRM_SET_VALUES function module .

VRM_SET_VALUES and VRM_GET_VALUES are the function modules .

Regards,

Ranjita

Read only

Former Member
0 Likes
810

Hi Mallikarjun,

Drop down list box means you will have a value from the list of options and you will select a one but your case is different and it is violating the definition of list box.

I am not sure this may help you to solve your issue.

Have 'Others' value in the drop down list box and maintain another input value on screen and take this value once the drop down list box has value 'Others'.

Thanks,

Vinay

Read only

0 Likes
810

Yes, the listbox option will give you a display-only list, so if you need to create a new entry then add a list entry such as the "Others" as suggested above or "New...", and on the field have a function code that you can pick up in your PAI to indicate a value has been selected and give them a popup then to key the new entry e.g. something like:

case sy-ucomm.
  when 'DROPDOWN_ENTERED'.   "user clicked dropdown
     if g_fieldvalue = 'N'.  "The "New..." entry was selected
*
*"call POPUP_GET_VALUES or own screen to get new value 
*"and add into listbox list
*
       perform get_new_listbox_entry. "do popup and add to list
     endif.
endcase.

Read only

former_member196299
Active Contributor
0 Likes
810

hi ,

Here is a sample of code for creating a dropdown list in screen painter , and this has got the solution of your question :

module create_drop_down_box_material output.

select matnr from mara

into table l_tab_mara_matnr

where matkl = 'ZPMBMAT'.

if not l_tab_mara_matnr[] is initial.

select maktx from makt

into l_tab_collect_maktx_frm_db-material_descr

for all entries in l_tab_mara_matnr

where matnr = l_tab_mara_matnr-material_no.

append l_tab_collect_maktx_frm_db.

endselect.

endif.

loop at l_tab_collect_maktx_frm_db into l_wa_collect_maktx_frm_db.

l_wa_mat_descr-key = l_wa_collect_maktx_frm_db-material_descr.

append l_wa_mat_descr to l_tab_mat_descr.

endloop.

name = 'ZCOT_PPT_DTLS-MATERIAL_DESCR'.

call function 'VRM_SET_VALUES'

exporting

id = name

values = l_tab_mat_descr

exceptions

id_illegal_name = 1

others = 2.

free: l_tab_mat_descr,l_tab_collect_maktx_frm_db.

endmodule. " create_drop_down_box_material OUTPUT

Regards,

Ranjita

Read only

Former Member
0 Likes
810

Thanks for the replies.