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

selection screen to another screen

Former Member
0 Likes
2,662

Hi,

I have a requirement.

in my abap code i first define a selection screen.

after entering the some values in the selection screen, and press enter, i have to go to another screen, and by clicking the back button i have to come back to the selection screen.

How to do this.

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,474

tables : sscrfields.

now write code in

at selection-screen.

case sscrfields-ucomm.

when 'ONLI'. "fn code for F8

call screen 100.

endcase.

now for the screen 100 in pai

case okcode.

when 'BACK'.

set screen 0. " or use leave to screen 0 instead of two lines

leave screen.

endcase.

regards

shiba dutta

17 REPLIES 17
Read only

Former Member
0 Likes
2,474

Hi,

Use module pool programming for such requirements.

Regards,

Atish

Read only

0 Likes
2,474

i know that, but what to write in the abap code, so that i can switch to another screen from the selection screen.

Read only

0 Likes
2,474

Hi Viki,

To call another screen from anywhere in the code you can use CALL SCREEN and it can be used in module pool as well as normal programming.

Let me know if you require further details.

IF you want some sample code then you can just search SDN you will find lots of code.

Regards,

Atish

Read only

0 Likes
2,474

yes you are right, i can go to any screen by using call screen, but i am not able to go back to my selection screen when i click back button. what should i do for that.

Read only

0 Likes
2,474

Hi,

Whenever you define your own screen you need to assign the PF -status to the same.

And once the PF status assigned you need to handle all the functionalities, for eg. when BACK button is pressed then SY-UCOMM will contain the corresponding entry.

The simplest way is just assign code EBACK to your back button in the PF status you will define.

Reward points to all useful answers.

Regards,

Atish

Read only

0 Likes
2,474

hi,

data : ok_code like sy_ucomm.

CASE OK_CODE.

WHEN 'BACK'.

leave screen.

when 'EXIT'.

leave screen.

WHEN 'CANCEL'.

leave screen.

endcase.

Read only

Former Member
0 Likes
2,474

Hi ,

data l_clear type char10.

selection-screen begin of block a1.

parameter p_test type matnr.

selection-screen end of block a1.

at selection-screen.

clear l_clear.

call selection-screen 100.

start-of-selection..

end-of-selection.

So on the whole You have to call the second selection screen at at selection-screen event.

Reward if helpful.

Read only

0 Likes
2,474

i dont want to call a second selection screen. i want to call a normal screen from the selection screen. and when i click back button on that screen, it should again go to selection screen. Hope you got my requirement.

Read only

0 Likes
2,474

hai,

u do this in module pool man,

instead of selection screen go for normal screen's in module pool,

in that u can call screen directly by call screen screen_no.

and u can navigate to the next screen and use pf_status for both the screen's.

capture the sy_ucomm and based on that particular click u can get back to the previous screen when back button was clicked.

Read only

Former Member
0 Likes
2,474

hi viki

yes u can do this if the second selection screen is of another program.

on click event of some button .By default selection screen number is 1000.

<b>call screen '1000' of program <program name></b>

or u can do another thing. u place 2 radiobutton on a screen.Depending on which radiobutton is clicked u can display different blocks.

hope this can solve ur issue.

any issues please mail me at ravish.goyal@gmail.com. i would like to solve them

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Read only

Former Member
0 Likes
2,474

u can design your own selection-screen other than the standard selection-screen(1000). check this link

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba83d35c111d1829f0000e829fbfe/content.htm

Read only

0 Likes
2,474

Also check this program<b>

DEMO_CALL_SELECTION_SCREEN</b>

Read only

Former Member
0 Likes
2,475

tables : sscrfields.

now write code in

at selection-screen.

case sscrfields-ucomm.

when 'ONLI'. "fn code for F8

call screen 100.

endcase.

now for the screen 100 in pai

case okcode.

when 'BACK'.

set screen 0. " or use leave to screen 0 instead of two lines

leave screen.

endcase.

regards

shiba dutta

Read only

0 Likes
2,474

hi,

it is giving a syntax error saying that "OKCODE" is unknown.

Read only

0 Likes
2,474

in your screen (se51) element list at last check one table control at last one okcode field will be there give OKCODE in the input area.

in your program.

DATA : OKCODE LIKE SY-UCOMM.

NOW DO THE CODING.

REGARDS

SHIBA DUTTA

Read only

0 Likes
2,474

Hi Viki,

When you define a screen you need to define the okcode of that screen also. Just go to the attributes of the screen and define OKCODE there.

Regards,

Atish

Read only

Former Member
0 Likes
2,474

hi,

for that particular screen u need to enter that ok_code in the element list ,i hope ok_code will the last element in that list of type ok go there and give that name as ok_code and all other details will be available for that field in default,only u need to add there ok_code and activate it.

name type

OK_CODE OK

and in ur report also declare that field as

DATA: ok_code TYPE sy-ucomm.