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: 

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

former_member210148
Participant
0 Kudos

Greetings!

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

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_linlay.

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.

ENDIF.

l_option = 'p_linlay'.

v_repid = sy-repid.

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

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'SEL_NAME'

dynpprog = v_repid

dynpnr = sy-dynnr

dynprofield = l_option

window_title = 'Select Line Layout'

value_org = 'S'

display = ' '

TABLES

value_tab = it_line_layout

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

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!

Dave

1 REPLY 1

former_member210148
Participant
0 Kudos

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>