Using exit command

I have a canvas class which is invoked by another class:
public class Play extends Canvas implements CommandListener
  Play
}In this class I want to have the option to exit and go back to the first class (Game).
Im sure this is possible although I cannot do it with this code:
     public void commandAction(Command c, Displayable s)
          if(c == exitCommand)
               try
                    Geme game = new Game();
                    game.startApp();
               catch(MIDletStateChangeException e)
     }As I get this error at runtime:
java.lang.SecurityException: Application not authorized to access the restricted API
     at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(+40)
     at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(+7)
     at com.sun.midp.midletsuite.MIDletSuiteImpl.checkIfPermissionAllowed(+8)
     at com.sun.midp.midlet.MIDletState.<init>(+83)
     at javax.microedition.midlet.MIDletProxy.<init>(+5)
     at javax.microedition.midlet.MIDlet.<init>(+13)
     at Game.<init>(+4)
     at Play.commandAction(+15)
     at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
     at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
     at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
     at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)
Please make any suggestions.

I have a canvas class which is invoked by another class:
public class Play extends Canvas implements CommandListener
  Play
}In this class I want to have the option to exit and go back to the first class (Game).
Im sure this is possible although I cannot do it with this code:
     public void commandAction(Command c, Displayable s)
          if(c == exitCommand)
               try
                    Geme game = new Game();
                    game.startApp();
               catch(MIDletStateChangeException e)
     }As I get this error at runtime:
java.lang.SecurityException: Application not authorized to access the restricted API
     at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(+40)
     at com.sun.midp.security.SecurityToken.checkIfPermissionAllowed(+7)
     at com.sun.midp.midletsuite.MIDletSuiteImpl.checkIfPermissionAllowed(+8)
     at com.sun.midp.midlet.MIDletState.<init>(+83)
     at javax.microedition.midlet.MIDletProxy.<init>(+5)
     at javax.microedition.midlet.MIDlet.<init>(+13)
     at Game.<init>(+4)
     at Play.commandAction(+15)
     at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
     at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
     at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
     at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+186)
     at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+57)
Please make any suggestions.

