‎2007 Feb 21 1:28 PM
Hi all,
i've generated selection screen 1000 and one other screen 0100 which is called from the main program. i've generated gui status and gui title also. in gui status i've declared BACK EXIT & CANCEL buttons and activates. The problem is when i get to screen 0100 none of this buttons do what they are declared for. i allwayse need to terminate the program. Please any suggestions are welcome!
thank you in advance!
Maja
‎2007 Feb 21 1:30 PM
hi capture the user command values for BACK CANCEL using variable of type OK-CODE, then it will work
‎2007 Feb 21 1:32 PM
Hi,
I allready have:
PROCESS AFTER INPUT.
MODULE user_command_0100.
***
**
*
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
PERFORM free_memory.
WHEN OTHERS.
PERFORM free_memory.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
‎2007 Feb 21 1:33 PM
Hello Maja,
If the buttons have to perfrom somethink u need to write code for it in the PAI module of screen 0100 like this.
PAI
MODULE USER_COMMANDCASE SY-UCOMM.
when 'BACK'.
****
WHEN 'CANCEL'.
****
ENDCASE.Vasanth
‎2007 Feb 21 1:33 PM
see u need to maintian the Pf status for each screen .
In ur case u have to have pf status for <b>both</b> screen 0100 and 1000 . see if u are missing this.
next .
in the pai of screen 1000 write the code as
case SY-ucomm .
when 'BACK'.
When 'CANC'.
When 'EXIT'.
endcase.
in these u need to handle the logic of leave to screen /leave program etc.
regards,
vijay.
‎2007 Feb 21 1:55 PM
‎2007 Feb 21 1:59 PM
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
CALL METHOD custom_container2->free.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = lv_repid
txt2 = sy-subrc
txt1 = 'Error in FLush'(500).
ENDIF.
SET SCREEN '0'.
WHEN 'EXIT' OR 'CANC'.
PERFORM exit_program.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. USER_COMMAND_9000 INPUTmake sur ethat the FUNCTION CODE provided by u in the screen painter shpuld be the same u r specifying here in teh CAPS.
Hope his helsp u.
‎2007 Feb 21 2:13 PM
Hi Maja,
When u attach User Defined GUI status to ur program, the standard GUI buttons and their functionalities are disabled. U need to write ur own code even u activated the Standard Buttons like BACK, CANCEL, EXIT etc.
In PBO u can handle this,
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE TRANSACTION.
ENDCASE.
Regards,
Sreedhar