Skip to Content

How do I capture a value selected from a drop-down list?


I've been working on this issue all day today -- trial-and-error, reading help files, searching the net, and searching here. I'm still stuck.

I have the following parameter defined on my Selection Screen:

PARAMETERS p_linlay TYPE dfkk_selp_res-sel_name OBLIGATORY. "Line layout

It gets populated like this:

  • Populate the drop-down for Line Layout


PERFORM fill_table_p_linlay.

The form looks like this:

FORM fill_table_p_linlay.

DATA: l_option TYPE help_info-dynprofld,

v_repid LIKE sy-repid.

  • Only do the database read if the internal table is empty.

DESCRIBE TABLE it_line_layout LINES g_lines.

IF g_lines EQ 0.

  • Read the Line Layouts from the database table.

SELECT sel_name text

FROM dfkk_selp_res

INTO TABLE it_line_layout

WHERE sel_type = 'XO' AND "Open Items Line Layout

text LIKE 'Z_%'. "Description will begin with 'Z_'

SORT it_line_layout BY sel_name ASCENDING.


l_option = 'p_linlay'.

v_repid = sy-repid.

*This function is called to provide the input help for the user.



retfield = 'SEL_NAME'

dynpprog = v_repid

dynpnr = sy-dynnr

dynprofield = l_option

window_title = 'Select Line Layout'

value_org = 'S'

display = ' '


value_tab = it_line_layout


parameter_error = 1

no_values_found = 2


ENDFORM. " fill_table_p_linlay

What I want to do is this: If the user chooses a particular value from the drop-down, I want to protect a different field on my Selection Screen. But I cannot figure out how to CAPTURE THE VALUE that the user selects! The parameter P_LINLAY doesn't get populated with the value right away (not until the user presses Execute). I don't want to wait that long -- the user wants certain fields closed off on the Selection Screen if a certain value is chosen.

Please note that I am NOT using a listbox. I have a large number of fields on the screen, and it's highly preferable to use the drop-down.

Points will be awarded. Thanks so much for your help!


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Nov 30, 2007 at 08:40 PM

    Never mind, gang -- I just figured it out. I totally missed that I could declare a return table as an optional parameter to the FM call.

    <smacks forehead>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.