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: 

Selection screen event ON EXIT-COMMAND

k_gjergja
Participant
0 Kudos
3,257

Hello,

I rapport with selection screen I add

AT SELECTION-SCREEN ON EXIT-COMMAND

leave programe

The problem is that this screen event is triggered even when

user hits 'Get variant' button and than instead to show variants

flow foes out of program waht should happen only after

cancel , back or exit.

Please advice

1 ACCEPTED SOLUTION

k_gjergja
Participant
0 Kudos
548

Hello ,

When I said not workin properly that means CANCEL / BACK / EXIT do not have expected funcionality and

action after user hit those buttons was - continue execution of program (like F8)

Although in your code I found solution the 'sscrfields' structure needs to be declared as table.

That solved my issue

Thank you

4 REPLIES 4

former_member378318
Contributor
0 Kudos
548

You don't need to code anything special for leaving a selection screen, just take the statement out. Is there something special you are trying to achieve by capturing the exit event?

k_gjergja
Participant
0 Kudos
548

It is a question of some program with three transactions. Cancel/ back and Exit buttons before I set ‘ON EXIT’, didn’t work properly. After I set ‘On EXIT’ they are working properly but Get layout button leaves the program as well,Which is not expected.

DoanManhQuynh
Active Contributor
0 Kudos
548

If its selection screen, those button work as normal, you dont have to add ON EXIT to make it leave program. what do you mean 'didnt work properly', could you more detail? anw, I code a simple program and dont have any issue with on exit event:

TABLES sscrfields.

SELECTION-SCREEN BEGIN OF SCREEN 1100.
PARAMETERS: p_carrid TYPE s_carr_id,
p_cityfr TYPE s_from_cit.
SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2.
SELECTION-SCREEN END OF SCREEN 1100.

AT SELECTION-SCREEN ON EXIT-COMMAND.
MESSAGE 'out' TYPE 'I'.

AT SELECTION-SCREEN.
CASE sscrfields-ucomm.
WHEN'FC01'.
p_carrid = 'LH'.
p_cityfr = 'Frankfurt'.
WHEN 'FC02'.
p_carrid = 'UA'.
p_cityfr = 'Chicago'.
ENDCASE.

START-OF-SELECTION.
sscrfields-functxt_01 = 'LH'.
sscrfields-functxt_02 = 'UA'.

CALL SELECTION-SCREEN 1100.

k_gjergja
Participant
0 Kudos
549

Hello ,

When I said not workin properly that means CANCEL / BACK / EXIT do not have expected funcionality and

action after user hit those buttons was - continue execution of program (like F8)

Although in your code I found solution the 'sscrfields' structure needs to be declared as table.

That solved my issue

Thank you