Similar Messages

  • System asking me to fill MANDATORY fields, even I used EXIT-COMMAND for F3

    HI Experts,
    issue- there is mandatory field in the screen, so, am using the folllowing code, system asking me to fillup the mandatory field.
    then, i used exit-command, but, still its asking me to fill the mandatory fiels???????????
    code is,
    process after input.
    ***Exit command
    module cancel at exit-command.
    module cancel.
    module user_command_9001.
    module cancel input.
    case: ok_code.
    when wa_con_back.
    clear ok_code.
    set screen 0.
    leave screen.
    when wa_con_exit.
    clear ok_code.
    set screen 0.
    leave screen.
    endcase.
    endmodule. " cancel INPUT
    thanq

    I am not sure but try making a specific module for your exit handling, for instance:
    module do_exit at exit-command.
    module cancel
    module user_command_9001.
    Hope it helps you,
    Bert

  • Using EXIT command b/w  IF and END IF

    I have below query in the code , could you let me know why exit is used b/w IF and END IF .
    for a in 1..siteuse_code.count()
    LOOP
    IF cust.site_use_code = siteuse_code(a)
    THEN v_valid_site_use := 'Y';
    exit;
    END IF;
    END LOOP;
    Thanks.

    931832 wrote:
    Alberto Faenza :
    But, what happens if siteuse_code has multiple values.
    if the first value satisfies the the condition, will it exit the LOOP ??
    if , Yes. what about remaining values in siteuse_code ?Simply the code will exit from the loop at the first element of the collection siteuse_code that is equal to cust.site_use_code and it will go through other elements of the collection.
    for a in 1..siteuse_code.count()
    LOOP
    IF cust.site_use_code = siteuse_code(a)
    THEN v_valid_site_use := 'Y';
    exit;
    END IF;
    END LOOP;
    {code}
    Suppose that you have 10 elements and the third satisifies the condition. The code will exit from the loop and a will have a value of 3.
    I hope it is clear.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • EXIT command behaviour in ABAP code?

    Hi Experts,
    Pls. let me clarify that, the behaviour of EXIT command, like,
    - in IF statement
    - in LOOP
    - in PERFORM/FORM
    -in DO
    thanq

    to exit out of the event blocks and the loops we will use exit command.
    see these links for more info.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9af135c111d1829f0000e829fbfe/content.htm
    terminating the loop using exit
    DO 10 TIMES.
      IF sy-index = 3.
        EXIT.
      ENDIF.
      WRITE sy-index.
    ENDDO.
    The list output is:
    1 2
    module exit input.
    if ok_code = 'REFR'.
    call transaction 'ZMEDEMP'.
    elseif ok_code = 'BACK'.
    set screen 0.
    leave to screen 0.
    elseif ok_code = 'EXIT'.
    leave program.
    endif.
    endmodule.
    For E.g
    AT EXIT-COMMAND code.
    In your flow logic, you create a module as so:
    MODULE md_exit_command AT EXIT-COMMAND.
    Then in PF-status, you configure the Cancel (red button on toolbar) as exit button by setting Type of button as 'E'. Put OKCODE as 'CANC'.
    Then, in the module
    MODULE md_xit_command INPUT.
    CASE OKCODE.
    WHEN 'CANC'. LEAVE TO SCREEN 0. ENDCASE.
    ENDMODULE.
    Also refer,
    AT Exit
    Reward points..

  • At selection-screen on exit-command

    hi to all  my querry is as  follows . pls tell what is the usse of
    at selection-screen on exit-command  event where do we  use it . can u pls give some sample coding . points will be rewarded definitely .

    Hi
    We use<b> exit-command </b> in Module pool programs to come out of the Program, without entering data in the madatory fields  on screen.
    We don't use exit commands for selection screens in Reports
    So you are asking this exit command for selection screens
    see the sample code for Module pools programs
    PROCESS AFTER INPUT.
    Forced Exit from the transaction
      MODULE exit AT EXIT-COMMAND.
    *&      Module  exit  INPUT
    Exit from the Transaction
    MODULE exit INPUT.
      CASE okcode.
        WHEN 'EXIT' OR 'CANCEL'.
          CLEAR okcode.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " exit  INPUT
    Reward points for useful Answers
    Regards
    Anji

  • How to use 'at selection screen on exit command'

    Hi,
    How do I use the above event in the following scenario.
    Scenario: I have a report program which has two radio buttons on the selection screen to which user command is assigned. On selection one, some fields should get disappeared on the selection screen. But one of the fields is a mandatory field, which doesn't allow to proceed unless we enter some value in that(which is redundant since anyway it will be disappearing).
    I thought 'on exit command' event works, but the user command assigned to the radio button is not of type E.
    Issuing a message at selection screen instead of making the field mandatory will work, but I don't want to do that.
    Can anyone please tell me how to handle this?
    Incorrect answers will be suitably punished.
    Thanks,
    Sumanth
    Edited by: Julius Bussche on Sep 26, 2009 12:40 PM
    Silly comment suitably modified.

    do not make that field mandatory using obligatory. so now your radio button work is done.
    now, how to make the field look like and work like mandatory field on execution:
    at selection-screen output.
    loop at screen.
       if screen-name = 'P_MAN'. " lets say this is the field which you want to make mandatory.
          screen-required = 2. "this will just  put a tick mark on the input , looks like mandatory.
       endif.
    endloop.
    now, how to check the mandatory option.
    at selection-screen.
    if p_man is initial.
      display your message to fill this.
    endif.
    hope this helps...
    and as per forum rules, kindly do not encourage people by talking about forum rules.

  • Using AT-EXIT command

    hi
    can any one tell me about AT- EXIT COMMAND
    i know that it will provide exit options for the fuctions of type 'E'
    if any others apart from this will be helpfull.
    vamsi

    <b>MODULE </b>
    Syntax
    MODULE mod [ <b>AT {EXIT-COMMAND</b>|CURSOR-SELECTION} ]
               [ ON {CHAIN-INPUT|CHAIN-REQUEST} ].
    <b>... AT EXIT-COMMAND </b>
    <b>Effect </b>
    Addition AT EXIT-COMMAND at the event PAI causes module mod to be called exactly if:
    The function used to trigger event PAI has function type "E"
    Into the input field of the standard toolbar, the user entered a character string starting with "E" and confirmed it using ENTER.
    The dialog module is called before the automatic input checks defined in the system or in the ABAP Dictionary and independent of its position in the event block. The only screen field transported to the ABAP program is the OK field. If the function that triggered the PAI event does not fulfill any of the above prerequisites, the MODULE statement is not executed.
    If several MODULE statements have the AT EXIT COMMAND addition, only the first one is executed. If no MODULE statement has the addition AT EXIT COMMAND, a normal PAI processing is executed: The predefined input checks are executed and then the PAI event block is processed sequentially. Provided the screen processing is not terminated in the dialog module mod, after the return from the dialog module, the complete PAI processing is executed. You must not use the addition AT EXIT COMMAND in connection with the statement FIELD.
    Note
    The function type of a function is determined in the Screen Painter or Menu Painter. Usually those functions of the user interface are defined with function type "E" that are assigned to the icons Back, Exit and Cancel in the standard toolbar of the GUI status. Therefore, the called dialog module should terminate the screen processing and allow security checks, if required.
    Regards,
    Pavan

  • Is it possible to add the exit command to a button in ALV OO toolbar

    Hi ABAP folks,
    is there are a way to add the exit command to a button of an ALV toolbar (like in the GUI status)?
    I want to prevent the field validations of a dynpro field at PAI.
    Thanks and regards,
    Martin

    Manage the event [TOOLBAR|http://help.sap.com/saphelp_erp2004/helpdata/en/ee/c8e07dd52611d2b468006094192fe3/frameset.htm] of CL_GUI_ALV_GRID.
    This event is triggered by the ALV each time the toolbar of the control needs to be regenerated. To add self-defined functions to the toolbar, you trigger the event using method set_toolbar_interactive and write an event handler method ( see also: Defining GUI Elements in the Toolbar).
    Look at demo BCALV_GRID_05.
    Regards,
    Raymond

  • Table T063O and the PAI delcare "MODULE paimodule AT EXIT-COMMAND.

    I have never declared a PAI module with the addition AT EXIT-COMMAND .
    And I never hope to have to do so.
    But if you want EXIT_SAPLIE01_007 to fire in MB02 like it fires in MIGO, you're gonna have to learn all about the "AT EXIT-COMMAND addition".
    And then, you're gonna have to learn about table T063O.
    And then, you're gonna have to try and remember who your IM configurator was or is.
    Reminds me of the old old big blue joke:
    "It's 10pm - do you know where your JCL is?".
    Anyway, do you think the "AT EXIT-COMMAND addition to PAI module declares is worth a blog?  If so, then I've got two blogs stored up that I can post in the future, because Gareth has already said that the *tablename blog is worth posting.
    djh

    Hi Rich -
    Yes - that's why I gave the flow of control through the various modules.
    You can't get to the user exit call in the lowest module UNLESS you type in a character string starting with "E" in the tcode/fcode box at the top of the screen (it doesn't have to be just an "E" - it can be any character string starting with E.)
    But note that the reason for T063O is to place a little more security on this process in the case of the various MB02 screens that have this feature.  The "E-initial" string that you type in to the tcode/fcode box has to be "pre-registered" in T063O - otherwise you get a message saying "Function Exxx not supported here"  (this is done by the second module down in the flow of control.)
    I can see why SAP did this - if it didn't have some control at the config level, then any consultant could "backdoor" an exit into MBO2 or MB03 and take home some really private data.  I also suspect this is why you can't maintain T063O in SM30 - it's probably a config function - I haven't ascertained this yet for sure.
    Finally, the only reason I happened to discover  what SAP was up to here is because I couldn't figure out why the same exit that's been working fine in MIGO didn't work at all in MB02 - it wasn't even called. And to figure this out I had to trace the flow of control backwards until I discovered the "E-string" logic and the "T0630" pre-registration logic in the top two PAI modules.
    So that's why SAP's use of this feature was a big surprise to me too - I also have never seen it and I've studied a fair amount of SAP standard code looking for exits and BADI interrupts.
    Best
    djh

  • Module exit at exit-command

    Hi all,
        While I am using MODULE EXIT AT EXIT-COMMAND
    its not working properly in module pool in PAI for the main screen.
    code tht  i m using for it is as follows.
    DATA : l_ans TYPE c.
    CLEAR ok_code.
    *ok_code = sy-ucomm.
    CASE ok_code.
       WHEN 'BACK' OR 'CANCEL' OR 'EXIT'.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              text_question  = 'Would you like to Quit ?'(004)
              text_button_1  = 'Yes'(005)
              text_button_2  = 'No'(006)
            IMPORTING
              answer         = l_ans
            EXCEPTIONS
              text_not_found = 1
              OTHERS         = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          CHECK l_ans = '1'.
          LEAVE PROGRAM.

    Hello Amit,
    Please check whether you have assigned Exit Command Type to your buttons or not; in order to do that, go to the specific screen->PF-Status->Choose any standard button(you have assigned)->double-click->Set FUNCTIONAL TYPE.
    E Exit Command (MODULE xxx AT EXIT-COMMAND)
    S System Function
    T Call a Transaction
       Normal Application Function
    P Local GUI Functions
    H Internal Use
    Moreover, Module set for this exit-command with screen, should be;
    In PAI;
    MODULE exit_scr100 AT EXIT-COMMAND.
    MODULE exit_scr100 INPUT.
      CASE ok_code.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.                                " CASE OK_CODE
    ENDMODULE.                            
    We use AT EXIT-COMMAND, when we want to cancel out the screen or exit the screen, despite errors. Otherwise, screen would hang-up asking for correcting errors.
    Hope it helps you,
    Zahack.

  • At exit-command

    Hi,
       I am using tabstrip scrolling in application server.
    i am using 3 tabs(3 subscreens).
       But When i am using module exit at-exit command. That module is not working.
      So if Click on exit button.it's checking all the validations then only exiting from the transaction..
    Help me to solve this problem.
    With Regards
    Feirthouse K.A

    Hi,
    From sap help:
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm
    <b>If the user chooses a function whose function code does not have type E, the MODULE <mod> AT EXIT-COMMAND statement is not executed.</b>
    sample code:
    This exit-command module looks like below.
    Module exitscreen input.
      Case v_okcode_100.
        When ‘EXIT’.
          Leave to screen 0.
        when ‘BACK’.
          Leave to screen 0.
        when ‘CANCEL’.
          Leave to screen 0.
      Endcase.
    Endmodule
    Hope this will help you.
    Cheers
    Sunny
    Rewrd points, if found helpful
    sorry : i didn't check that the thread is being answered.
    Message was edited by: Sunny

  • AT EXIT-COMMAND doesn't work

    Hi experts,
    In screen painter I use AT EXIT-COMMAND to exit current screen as the following code. But it doesn't exit the screen if ok_code = 'create' while other ok_code work well. Can anyone tell me that's why?
    Thanks!
    module exit.
      if SY-UCOMM = 'EXIT' or SY-UCOMM = 'BACK'.
        LEAVE PROGRAM.
      elseif SY-UCOMM = 'CLEAR' or SY-UCOMM = 'CREATE'.
        CALL SCREEN 100.
    endmodule.

    write this statement  in PAI
    and check weather sy-ucomm capturing the key r not
    MODULE EXIT.
      IF sy-ucomm = 'LEAV'
        SET SCREEN 0.
        LEAVE SCREEN.
      ENDIF.
    ENDMODULE.
    Regards
    Anbu B

  • What is AT Exit-Command in MPP

    Hi all
    What is AT Exit-Command in MPP...

    Hi rohini,
    The statement associated with at exit command is :
    MODULE <module_name> AT EXIT-COMMAND.
    Addition AT EXIT-COMMAND at the event PAI causes module <module_name> to be called exactly as if:
    a)The function used to trigger event PAI has function type "E"
    b )Into the input field of the standard toolbar, the user entered a character string starting with "E" and confirmed it using ENTER.
    The dialog module is called before the automatic input checks defined in the system or in the ABAP Dictionary and independent of its position in the event block. The only screen field transported to the ABAP program is the OK field. If the function that triggered the PAI event does not fulfill any of the above prerequisites, the MODULE statement is not executed.
    If several MODULE statements have the AT EXIT COMMAND addition, only the first one is executed. If no MODULE statement has the addition AT EXIT COMMAND, a normal PAI processing is executed: The predefined input checks are executed and then the PAI event block is processed sequentially. Provided the screen processing is not terminated in the dialog module mod, after the return from the dialog module, the complete PAI processing is executed. You must not use the addition AT EXIT COMMAND in connection with the statement FIELD.
    The function type of a function is determined in the Screen Painter or Menu Painter. Usually those functions of the user interface are defined with function type "E" that are assigned to the icons Back, Exit and Cancel in the standard toolbar of the GUI status. Therefore, the called dialog module should terminate the screen processing and allow security checks, if required.
    If you are talking about the on exit-command in report programming,
    then the statement associated with it is
    at selection-screen on exit-command.
    Effect
    This event is triggered if the user has called one of the functions Back, Exit or Cancel. In the event block, possible clean-up actions can be executed.

  • Calling SQL Loader using HOST command from Developer Forms 4.5

    I want to execute a set of code from D2K Forms 4.5 which has interfface with Client - OS ( In my case Windows NT/XP). I want to execute SQL Loader from Forms using Host Command and then after completion of that process, I want to do next transcations ( depending upond success of HOST/SQL Loader).
    How to achive this?
    I tried writing code like this ...
    l_vc_command := 'sqlldr73'
                        ||' USERID='||l_vc_username||'/'||l_vc_password||'@'||l_vc_connect_string
                        ||' CONTROL='||l_vc_filepath||'Upload.ctl'
                        ||' DATA='||LTRIM(RTRIM(l_vc_fileloc))
                        ||' LOG='||l_vc_filepath|| l_vc_log_file || '_' || l_dt_sysdate_str ||'.log'                    
                        ||' BAD='||l_vc_filepath|| l_vc_bad_file || '_' || l_dt_sysdate_str ||'.bad'
                        ||' DISCARD='||l_vc_filepath|| l_vc_discard_file || '_' || l_dt_sysdate_str ||'.dsc';
    HOST(l_vc_command,NO_PROMPT);
    After this command i want to do some other code execution. so even if it fails or success, next code is executed. How to control this?
    Please help..
    Regards,
    Milind

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

  • Calling SQL Loader from Forms 4.5 using HOST command in Win2000

    One of my forms calls SQL Loader 7.3 using HOST command to load a csv file onto the database(Oracle 7.3) under Windows 2000 platform.
    Only after sql loader finishes its operation the control should come to my form i.e. synchronous execution.
    As of now its running asynchronously.
    Is there any way to make it synchronous. If Not any other work arounds?
    Environment Details
    Forms [32 Bit] Version 4.5.10.6.0 (Production)
    Windows 2000 Operating System
    Oracle7 Release 7.3.2.3.2

    Forms6i running on W2000, Rdbms 8.1.7
    in Forms I added a button TEST,
    Trigger when-button-pressed : host('test.bat') ;
    in directory .......\frm I added file test.bat :
    REM ===============
    cd /d C:\........\ldr
    pause
    sqlldr parfile=test.par
    pause
    type test.log
    pause
    exit
    REM ================
    now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
    Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
    Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.

Maybe you are looking for

  • Regza LCD HDTV 52XF550U has wide black stripes on the right side

    Hi, my 2008 REGZA LCD 52XF550U has wide black stripes on the right side.  I think the problem started within 24 months from my purchase.  And the stripes are getting wider.  I have tried to reset the setup, power off and on, all to no avail.  See att

  • Splitting layer into RGB layers in a group - newbie

    I'm a newbie trying to split a selected layer into multiple layers, each with only one channel enabled. What I mean into the script below, I'd like to do that same thing I do manually by going into Layer Style, in Advanced blending where it has the C

  • 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

    i m trying to send the emails to some of the domains and i am getting the reply like this.................

  • What is it? how do I eliminate it?

    I'm still getting used to 10.4.x - have found one "new thing" which I don't need and want to eliminate. It's a "behavior" as follows: After a given length of time (reading a document, for instance), if I move my mouse - a "partial dock" appears which

  • Backup to Time Capsule stopped due to network problem

    I have been backing up for a month or so. Now my time capsule stopped backing up. I get the following error message: There was a problem connecting to the server "Time-Capsule.local". The server may not exist or it is unavailable at this time. Check