‎2007 Dec 10 4:28 PM
Good day!
I have a Selection Screen where a user can select a value from a drop-down box. If a particular value is used, I assign default text to another Selection Screen field.
However, because choosing the drop-down value doesn't trigger a Selection Screen processing event (AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT) the value doesn't get updated on the screen field, even though it gets updated in memory. It only updates on the screen if the user selects a radio button value for another field because that triggers the Selection Screen processing events.
I've read about various methods in an attempt to get this to work, but nothing is working. Is there ANY way to trigger SAP to go to these events?
Thanks, and points for all helpful advice!
Dave
‎2007 Dec 10 4:31 PM
did you have a look at this DEMO program
DEMO_DYNPRO_DROPDOWN_LISTBOX
A
‎2007 Dec 10 4:34 PM
It's not a listbox. It's defined this way:
PARAMETERS p_linlay TYPE dfkk_selp_res-sel_name OBLIGATORY. "Line layout
I then have this:
Populate the drop-down for Line Layout
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_linlay.
PERFORM fill_table_p_linlay.
I use this to populate my list:
*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
return_tab = it_return_table
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
‎2007 Dec 10 4:31 PM
Hi dave,
1. Selecting a listbox on selection screen,
and immediately populating a field value on the screen.
2. just copy paste to get a taste of it.
3.
REPORT ABC.
TYPE-POOLS : VRM.
DATA : VALUES TYPE VRM_VALUES.
DATA : VW LIKE LINE OF VALUES.
DATA : FLAG TYPE C.
PARAMETERS : LIST TYPE C AS LISTBOX VISIBLE LENGTH 10
<b>USER-COMMAND ABC.</b>
PARAMETERS : A(10) TYPE C.
INITIALIZATION.
VW-KEY = '1'.
VW-TEXT = 'SUN'.
APPEND VW TO VALUES.
VW-KEY = '2'.
VW-TEXT = 'MON'.
APPEND VW TO VALUES.
VW-KEY = '3'.
VW-TEXT = 'TUE'.
APPEND VW TO VALUES.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'LIST'
VALUES = VALUES
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
*----
<b>AT SELECTION-SCREEN OUTPUT.
A = LIST.</b>
regards,
amit m.
‎2007 Dec 10 4:42 PM
Hi,
Try to use
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'REFR'. " Dummy F code
endmethod.
a®
‎2007 Dec 10 6:52 PM
I tried your suggestion (call method cl_gui_cfw) but that didn't work. It just displayed the Selection Screen without going to the AT SELECTION-SCREEN event.
Dave
‎2007 Dec 10 6:59 PM
‎2007 Dec 10 7:07 PM
Still didn't work. Here's my section of code:
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFR'. " Dummy F code
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'ZFIR_PSCD_REPORTING'
dynumb = sy-dynnr
TABLES
dynpfields = it_dynpread.
IF sy-subrc <> 0.
MESSAGE e999 WITH 'Error'.
ENDIF.
‎2007 Dec 10 7:22 PM
Hi,
Please check this thread.
Please see the reply as suggested by Rich.
a®
‎2007 Dec 10 7:28 PM
I don't see a "Rich" in that thread, and the topic looks like it doesn't have anything to do with my question. Is that the correct link?
‎2007 Dec 10 7:33 PM
Sorry, I have updated the wrong thread. Now you please the thread
a®
‎2007 Dec 10 7:47 PM