‎2007 Jun 01 5:56 AM
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.
‎2007 Jun 01 6:12 AM
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
‎2007 Jun 01 5:57 AM
Hi,
Use module pool programming for such requirements.
Regards,
Atish
‎2007 Jun 01 6:02 AM
i know that, but what to write in the abap code, so that i can switch to another screen from the selection screen.
‎2007 Jun 01 6:08 AM
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
‎2007 Jun 01 6:12 AM
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.
‎2007 Jun 01 6:18 AM
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
‎2007 Jun 01 6:23 AM
hi,
data : ok_code like sy_ucomm.
CASE OK_CODE.
WHEN 'BACK'.
leave screen.
when 'EXIT'.
leave screen.
WHEN 'CANCEL'.
leave screen.
endcase.
‎2007 Jun 01 6:05 AM
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.
‎2007 Jun 01 6:08 AM
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.
‎2007 Jun 01 6:14 AM
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.
‎2007 Jun 01 6:08 AM
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>
‎2007 Jun 01 6:08 AM
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
‎2007 Jun 01 6:12 AM
‎2007 Jun 01 6:12 AM
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
‎2007 Jun 01 6:32 AM
hi,
it is giving a syntax error saying that "OKCODE" is unknown.
‎2007 Jun 01 6:38 AM
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
‎2007 Jun 01 6:38 AM
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
‎2007 Jun 01 6:47 AM
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.