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

Can Selection Screen processing events be triggered manually?

Former Member
0 Likes
1,518

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,433

did you have a look at this DEMO program

DEMO_DYNPRO_DROPDOWN_LISTBOX

A

Read only

0 Likes
1,433

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.

Read only

Former Member
0 Likes
1,433

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.

Read only

former_member194669
Active Contributor
0 Likes
1,433

Hi,

Try to use


call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'REFR'.             " Dummy F code
endmethod.

a®

Read only

0 Likes
1,433

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

Read only

0 Likes
1,433

Hi,

After that you need to call fm DYNP_VALUES_UPDATE.

a®

Read only

0 Likes
1,433

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.

Read only

0 Likes
1,433

Hi,

Please check this thread.

Please see the reply as suggested by Rich.

a®

Read only

0 Likes
1,433

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?

Read only

0 Likes
1,433

Sorry, I have updated the wrong thread. Now you please the thread

a®

Read only

0 Likes
1,433

Thank you -- I'll check it out!