2013 Jun 06 11:24 AM
Hi,
I used CL_GUI_ALV_GRID to build a ALV. At the PAI of ALV, I capture function codes to process the action. But all function codes bring me back to the selection screen. But I only want to show the selection screen when I press BACK or CANCEL.
GV_FCODE = SY-UCOMM.
CASE GV_FCODE.
WHEN 'BACK' OR 'CANCEL'.
CALL SELECTION-SCREEN 1000.
* CLEAR: GV_FCODE.
WHEN 'EXIT'.
CLEAR: GV_FCODE.
LEAVE PROGRAM.
WHEN 'EDIT'.
PERFORM SHOW_EDITCELL.
WHEN OTHERS.
ENDCASE.
2013 Jun 06 12:11 PM
Check "next screen" value of the main dynpro, should be the same dynpro, if initial, end of PAI go to code after CALL SCREEN. (Static Next Dynpro)
And don't
- use sy-ucomm but an OK_CODE variable in the dynpro definition, (Reading Function Codes)
- use CALL SELECTION-SCREEN 1000 to get back to selection screen, try a LEAVE TO SCREEN 0 or a LEAVE TO CURRENT TRANSACTION (You are stacking screens over screens, Screens, Screen Sequences)
Regards,
Raymond
2013 Jun 06 12:11 PM
Check "next screen" value of the main dynpro, should be the same dynpro, if initial, end of PAI go to code after CALL SCREEN. (Static Next Dynpro)
And don't
- use sy-ucomm but an OK_CODE variable in the dynpro definition, (Reading Function Codes)
- use CALL SELECTION-SCREEN 1000 to get back to selection screen, try a LEAVE TO SCREEN 0 or a LEAVE TO CURRENT TRANSACTION (You are stacking screens over screens, Screens, Screen Sequences)
Regards,
Raymond
2013 Jun 07 4:16 AM
Hi Raymond,
Thank you for your reply.
I replace CALL SELECTION-SCREEN 1000 with LEAVE TO SCREEN 0. But it won't go back to the selection screen, it stays in the same screen.
Regards,
ts
2013 Jun 07 8:03 AM
2013 Jun 07 5:09 AM
Change the CALL SELECTION-SCREEN 1000
to LEAVE TO SCREEN 0.
Regards,
Ikrar
2013 Jun 07 6:19 AM
Hi Ikara,
I've made the change and but it doesn't go back to the selection-screen but stay at the current screen.
Best regards,
ts
2013 Jun 07 6:49 AM
Hiii,
Use set screen 0. see my sample code -
REPORT TEST.
TABLES : t001.
SELECT-OPTIONS : so FOR t001-BUKRS.
START-OF_SELECTION.
call screen 0100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
SAVE_OK = SY-UCOMM.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'CANCEL' OR 'BACK'.
SET SCREEN 0.
*LEAVE PROGRAM.
when 'CREATE'.
CALL SCREEN 200.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
2013 Jun 07 9:29 AM
Hi Ashish,
The selection-screen is created using SELECT-OPTIONS. It seems that SET SCREEN 0 doesn't work.
Regards,
ts
2013 Jun 07 9:55 AM
Hiii,
Just copy paste and try it'll work more info press f1 or help.sap.com. Here select-options - taking input and in PBO of screen 100 getting data based on that input and just create object of container and show ALV and in PAI write logic of back button so you can again view your selection main screen.
you can use call screen also but it totally depends on requirement .
2013 Jun 07 7:28 AM
Use the following logic :
DATA: v_ok_code TYPE sy-ucomm,
v_save_ok TYPE sy-ucomm.
v_ok_code = sy-ucomm.
v_save_ok = v_ok_code.
CASE sy-ucomm.
WHEN 'BACK'.
SET SCREEN 1000.
WHEN 'CANCEL'.
SET SCREEN 1000.
WHEN OTHERS.
SET SCREEN 1000.
ENDCASE.
CLEAR v_save_ok.
SET SCREEN 0.
LEAVE SCREEN.
2013 Jun 07 7:39 AM
2013 Jun 20 6:24 PM
Hi,
Use SUBMIT <your program name> via selection-screen.
it will also work....
Thanks,
Satya.