2010 Dec 16 6:33 AM
Hello,
I have a requirement to display a basic list on clicking a button on a screen and then from list on clicking a button i have to go to another screen. Something similar to VERSION COMPARISON feature available in normal abap workbench....
My problem is when i click 'BACK' or 'CANCEL' or 'EXIT' on my list screen i am not going back instead i am going to next screen.
Input Screen-1 has SHOW_VERSION BUTTON . on clicking it-> display a list output that shows all versions and this list output screen shuld have a button(COMPARE) on its toolbar-> when i click on this-- i have to open another screen that shows comparison result....
So i used three screen (0001,0002 and 0003)... And in PBO of 0002, i gave below code
SET PF-STATUS 'STATUS_0002'. ---> i created COMPARE button with function_code = COMPARE
PERFORM disp_version_list.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN '0003'.
LEAVE SCREEN.
and in the event AT_USER_COMMAND
WHEN 'COMPARE'.
LEAVE LIST-PROCESSING.
So when i click COMPARE i go to screen-0003. But when i click BACK i use CALL SCREEN '0002'. and in screen'0002' if i click back its again going back to 0003.
Please help me out.
Regards, Linda
Hi Thomas,
you can try with the following code and change according to your code.Before that you have set the PF-STATUS for the screens and declare the Function Code and Function type accordingly.
case sy-ucomm.
when 'BACK'.
clear: p_field1,p_field2. " screen fields in the 0100 screen number
leave to screen '0100'. " previous screen number
when 'EXIT'.
leave program. " Function type must be declared with ' E' in PF-STATUS
endcase. " CASE sy-ucomm.
Regards,
Suvajit.
2010 Dec 16 6:44 AM
Hi,
Check your OK_CODE in all the screens . check if the ok code is cleared while leaving to other screens.
Regards,
Srini.
2010 Dec 16 7:42 AM
Hello Srini & Nitwick,
I checked the ok_codes. Unfortunately on coming back from 0003 to 0002. and again pressing back on 0002. The PBO of 0002 itself is getting triggered again.. Its not going to PAI of 0002.... Y it is so...? is it due to list processing?
Please help.
Linda.
Edited by: Linda Thomas on Dec 16, 2010 8:46 AM
2010 Dec 16 8:31 AM
Hi,
Please debug and check your code. May be, you are calling the screen 0003 somewhere when you press BACK on screen 0002.
2010 Dec 16 6:48 AM
Hi,
Have you actually coded the logic while pressing the BACK button?
Please check your sy-ucomm values in all the screens during navigation.
2010 Dec 16 7:15 AM
Hi Thomas,
you can try with the following code and change according to your code.Before that you have set the PF-STATUS for the screens and declare the Function Code and Function type accordingly.
case sy-ucomm.
when 'BACK'.
clear: p_field1,p_field2. " screen fields in the 0100 screen number
leave to screen '0100'. " previous screen number
when 'EXIT'.
leave program. " Function type must be declared with ' E' in PF-STATUS
endcase. " CASE sy-ucomm.
Regards,
Suvajit.
2010 Dec 16 10:06 AM
Hi,
Write the following code before the leave to leave to list processing statement.
clear ok_code.
ok_code = sy-ucomm.
clear sy-ucomm.
case ok_code.
when 'COMPARE'
leave to list processing and return to screen '0003'.
write 'Press back to go previous screen'.
endcase.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |