The problem with the return code of JOptionPane

I debug the follow code, when I press button No, return code is 0, but OpenXLSFile(ResultXSLName); executed, why?
the result is whether I press YES or NO, the if condition will be true
how to compare the return code?
          int open = JOptionPane.showConfirmDialog(null, "Do you want Open the result File \"" + ResultXSLName + "\" ?", "Confirm", JOptionPane.YES_NO_OPTION);
          if (JOptionPane.YES_OPTION == open);
               OpenXLSFile(ResultXSLName);
          }Edited by: Kevin.Tong on Feb 26, 2008 7:26 PM

the result is whether I press YES or NO, the if condition will be truethis line will execute
OpenXLSFile(ResultXSLName);regardless of the condition being true or false,
because the if statement terminates at the semi-colon
if (JOptionPane.YES_OPTION == open);<------------------

Similar Messages

  • Traport importing problem with repeating return code error 8

    Hi all,
    We are facing some transport import problem.When we sent transport initially AAA900244,they faced with return code error 8 and syntax error 109.As the information provided by the client,one of the include  program which is not availble at client system that was included in this transport.So that was the problem.Again we have taken  new  tranport AAA900247 without this include program then same type of error message they faced with return code error 8 and syntax error 109 in the include program when imported.
    I have one doubt, when importing new transport this should overwrite the earlier transport data.Why the same type error client is getting.What might be the reason.
    Is earlier transport  imported?? Why it throwing same type error.What actually the fuctionality of Return code 8 whether it is imported or discarded.
    Thanks in advance.
    Regards.....Balu

    Hi Ramesh,
    That include is not at all required at client system.So next time when we have taken transport we have not included this include program.They imported new transport without this include program.But they are facing same error as they faced first time. What could be reason??
    Regards...Balu

  • Getting the return code of an exec-called program

    I'm trying to simply call an .EXE (Win32 console-) application from LabView 5, which works fine with EXEC. The problem is, that I cannot query the return code of the program afterwards. (The error output is always 0, no matter what the program has returned.) Anyone knows a nice short solution to that? Thanks!

    Hi Ritter,
    Somehow I think I may be missing something.
    (after looking around)
    What version of LV are you using?
    I am guessing 5.1 or earlier.
    LV 6 EXEC has standard output available.
    If you are using LV 5.1.1 or so, I can only recomend the the re-directed solution.
    If file system is issue how about using a complete file spec starting with "c:"? Do you expect to be running on a machine that does not have a c drive?
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can we know the return code of BDC Program ?

    Hi All,
    Please tell me : How can we know the return code of BDC Program when being exceuted in Session or in Transaction mode.
    In my program, we are uploading data from Excel sheet to SAP via BDC
    The records that are not updated we want to create a log file.
    Now to know whether a record is updated ot not, wat syst field shloud be used?
    Its urgent....
    <b>Reward Point will be there ....</b>
    Thanks,
    Harish

    Hi harish,
    try the logic in this code ...
    i had attached input file in the end.
    TYPES: begin of errmess,
            msgnr type t100-msgnr,
            text type t100-text,
           end of errmess.
    TABLES : t100.
    DATA: BEGIN OF DD_VA01,
           AUART TYPE VBAK-AUART,
           KUNNR TYPE RV45A-KUNNR,
           BSTKD TYPE VBKD-BSTKD,
           MABNR TYPE RV45A-MABNR,
           KWMENG(2) type C,
           KBETR(2) type C,
          END OF DD_VA01.
    DATA:IT_VA01     Like TABLE OF DD_VA01,
         WA_VA01     Like LINE  OF IT_VA01,
         WA_VA01_F   Like LINE  OF IT_VA01,
         IT_BDCDATA  TYPE TABLE OF BDCDATA,
         WA_BDCDATA  Like Line  OF IT_BDCDATA,
         W_FNAME     TYPE STRING,
         messtab like bdcmsgcoll occurs 0 with header line,
         it_errmess type table of errmess,
         wa_errmess like line of it_errmess,
         err_message type string.
    data: zf1 type i,
          zc1 type c value '2',
          fn(20) type c.
    Main Code ************************************************************
    PERFORM get_input using 'C:\Documents and Settings\ic881592\Desktop\Daran_bdc_VA01-e.txt'.
    SORT IT_VA01 BY AUART KUNNR BSTKD.
    LOOP AT IT_VA01 INTO WA_VA01.
      if WA_VA01_F-AUART <> WA_VA01-AUART OR
         WA_VA01_F-KUNNR <> WA_VA01-KUNNR OR
         WA_VA01_F-BSTKD <> WA_VA01-BSTKD.
           PERFORM set_header_flag.
           PERFORM create_bdc_header_data.
      endif.
      PERFORM create_bdc_item_data.
    ENDLOOP.
    PERFORM call_transaction.
    PERFORM errorlog.
    Procedures ***********************************************************
    form get_input using w_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = W_FNAME
          HAS_FIELD_SEPARATOR = '#'
        TABLES
          DATA_TAB            = IT_VA01.
    endform.
    form call_transaction.
        PERFORM bdc_field       using 'BDC_OKCODE' '/11'.
        CALL TRANSACTION 'VA01' USING IT_BDCDATA MODE 'A' messages into messtab.
        refresh it_bdcdata.
    endform.
    FORM set_header_flag.
           WA_VA01_F-AUART = WA_VA01-AUART.
           WA_VA01_F-KUNNR = WA_VA01-KUNNR.
           WA_VA01_F-BSTKD = WA_VA01-BSTKD.
           if zf1 = 1.
               PERFORM call_transaction.
           endif.
           zf1 = 1.
    endform.   "set_header_flag.
    form create_bdc_header_data.
         perform bdc_dynpro      using 'SAPMV45A' '0101'.
         perform bdc_field       using 'VBAK-AUART' WA_VA01-AUART.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         perform bdc_field       using 'KUAGV-KUNNR' WA_VA01-KUNNR.
         perform bdc_field       using 'VBKD-BSTKD' WA_VA01-BSTKD.
         perform bdc_field       using 'BDC_OKCODE' '/00'.
         perform bdc_dynpro      using 'SAPMSSY0' '0120'.
         perform bdc_field       using 'BDC_CURSOR' '04/06'.
         perform bdc_field       using 'BDC_OKCODE' '=CHOO'.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    endform. "create_bdcdata
    FORM create_bdc_item_data.
         CONCATENATE 'RV45A-KWMENG(' zc1 ')' INTO FN.
         perform bdc_field       using 'BDC_CURSOR' FN.
         perform bdc_field       using FN WA_VA01-KWMENG.
         CONCATENATE 'KOMV-KBETR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-KBETR.
         CONCATENATE 'RV45A-MABNR(' zc1 ')' INTO FN.
         perform bdc_field       using FN WA_VA01-MABNR.
         perform bdc_dynpro      using 'SAPMV45A' '4001'.
         PERFORM bdc_field       USING 'BDC_OKCODE' '=POAN'.
    ENDFORM.
    form errorlog.
      LOOP AT MESSTAB .
        if MESSTAB-MSGNR = '311' or MESSTAB-MSGTYP = 'E'.
            SELECT SINGLE msgnr text FROM T100
                            into wa_errmess
                            WHERE SPRSL = MESSTAB-MSGSPRA
                              AND ARBGB = MESSTAB-MSGID
                              AND MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              err_message = wa_errmess-TEXT.
              IF err_message CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO err_message.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO err_message.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO err_message.
              ENDIF.
              CONDENSE err_message.
              WRITE: / MESSTAB-MSGTYP, err_message .
            ELSE.
              WRITE: / MESSTAB.
            ENDIF.
        endif.
      ENDLOOP.
    endform. "errorlog
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      WA_BDCDATA-PROGRAM  = PROGRAM.
      WA_BDCDATA-DYNPRO   = DYNPRO.
      WA_BDCDATA-DYNBEGIN = 'X'.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    FORM BDC_FIELD USING FNAM FVAL.
      WA_BDCDATA-FNAM = FNAM.
      WA_BDCDATA-FVAL = FVAL.
      APPEND WA_BDCDATA TO IT_BDCDATA.
      CLEAR  WA_BDCDATA.
    ENDFORM.
    input file :
    OR     2148     0001235     R-1162     8     17
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     6     25
    OR     2148     0001235     R-1162     4     12
    OR     2148     0001236     R-1162     3     12
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     1     25
    OR     2148     0001236     R-1162     7     12
    OR     2148     0001236     R-1161     8     30
    OR     2148     0001236     100-400     10     25
    OR     2148     0001235     R-1161     5     30
    OR     2148     0001235     100-400     2     25
    OR     2148     0001235     R-11621     3     12
    OR     2148     0001235     R-1161     2     30
    OR     2148     0001235     100-400     1     25
    OR     2148     0001235     R-1162     7     12
    OR     2148     0001235     R-1161     8     30
    OR     2148     0001235     100-400     10     25
    OR     2148     0001236     R-1162     8     17
    OR     2148     0001236     R-1161     2     30
    OR     2148     0001236     100-400     6     25
    OR     2148     0001236     R-1162     4     12
    OR     2148     0001236     R-1161     5     30
    OR     2148     0001236     100-400     2     25

  • How to generate the return code automatically through EP

    Hello all,
               I have created a transaction Iview and i am calling transaction SE16 to which i am passing application parameter as the table name which i want to see.Now i am getting the SE16 screen with the table name successfully passed on to the input field. But i want the Iview to process this screen also so that i dont have to press enter to see the next screen. i want this iview to process the SE16 screen directly and show me the next screen. I dont know how can i pass the return code parameter which will directly execute the table name entered in SE16 screen.suppose my table name is "ABC" and i have set the application parameter as DATABROWSE-TABLENAME=ABC&~okcode=ANZE where ANZE is the sy-ucomm value.Plz reply at the earliest.
    Thanks and regards,
    Alpa Desai.

    Madden wrote:
    I do think OOP can only complement procedural programming,Wrong. They don't have to have anything to do with each other.
    but I just wish for my app to exit the same way whether I return or not an exit code.
    I mean we are talking about the implementation, or the system, here.
    Simply let it end and the "return code" will be 0.
    But ... is there a way for a Java application to execute another Java application ? The analog for CreateProcess, but in the Java world ?Start a thread and call the main method of the class that kicks it off with the necessary arguements is one way.
    When an Java app executes another Java app will a new VM be created ?Runtime.getRuntime().exec() and call java ...... Which will, obviously, start a new VM.
    Is ther an internal way, for this that will work inside the same VM ?See the thread situation above.
    How will the parent get the exit code from the child ?If called with Runtime simply call System.exit and then (from the original program) evaluate the return code (see the Runtime and Process classes).
    If called in a thread, without using Runtime.exec any where, then you use a return at the end of the main method, but, if you are looking for a "return code" from an entire application, you're probably looking at Runtime.exec anyway. Otherwise, you are better of writing it so that it can be used in a real OOP manner (i.e. you don't have to call the main method of another application at all, you simply start instantiating and using the classes involved), in which case, a "return code" from the "application" is meaningless.
    >
    Timothy Madden,
    RomaniaEdited by: masijade. on Nov 19, 2007 10:18 AM

  • Choosing the Return code for a scenario

    Hi,
    I execute an ODI scenario "AAA" from Unix with the command startscen.sh
    Can I control the return code of called screnario?
    IN the scenario "AAA" (=package) i have different path with ko/ok. I would like to choose a specific return code for each ko path. Is it possible ?
    Thank you very much.
    Best regards,

    How you creating this file? Why you couldn't create without enter?
    But, however, see solution in that case:
    File 1.sql:
    select 1 from dual;File 2.sql:
    select 2/0 from dual;File 3.sql:
    select 3 from dual;File exec_sql.sql:
    WHENEVER SQLERROR EXIT
    @&1
    @&2
    @&3And you need to generate file as this "test.sql":
    define f1 = 1.sql
    define f2 = 2.sql
    define f3 = 3.sql
    @exec_sql &f1 &f2 &f3Regards,
    Malakshinov Sayan

  • How to retrieve the return code of the scenario execution

    Hi,
    I do see the return code in the execution tab of the scenarios..
    I need to use those values in a package.
    So how do i retrieve those value and use in a variable..?
    In which table, i find this value?
    Please respond as soona s possible. This is very critical for me.
    thanks,

    Yes, reference the Java API package oracle.odi.domain.runtime.session - this package contains classes for managing Oracle Data Integrator Sessions and related objects.
    In this package is the java class OdiSessionStepLog which has the method getReturnCode() which will do the same as the earlier substitution variable example

  • Table which stores the return codes

    Hi All
    I would like to know in which table the return codes for a BAPI get stored for the structure BAPIRET2.
    Thanks in advance
    Sree Ramya

    Hi sree,
    1. the return codes are nothing
       but standard messages of the transaction.
    2. such messages and their codes are stored in table T100.
    regards,
    amit m.

  • What does the return code 20 stands for in the Transport request log

    Hi,
    When we have retreived the Transport request log by using the Unix command, we have got return code 20.
    Please let us know what does the return code 20 stands for and under what scenerios I will get the return code 20.
    Thanks & Regards,
    Madhuri.

    chk the last return code in this link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/57/38e26c4eb711d182bf0000e829fbfe/content.htm

  • How can I get the return code of SQL*Plus under Win2000Pro

    How can I get the return code of SQL*Plus under Win2000Pro ?

    In a DOS batch script? Try ECHO %ERRORLEVEL%
    -- CJ

  • Java 2 runtime Environment setup failed with a return code of -1

    Hi!
    I have tried to install sdk 1_3_1_01 on Windows 2000 with ServicePack 2 and the error "Java 2 runtime Environment setup failed with a return code of -1" occured. As I saw, a lot of people has the problem but couldn't find a solution on this page!
    Please help !
    Me

    I've installed 1.3.1_01 on both W2K Workstation and Server, no problem. There's a bug report, but no workaround or solution.
    http://developer.java.sun.com/developer/bugParade/bugs/4412291.html
    and it's supposedly 'fixed' in 1.4.0 beta.
    http://java.sun.com/j2se/1.4/fixedbugs/fixedbugs-beta2.html
    You might try installing the beta version
    http://java.sun.com/j2se/

  • How do you carry out an event if a job finishes with a return code 4?

    Hi
    A job which would complete successfully in SAP via the SM36 scheduler completes with an 'Error' in Redwood CPS because there are errors within the spool and it ends with a return code 4.
    We don't want this to error in Redwood CPS, so we have set the return code mapping to Completed with entries of 0 and 4.
    I.e. whether or not there is an error in the spool, the job will complete successfully in Redwood CPS.
    However, we want to be alerted if there are errors in the spool.
    How do we do this? The manual says "A job can raise one or more events when the job gets a specific job status or return code" - where is this set? I can see on the 'Event' tab of a job definition you can raise an Event when the job enters a specific status, but I only want to raise an event (or carry out a step / send an email etc) if I get a return code 4 (none of the job statuses are relevant) - how can I do this?
    Thanks
    Ross

    Hi Anton
    Thanks for that. However, it's a bit more complicated...
    I have a job chain with 2 steps. Any one of the two steps can have an error in the spool which by default in Redwood CPS result in the job ending in status Error. I don't want this, as the second step should still run if the first step ran okay with with errors in the spool (but shouldn't run at all if the 1st step fails completely). I.e. setting 'on Error goto step 2' or having no dependancy at all is not what we want.
    Therefore, I set the return code mapping on Completed to return codes 0 and 4. I.e. if step 1 has an error in the spool (return code 4) it still ends as 'Completed' and step 2 runs.
    Our problem is that we want to be alerted if there is a return code 4 (error in the spool). I tried as you suggested by entering on the 'Raise Event' tab of the job chain to raise an event on status 'Error' with a return code of 4. But no event was raised. I think this is because the return code mapping is setting the status to 'Completed' (on return code 0 or 4) BEFORE the software checks the status; i.e. the status is actually 'Completed' (rc=4) and not 'Error' (rc=4) so an event is not raised.
    Ideally I want to set the Event to be raised on status 'Completed' with a return code 4 - but when I select 'Completed' the 'Error Code' box is greyed out.
    I.e. can't set this - I can only set on a generic 'Completed' and I don't want to raise a message if the status is Completed but the return code is 0....
    Any ideas??
    Ross

  • BPC5.1 - Data manager package to Stored proc with custom return codes

    Hi all,
    Does anyone have experience passing the return codes from a stored procedure back into the eData "view status" package progress or event log details?
    When my stored procedure throws errors, the offending SQL code shows up in the pacakge details, which is helpful. But what I'd really like is to structure my stored proc with return codes
    0 = everything's wonderful
    1 = invalid category / time combination
    2 = unauthorized
    3 = no data to process
    And then handle these codes as either "completed" "warning" or "error" in the package progress.
    And ideally, I'd like to put some meaningful message about the warnings & errors, directly into the log details, so the user can fix the problem themselves rather than ask the IT guy to trouble-shoot.
    Any tips? I've started playing with using the on-complete, on-success, on-failure routing of different tasks within the DTSX package (SQL 2005), but I'm just working on a trial-and-error basis right now. (With # of errors = # of trials.)
    Thanks,
    Tim

    In case anyone's interested, I've solved this by tracking my return codes as a package variable.
    Within the package, I have conditional logic moving from task to task, evaluating the return code to check for various conditions, and selecting which tasks to perform accordingly.
    In the last task, I run a final stored procedure which posts some data (completion time & status) to a custom transaction log table, and then if the return code is not zero, I script and execute some SQL which I know will throw a "fake" error. The SQL statement itself includes the key information I want the end user to see. For example
    Select InvalidEntitySelection [USEast1],TransactionID [12340]  from ThisTableDoesntExist
    Select UnauthorizedUser [Tim], TransactionID [12345] from ThisTableDoesntExist
    Select WorkStatusIsLocked [USEast1 Actual 2008], TransactionID [12345] from ThisTableDoesntExist
    It's not exactly elegant, but it gets the message across, which is all that I need. In this way, the end user sees that the package failed with an error, and when they look at the package details, they can see the problem. They can pass on the transaction ID to an administrator to look into the details, if they can't figure it out on their own.
    Sorin, I never managed to figure out how to use a VB task to send the information back to the user, plus force the package to end in an error. I'm sure there's a way to do so, but this seems to work for my requirement.
    I'm not entirely happy with the "fake error" approach, but I don't know if BPC has any support for "intentional" programming of errors in the DTS scripting toolset.
    Thanks,
    Tim

  • Document control failed due to error in [DOCMGR-CANCEL] with a return code

    i am getting this error while calceling the purchase order "Document control failed due to error in [DOCMGR-CANCEL] with a return code of [OTHER]. "
    I am doing the calcel like this
    Nav: buyer work centre --> order
    searche the po and then
    select order --> cancel then click GO button
    i gave the Reason as Cancel
    communication method: email
    Cancel Requisition: Yes
    Please help on this, its urgent.
    Thanks,
    Vijay.

    Hi Vijay,
    Check this MOS note.
    Cancelling A Standard Purchase Order In Buyer Work Center Results In Error [Docmgr-Cancel] With A Return Code [ID 1338826.1]
    Thanks
    -Arif.

  • Hello, i have a problem with this number code  213:19,  please help me!

    Hello, i have a problem with this number code  213:19,  please help me!

    dan
    What version of Premiere Elements and on what computer operating system is it running?
    If you are using Premiere Elements 13, have you updated it to 13.1 yet? If not, please do so using an opened project's Help Menu/Updates.
    What type of user account are you using....local administrator or domain type?
    Please review the following Adobe document on the 213.19 issue. Have you read that already?
    Error 213:19 | Problem has occurred with the licensing of this product
    ATR

Maybe you are looking for

  • How to use the property-loader?

    Hello, i´m using TS 3.5 and LV 8.0. Now i also want to use the built-in property-loader from Teststand. Is there somewhere a documentation for "beginners" how to use this property-loader? At the end i want to read parameters from an ascii-file which

  • Windows Install Help on custom built PC

    Yesterday I had posted some problems about not being able to get past the initial screen and entering the BIOS settings after building a PC.  I have successfully moved past that point and am now trying to install windows. I have read posts and done t

  • List of inbound deliveries with status of Inbound delivery

    Dear all, I need to get list of inbound deliveries with status of Inbound delivery. please let me know where can i get it. either table or tcode. also table would be helpful

  • Opening .wps documents

    I have received an email with an attachment which is a text document with the .wps file attachment. Is there any way to open it other than downloading third party software from the internet? It won't open in Pages, Preview or Text Edit.

  • Using JDO under BMP entity beans

    I have an entity bean that is a BMP which uses JDO under the hood. The Oc4J document says that "Bean-managed persistence entity beans manage the resource locking within the bean implementation themselves" in the advanced subject chapter. Ok can someo