‎2006 Mar 27 3:02 PM
Hi
In a screen with a table view I want a dropdown window, but only for a specific field.
Ex:
<u>
field1 field2 field 3</u>
Material Vendor Stock
For the Vendor I need a dropdown list, where I can choose among different vendors, for the specific material.
It is a 4.6 version
‎2006 Mar 27 3:17 PM
Lars,
TYPE-POOLS vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
In PBO for screen, set the values in the dropdown.
if list[] is initial.
Perform InitComboBoxes.
endif.
FORM InitComboBoxes.
move 'Commercials' to Value-Key.
move 'Commercials' to Value-Text.
append value to list.
move 'Communications' to Value-Key.
move 'Communications' to Value-Text.
append value to list.
move 'Displays' to Value-Key.
move 'Displays' to Value-Text.
append value to list.
move 'Other' to Value-Key.
move 'Other' to Value-Text.
append value to list.
move 'Product Images' to Value-Key.
move 'Product Images' to Value-Text.
append value to list.
move 'Reports' to Value-Key.
move 'Reports' to Value-Text.
append value to list.
move 'Sell Sheets' to Value-Key.
move 'Sell Sheets' to Value-Text.
append value to list.
move 'Shelf Sets' to Value-Key.
move 'Shelf Sets' to Value-Text.
append value to list.
move 'Training' to Value-Key.
move 'Training' to Value-Text.
append value to list.
I_PACK_ITEMS-LOCATION is the name of the column in the grid with the dropdown.
move 'I_PACK_ITEMS-LOCATION' to name.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
EndForm.
In Screen Painter, set the Dropdown property to Listbox.
Please reward points accordingly.
‎2006 Mar 27 3:14 PM
Hi,
you can get that with the Help of <b>VRM_SET_VALUES</b>
regards
Vijay
‎2006 Mar 27 3:15 PM
Materials and the vendors are tied together in inforecords and that is EINA table
‎2006 Mar 27 3:17 PM
Lars,
TYPE-POOLS vrm.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
In PBO for screen, set the values in the dropdown.
if list[] is initial.
Perform InitComboBoxes.
endif.
FORM InitComboBoxes.
move 'Commercials' to Value-Key.
move 'Commercials' to Value-Text.
append value to list.
move 'Communications' to Value-Key.
move 'Communications' to Value-Text.
append value to list.
move 'Displays' to Value-Key.
move 'Displays' to Value-Text.
append value to list.
move 'Other' to Value-Key.
move 'Other' to Value-Text.
append value to list.
move 'Product Images' to Value-Key.
move 'Product Images' to Value-Text.
append value to list.
move 'Reports' to Value-Key.
move 'Reports' to Value-Text.
append value to list.
move 'Sell Sheets' to Value-Key.
move 'Sell Sheets' to Value-Text.
append value to list.
move 'Shelf Sets' to Value-Key.
move 'Shelf Sets' to Value-Text.
append value to list.
move 'Training' to Value-Key.
move 'Training' to Value-Text.
append value to list.
I_PACK_ITEMS-LOCATION is the name of the column in the grid with the dropdown.
move 'I_PACK_ITEMS-LOCATION' to name.
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
EndForm.
In Screen Painter, set the Dropdown property to Listbox.
Please reward points accordingly.
‎2006 Mar 27 3:19 PM
You can do something like this. In your screen flow...here imdl-dplno is a field in a table control. OPTIN_VALUE_REQUEST is a module.
process on value-request.
field imdl-dplno module optin_value_request.
The module code. Here I'm reading the current line where the F4 help was fired, then I can use a value from
another field to retrieve values for this field. You will want to use the function module highlighted in BOLD.
************************************************************************
* Module optin_value_request INPUT
************************************************************************
module optin_value_request input.
data: begin of option_help occurs 0,
custid type zhp_plans-custid,
planid type zhp_plans-planid,
homemod type zhp_plans-homemod,
planno type zhp_options-planno,
optionid type zhp_options-optionid,
optionidx type zhp_options-optionidx,
optdesc1 type zhp_options-optdesc1,
end of option_help.
* Read the line of the table where user has requested F4 help
get cursor field cursorfield line cursorline value cursorvalue.
cursorline = ( cursorline + imdlcon-top_line ) - 1.
read table imdl index cursorline.
* Get the values..
clear option_help. refresh option_help.
select zhp_plans~custid zhp_plans~planid zhp_plans~homemod
zhp_options~planno zhp_options~optionid
zhp_options~optionidx zhp_options~optdesc1
into corresponding fields of table option_help
from zhp_plans
inner join zhp_options
on zhp_plans~planno = zhp_options~planno
where zhp_plans~custid = p_cstid
and zhp_plans~planid = imdl-plnid.
sort option_help ascending by custid planid homemod
planno optionid optionidx optdesc1.
delete adjacent duplicates from option_help comparing all fields.
<b> call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'OPTIONID'
dynprofield = 'IMDL-DPLNO'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = option_help.</b>
endmodule.
Use this example code to help you thru and make sure to get your data from the EINA table for purchase info records.
Regards,
Rich Heilman
‎2006 Mar 27 3:34 PM
Hi,
I suppose your query is how to create dropdown box for a field in table control.
For that, do these steps.
1) After you drag and drop the Table control and after you have attached a dictionary object to it, select(double click) a particular field for which you want the dropdown box to come.
2) In that there is a field named "Dropdown" which creates a dropdown box for the field.
This creates a dropdown box.Now you can write the program for loading the values of the field into the listbox.
I hope your query will get solved.
Regards,
Sylendra.
‎2006 Mar 27 7:08 PM
Lars,
If your issue has been resolved, please reward points accordingly and close the thread.
If not, please provide more detail of the issues.
Thanks in advance.