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

Drop-down window

Former Member
0 Likes
863

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
834

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.

6 REPLIES 6
Read only

Former Member
0 Likes
834

Hi,

you can get that with the Help of <b>VRM_SET_VALUES</b>

regards

Vijay

Read only

Former Member
0 Likes
834

Materials and the vendors are tied together in inforecords and that is EINA table

Read only

Former Member
0 Likes
835

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.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
834

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

Read only

Former Member
0 Likes
834

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.

Read only

0 Likes
834

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.