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

Small Query in Selection Screen and Screen.

Former Member
0 Likes
1,294

Hello Guys...

I have Created a program using Selection-Screen 1000. and Screen 2000.

At Selection-Screen I have written code

Start-of-selection.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

end case.

and At the user-command of Screen 2000.

I have written Follow code.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

when 'CANCEL'.

LEAVE PROGRAM.

when 'ADD'.

Perform Add_New_Row.

when 'REMOVE'.

Perform DELETE_Row.

when 'SAVE'.

Perform SAVE_DATA.

when 'EXIT'.

LEAVE PROGRAM.

endcase.

...................................................

My Problem is that I am not able to come out from program through back button..

Follow is like that..

at Selection Screen user provide some input on that basis screen 2000 Call.

but when i press back button on screen 2000 Selection screen 1000 appear.

and my Problem is that when i press back button on selection-screen on 1000.

it's goes to screen 2000.

I know, it's little thing I am missing, Let me know ..what was that..

Cheers......

Swati...

1 ACCEPTED SOLUTION
Read only

SantoshKallem
Active Contributor
0 Likes
1,268

what u have written in PAI of 1000 screen

try this

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

Reward if useful.

Hello Guys...

I have Created a program using Selection-Screen 1000. and Screen 2000.

At Selection-Screen I have written code

Start-of-selection.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

end case.

and At the user-command of Screen 2000.

I have written Follow code.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

when 'CANCEL'.

LEAVE PROGRAM.

when 'ADD'.

Perform Add_New_Row.

when 'REMOVE'.

Perform DELETE_Row.

when 'SAVE'.

Perform SAVE_DATA.

when 'EXIT'.

LEAVE PROGRAM.

endcase.

...................................................

My Problem is that I am not able to come out from program through back button..

Follow is like that..

at Selection Screen user provide some input on that basis screen 2000 Call.

but when i press back button on screen 2000 Selection screen 1000 appear.

and my Problem is that when i press back button on selection-screen on 1000.

it's goes to screen 2000.

I know, it's little thing I am missing, Let me know ..what was that..

Cheers......

Swati...

14 REPLIES 14
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,268

Hi,

I think the problem is when you press back it goes to the event AT SELECTION-SCREEN and there you have call to screen 2000. Check in debug mode if this is happening. If this is the case then handle the function code for BACK at this event AT SELECTION-SCREEN and put LEAVE TO SCREEN 0.

Regards,

Sesh

Read only

Former Member
0 Likes
1,268

For OK_CODE 'BACK'

use statement LEAVE TO SCREEN 0.

Read only

Former Member
0 Likes
1,268

if you are coding like this

At Selection-Screen I have written code

Start-of-selection.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

end case.

then i want to know start-of-selection is an event also why you are coding it after at selection-screen.

you code like this.

At Selection-Screen I have written code

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

end case.

Start-of-selection.

regards

shiba dutta

Read only

Former Member
0 Likes
1,268

Hello Guys...

Previous code I have given is modify by this but same problem..

I have dubug the program and trace it. it's will not goes on Selection Screen

on Each back button the event occurs which is user-command 2000.

I have Created a program using Selection-Screen 1000. and Screen 2000.

At Selection-Screen I have written code

Start-of-selection.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

end case.

and At the user-command of Screen 2000.

I have written Follow code.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

CALL SELECTION-SCREEN '1000'.

EXIT.

when 'CANCEL'.

LEAVE PROGRAM.

when 'ADD'.

Perform Add_New_Row.

when 'REMOVE'.

Perform DELETE_Row.

when 'SAVE'.

Perform SAVE_DATA.

when 'EXIT'.

LEAVE PROGRAM.

endcase.

...................................................

My Problem is that I am not able to come out from program through back button..

Follow is like that..

at Selection Screen user provide some input on that basis screen 2000 Call.

but when i press back button on screen 2000 Selection screen 1000 appear.

and my Problem is that when i press back button on selection-screen on 1000.

it's goes to screen 2000.

I know, it's little thing I am missing, Let me know ..what was that..

Cheers......

Swati...

Read only

0 Likes
1,268

Swati,

How are you calling screen 2000.... can you please provide that part of the code?

Read only

Former Member
0 Likes
1,268

Hello Shiba,

I have try that also but That event is not triggering. at each back button only event user-Command at 2000 is trigger. Please cehck my 2 mail regarding the same..

At each back button on scrren 1000 and 2000 only and only event user-Command at 2000 is trigger.

Regards

Swati..

Read only

SantoshKallem
Active Contributor
0 Likes
1,269

what u have written in PAI of 1000 screen

try this

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

Reward if useful.

Read only

Former Member
0 Likes
1,268

Hello Sustain

I am calling Screen 2000 at Start of Selection Event. for u r referance code is there..

.........................................................

Start-of-selection.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

endcase.

            • Screen from Here only

call screen 2000.

Read only

0 Likes
1,268

Swati,

Remove the below code from the START-OF-SELECTION event:

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

endcase.

and check if it works.

Susanth

Read only

0 Likes
1,268

Hi,

This:

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'BACK'.

LEAVE PROGRAM.

endcase.

is not required in your code. Since, screen 1000 is the standard selection screen no., you dont hav to code for it, it will come out the program when you press back.

Regards

Subramanian

Read only

0 Likes
1,268

Swati,

In the PAI event for BACK ok-code put a condition for screen no as

IF sy-dynnr = '2000'.

LEAVE PROGRAM.

ENDIF.

Read only

Former Member
0 Likes
1,268

Hello Susthain.

Thanks Problem is solved.. with leave to screen 0..

Point are Rewarded to you.

Regards

Swati..

Read only

0 Likes
1,268

Swati,

You have rewarded points to someone else

Read only

Former Member
0 Likes
1,268

sorry swati i am not reading properly your requirement. i think you have given start-of-selection at that place as i told earlier.

from your query what i can under stand in your report program you are calling screen 2000. if it is correct then no need to create screen 1000 for that because it will automatically create that.

and for screen 2000 dont code at user-command write the code at PAI of 2000.

and there in back use set screen 0. leave screen command.

please clarify me if i am wrong.

regards

shiba dutta