RichDialog doesn't close with exception handling in DialogListener

I have a RichPopup with a child that is a RichDialog. The popup is called using a command button with a showPopupBehavior child.
I have a DialogListener on the RichDialog that calls a web service method through a proxy.
I added a try/catch block around the web service method call and then added a call to the FacesContext to add a message to display to the user. If there is an exception thrown from the service (simulated at this point) the message is displayed, but the screen is greyed out and the dialog will not close.
What am I missing?
Thanks,
Al
Message was edited by:
Al-2000

I don't think there are any examples, however something like this might do the trick:
---- Put this in your page ----
<f:verbatim>
<![CDATA[
<script>/*ignore the leading greater-than symbol that this forum adds to the start of this line*/
function closeMyPopup()
  var popup = AdfPage.PAGE.findComponent("myPopupClientId");
  popup.hide();
</script>
]]>
</f:verbatim>---- Put this in your Java code where you deal with the error ----
ExtendedRenderKitService erks =
  Service.getService(
    facesContext.getRenderKit(),
    ExtendedRenderKitService.class); 
erks.addScript(facesContext, "closeMyPopup();");See also the org.apache.myfaces.trinidad.render.ExtendedRenderKitService JavaDoc:
http://www.oracle.com/technology/products/adf/adffaces/11/doc/multiproject/adf-faces-api/apidocs/org/apache/myfaces/trinidad/render/ExtendedRenderKitService.html
Regards,
Matt

Similar Messages

  • Having troubles with exception handling

    Do you have Objective-C exception handling turned on?

    etresoft wrote:
    Den B. wrote:
    I'm sorry, but how do you do that?
    Double-click the project entry at the top of your Xcode file list.
    Click the Build tab
    Search for "exception"
    Yeah, I did this in the first place but I still can't catch that exception in the code block I posted above. In the console window they call it NSInvalidArgumentException but when I put it specifically into the @catch statement it doesn't want to compile...

  • Issue with exception Handling in GG

    Hi,
    I have bi-directional DML replication setup. I have written a code in replication parameter for handling the exception , Exception handling is working fine my replicate process is not getting ABENDED but Issue is I am not geeting any rows in EXCEPTION table.I had gone through replicat report, there I had seen GG is trying to inser duplicate records in EXCEPTION TABLE and it is failing because of that .
    **Command for create Exception Table is-**
    create table ggs_admin.exceptions (
    rep_name      varchar2(8) ,
    table_name      varchar2(61) ,
    errno      number ,
    dberrmsg      varchar2(4000) ,
    optype               varchar2(20) ,
    errtype           varchar2(20) ,
    logrba               number ,
    logposition          number ,
    committimestamp      timestamp,
    CONSTRAINT pk_exceptions PRIMARY KEY (logrba, logposition, committimestamp)
    USING INDEX
    TABLESPACE INDX1
    TABLESPACE dbdat1
    My replication parameter is-
    GGSCI (db) 1> view params rep2
    -- Replicator parameter file to apply changes
    REPLICAT rep2
    ASSUMETARGETDEFS
    USERID ggs_admin, PASSWORD ggs_admin
    DISCARDFILE /u01/app/oracle/product/gg/dirdat/rep2_discard.dsc, PURGE
    -- Start of the macro
    MACRO #exception_handler
    BEGIN
    , TARGET ggs_admin.exceptions
    , COLMAP ( rep_name = "REP2"
    , table_name = @GETENV ("GGHEADER", "TABLENAME")
    , errno = @GETENV ("LASTERR", "DBERRNUM")
    , dberrmsg = @GETENV ("LASTERR", "DBERRMSG")
    , optype = @GETENV ("LASTERR", "OPTYPE")
    , errtype = @GETENV ("LASTERR", "ERRTYPE")
    , logrba = @GETENV ("GGHEADER", "LOGRBA")
    , logposition = @GETENV ("GGHEADER", "LOGPOSITION")
    , committimestamp = @GETENV ("GGHEADER", "COMMITTIMESTAMP"))
    , INSERTALLRECORDS
    , EXCEPTIONSONLY;
    END;
    -- End of the macro
    REPERROR (DEFAULT, EXCEPTION)
    --REPERROR (-1, EXCEPTION)
    --REPERROR (-1403, EXCEPTION)
    MAP scr.order_items, TARGET scr.order_items;
    MAP scr.order_items #exception_handler();
    GGSCI (db) 2>view params rep2
    MAP resolved (entry scr.order_items):
    MAP "scr"."order_items" TARGET ggs_admin.exceptions , COLMAP ( rep_name = "REP2" , table_name = @GETENV ("GGHEADER", "TABLENAME") , errno = @GETENV ("LASTERR", "DB
    ERRNUM") , dberrmsg = @GETENV ("LASTERR", "DBERRMSG") , optype = @GETENV ("LASTERR", "OPTYPE") , errtype = @GETENV ("LASTERR", "ERRTYPE") , logrba = @GETENV ("GGHEADER"
    , "LOGRBA") , logposition = @GETENV ("GGHEADER", "LOGPOSITION") , committimestamp = @GETENV ("GGHEADER", "COMMITTIMESTAMP")) , INSERTALLRECORDS , EXCEPTIONSONLY;;
    Using the following key columns for target table GGS_ADMIN.EXCEPTIONS: LOGRBA, LOGPOSITION, COMMITTIMESTAMP.
    2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1403 mapping scr.order_items to scr.order_items OCI Error ORA-01403: no data found, SQL <DELETE FROM "scr"."order_items" WHERE "SUBSCRIBER_ID" = :b0>.
    2012-08-30 09:09:00 WARNING OGG-00869 OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EXCEPTIONS) violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("R
    EP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMESTAMP") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8).
    2012-08-30 09:09:00 WARNING OGG-01004 Aborted grouped transaction on 'GGS_ADMIN.EXCEPTIONS', Database error 1 (OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EX
    CEPTIONS) violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("REP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMES
    TAMP") VALUES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8)).
    2012-08-30 09:09:00 WARNING OGG-01003 Repositioning to rba 92383 in seqno 8.
    2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1403 mapping scr.order_items to scr.order_items OCI Error ORA-01403: no data found, SQL <DELETE FROM "scr"."order_items" WHERE "SUBSCRIBER_ID" = :b0>.
    2012-08-30 09:09:00 WARNING OGG-01154 SQL error 1 mapping scr.order_items to GGS_ADMIN.EXCEPTIONS OCI Error ORA-00001: unique constraint (GGS_ADMIN.PK_EXCEPTIONS)
    violated (status = 1). INSERT INTO "GGS_ADMIN"."EXCEPTIONS" ("REP_NAME","TABLE_NAME","ERRNO","DBERRMSG","OPTYPE","ERRTYPE","LOGRBA","LOGPOSITION","COMMITTIMESTAMP") VAL
    UES (:a0,:a1,:a2,:a3,:a4,:a5,:a6,:a7,:a8).
    2012-08-30 09:09:00 WARNING OGG-01003 Repositioning to rba 92383 in seqno 8.
    When I am running command
    select * from exceptions;
    no row selected.
    Please help. Why duplicat rows trying to insert in Exception table.

    Remove (disable) the constraint on the exceptions table and see if inserts will take place. Do you really need that primary key?

  • Multiple Idocs to XI with exception handling.

    Hi,
    I m doing a scenario,sending multiple idocs to file via XI.while doing dis,i m using BPM.For the BPM part i m following the blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2034..but [original link is broken] [original link is broken] [original link is broken] [original link is broken] wen i check in SXMB_MONI,my message isn't successfully processed out f BPM.In this,exception is triggered at d beginning.and it always throw exception and message not successfully processed out f BPM.In the workflow it is showing error in the first step and remaining steps are compIeted.Here, i m throwing exception by the use f deadline branch.Can,anybody tell me how to handle dis exception/error?

    Hi Rajeev,
    I am using a loop with in a block inside the BPM inside which receive step and container element is used.In parallel to loop branch,i m using deadline and exception branch same as in blog 2034.i m using infinite loop wid time limit mentioned in the deadline branch.After coming out f dis block,i m using transformation step and den send step is used.When i check in graphical workflow,i m getting error in send step stating that an empty container element is used while sending.But,wen i m checking technical workflow,i m getting error in first step after the creation of workflow and workflow started messages in the log details.after which the exception occured is shown in the workflow system..
    Thanks,
    Anoop Garg

  • Dynamic graphic in smartform with exception handle.

    Hi All,
    I have already created a graphic node in the PO Smartform which will display the buyer signature, i have uploaded some signatures graphics to the server and used the &PO-CREATED_BY& parameter in the general attributes of the node. The signature gets displayed fine if the graphic with the buyer's username as name exist.
    But what i'm looking for is: what to do if the graphic doesn't exist (the standard behavior is an error message and its not displaying the preview of the smartform). I would like to set a 'default' graphic (blank image) as the image is the user signature image doesn't exist, but i cannot find the place where i need to implement some logic to do that validation effort.
    I'll appreciate your comments rewarding points for useful answers.
    Regards,
    Gerardo.

    Hi,
    Check the table: STXBITMAPS for the graphics image what yuu are looking for.
    If it is existing, then write a SELECT query in code lines and store the value in a variable.
    [ Declare this in the Global definition part ].
    Then create a window to display the graphics image [ do not create a grpahics node] and add a ALTERNATIVE node.
    Here check the work area variable and put separate graphics in the True node and in the FALSE node.
    Hope this helps.
    Regards
    Subramanian

  • Pblm with exception handling

    when I enter an input 10a in the the dialogbox Enter monthly payment , it prompts me to enter a valid data. If I again enter 10a , actualy Enter valid data dialog box must be displayed.Instead it displays Enter monthly payment . Even if I enter 100 in Enter valid data dialog box, it again displays Enter monthly payment. I'v been try to fix this. Can anyone help me. Thanks
    import javax.swing.*;
    import java.text.*;
    public class TestTryCatch{
       public static void main(String[] args){
          String choice = "";
          boolean tryAgain = true;
          String string = "1";
          while (!(choice.equalsIgnoreCase("x"))){
                  while (tryAgain){
                       System.out.println("tryAgain before try :" + tryAgain);
                 try{
                         String paymentString = JOptionPane.showInputDialog(
                                                    null,
                                                         "Enter monthly payment: ",
                                                         "Future Value",
                                                     JOptionPane.PLAIN_MESSAGE);
                        double monthlyPayment = Double.parseDouble(paymentString);
                        //tryAgain = false;
                        paymentString = string;
                        monthlyPayment = Double.parseDouble(paymentString);
                        System.out.println("1");
                       /* Static method to validate monthlyPayment*/
                     if(monthlyPayment <=0)
                        validateMonthlyPayment(monthlyPayment);
                     String rateString = JOptionPane.showInputDialog(
                                             null,
                                             "Enter yearly interest rate: ",
                                             "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
                       double interestRate = Double.parseDouble(rateString);
                       //tryAgain=false;
                       System.out.println("2");
                         /* Static method to validate interestRate*/
                       interestRate = validateInterestRate(interestRate);
                       double monthlyInterestRate = interestRate/12/100;
                       String yearsString = JOptionPane.showInputDialog(
                                                 null,
                                                  "Enter number of years: ",
                                                  "Future Value",
                                               JOptionPane.PLAIN_MESSAGE);
                      int years = Integer.parseInt(yearsString);
                    years = validateYears(years);
                       int months = years * 12;
                       //tryAgain = false;
                       double futureValue = calculateFutureValue(monthlyPayment,
                                                                         months,
                                                                         monthlyInterestRate);
                         NumberFormat currency = NumberFormat.getCurrencyInstance();
                        NumberFormat percent = NumberFormat.getPercentInstance();
                        percent.setMinimumFractionDigits(2);
                        String message =
                                     "Monthly payment: " + currency.format(monthlyPayment) + "\n"
                                   + "Yearly interest rate: " + percent.format(interestRate/100) + "\n"
                                   + "Number of years: " +  years + "\n"
                                   + "Future value: " + currency.format(futureValue) + "\n\n"
                                   + "To continue, press Enter.\n"
                                   + "To exit, enter 'x': ";
                        choice = JOptionPane.showInputDialog(null,
                                                                      message,
                                                                     "Future Value",
                                                                     JOptionPane.PLAIN_MESSAGE);
                        System.out.println("choice is : " + choice);
                 } // end try loop
                    //tryAgain = false;
                       catch(NumberFormatException e){
                            string = JOptionPane.showInputDialog(
                                                              null,
                                                            "Enter a valid data: ",
                                                            "Future Value",
                                                          JOptionPane.PLAIN_MESSAGE);
                           /* String rateString = JOptionPane.showInputDialog(
                                                                  null,
                                                                 "Enter a valid interest rate: ",
                                                                 "Future Value",
                                                                JOptionPane.PLAIN_MESSAGE);
                           double validateRate = Double.parseDouble(rateString);
                           String yearsString = JOptionPane.showInputDialog(
                                                                   null,
                                                                  "Enter valid number of years " +"\n"+
                                                                  "between 0 to 100 : ",
                                                                  "Future Value",
                                                                  JOptionPane.PLAIN_MESSAGE);
                    int years = Integer.parseInt(yearsString);*/
                      } // end catch
                   }//end tryAgain
           } // end while loop
          System.exit(0);
       }//end main
       private static double calculateFutureValue(double monthlyPayment,
       int months, double interestRate){
          int i = 1;
          double futureValue = 0;
          while (i <= months) {
             futureValue = (futureValue + monthlyPayment) *
             (1 + interestRate);
             i++;
          return futureValue;
       } // end calculateFutureValue method
       private static void validateMonthlyPayment(double monthlyPayment){
          while(monthlyPayment <= 0) { // while loop to validate monthlyPayment
                  String paymentString = JOptionPane.showInputDialog(
                                                 null,
                                               "Enter a valid monthly payment: ",
                                               "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
                  monthlyPayment = Double.parseDouble(paymentString);
           } // end while loop monthlyPayment validation
       } // end validateMonthlyPayment
       private static double validateInterestRate(double validateRate){
          while(validateRate <= 0) { // while loop to validate interestrate
                  String rateString = JOptionPane.showInputDialog(
                                                null,
                                               "Enter a valid interest rate: ",
                                               "Future Value",
                                              JOptionPane.PLAIN_MESSAGE);
                  validateRate = Double.parseDouble(rateString);
          } // end while loop
          return validateRate;
       } // end validateInterestRate method
       private static int validateYears(int years){
              while(years <= 0 || years>= 100){
                  String yearsString = JOptionPane.showInputDialog(
                                                null,
                                               "Enter valid number of years " +"\n"+
                                               "between 0 to 100 : ",
                                               "Future Value",
                                             JOptionPane.PLAIN_MESSAGE);
             years = Integer.parseInt(yearsString);
          return years;
    }

    Too much code. Yo udon't need all that Swing stuff to see how to make this work.
    This works - see if you can adapt it:
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.IOException;
    public class TryAgainTester
        public static void main(String [] args)
            double payment      = 0.0;
            boolean tryAgain    = true;
            String entry        = "";
            while (tryAgain)
                try
                    System.out.print("Enter payment: ");
                    entry       = getString(System.in);
                    payment     = Double.parseDouble(entry);
                    tryAgain    = false;
                catch (NumberFormatException e)
                    System.err.println("Invalid entry: " + entry);
                    tryAgain = true;
                catch (Exception e)
                    e.printStackTrace();
            System.out.println("payment: " + payment);
        public static String getString(InputStream in) throws IOException
            String value = "";
            InputStreamReader isr = new InputStreamReader(in);
            BufferedReader br       = new BufferedReader(isr);
            value = br.readLine();
            return value;

  • Exception Handling with GUI

    Hi,
    I'm new to Java so I'm a little rusty with exception handling. Please help me with this portion of my code. I'm supposed to screen out the bad input by the user. The user has to enter a double value and not an illegal value, for example: 45ab would be unacceptable. I've tried this way but after entering a number, the program just exits. Thanks first for helping me out.
    import javax.swing.*;
    import java.io.*;
    import java.text.*;
    public class Circle {
    public static double readDouble() {
    boolean done = false;
    String s;
    double d=0;
    while (!done) {
    JOptionPane.showInputDialog("Enter a double : ");
    System.out.flush();
    try {
    BufferedReader in = new BufferedReader (
    new InputStreamReader(System.in));
    s = in.readLine();
    d = Double.parseDouble(s);
    d = new Double(s).doubleValue();
    done = true;
    }catch (IOException e){
    done = true;
    }catch (NumberFormatException e1){
    JOptionPane.showMessageDialog(null,"Error -- input a double -- Try again");
    return d;
    public static void area(){
    double radius1;
    double area;
    radius1 = readDouble();
    area = (radius1 * radius1) * Math.PI;
    // Rounding the area value to 2 decimal places
    NumberFormat nf = NumberFormat.getNumberInstance();
    nf.setMaximumFractionDigits(2);
    JOptionPane.showMessageDialog(null, "The area is " + nf.format(area));
    // There are more code after this.

    Hello, I quickly wrote a possible solution to your problem, hope it will help you. (ICQ #28985387)
    import javax.swing.*;
    public class InputExample {
    public static double getDouble() {
    String input;
    do {
    input = JOptionPane.showInputDialog(null, "Enter a double", "Input", JOptionPane.QUESTION_MESSAGE);
    } while(!validateDouble(input));
    return Double.parseDouble(input);
    private static boolean validateDouble(String input) {
    double num = 0;
    try {
    if(input.length() == 0) {
    JOptionPane.showMessageDialog(null, "Please enter a value", "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    num = Double.parseDouble(input);
    } catch(NullPointerException exception) {
    System.exit(0);
    } catch(NumberFormatException exception) {
    JOptionPane.showMessageDialog(null, "Not a double", "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    if (num < -Double.MAX_VALUE || Double.MAX_VALUE < num) {
    JOptionPane.showMessageDialog(null, "Must be between\n" + (-Double.MAX_VALUE) + "\nand " + Double.MAX_VALUE, "Warning", JOptionPane.WARNING_MESSAGE);
    return false;
    return true;
    }

  • Exception handling branch not executing in BPM

    Hi all,
    We have a problem with exception handling in BPMs.
    We have created an exception branch in a block and a transformation step in it.  However, the branch doesn't get executed in case of exceptions.
    Any ideas?  Is this a known problem?
    Many thanks,
    Aldo

    Hi VJ,
    The exception name can only be selected from a list.  There is no chance of mistaking/misspelling in there.
    That is fine as it is.  I am quite sure about it.
    Any other ideas?
    I found SAP note 1039330 but we are already on patch 12 and that correction was released on patch 12.
    Thanks, regards,
    Aldo

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

  • Exception handling in client proxy

    Hi
    Can someone please help me with exception handling in ABAP client proxy.

    HI
      Welcome to SDN
    Check this link you wil get information regarding ABAP Proxy  http://help.sap.com/saphelp_nw04/helpdata/en/c9/74246d8ad2447799063d39013e9a11/content.htm

  • Exception handling in App. package PeopleCode

    Hi,
    I am accessing a table that is on remote database using DBLink for an update/insert operation using SQLExec. I am trying to implement exception handling to account for the scenario where the remote database is offline so that transaction can continue. However when I use the try-catch block in the app. package PeopleCode somehow the processing does not seem to move forward from the error. The App. pacakage code is triggered by the handler of the service operation. The goal is to simply skip the SQLExec if the table is not available. I am not sure if there is any limitation to the fatal SQL errors which the try-catch can handle.
    As expected i get below error when running select on a view which has remote table in the SQL developer as remote database is down.
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    Has anyone enconutered similar issue with exception handling and best way to move forward in this scenario.
    Any response is much appreciated.
    Thanks,
    Gireesh

    I did this with PL/SQL once. Basically, you want to know if the remote database is available before you execute SQL against it. Here is my function. You can then SQLExec something like select 'x' from dual where my_package.link_available('the_link_name') = 1. If you get a result, then the db link is active. If you don't, it is not active.
    FUNCTION LINK_AVAILABLE(pv_name VARCHAR2)
      RETURN NUMBER AS
            lv_result PLS_INTEGER;
            lv_name   VARCHAR2(128);
        BEGIN
            lv_name := UPPER(pv_name);
            -- parameter check to avoid SQL injection with dynamic SQL below
            -- if the following selects no rows, it will fall through to exception
            -- and return 0;
            SELECT 1
              INTO lv_result
              FROM ALL_DB_LINKS
             WHERE DB_LINK = lv_name;
            -- if we made it this far, then the parameter was a valid db link name
            -- execute SQL to test
            EXECUTE IMMEDIATE 'SELECT 1 FROM PS_INSTALLATION@' || lv_name INTO lv_result;
            RETURN lv_result;
        EXCEPTION
            WHEN OTHERS THEN
                RETURN 0;
      END LINK_AVAILABLE;

  • Gnome-appearances doesn't close, consumes 100% CPU

    I can open and work with gnome-appearances fine, however after closing the gui I find that gnome-appearances is still running and consuming around 100% of one CPU. So I have to kill it manually.
    While running, gnome-appearances is consuming 100% of one CPU, which seems a bit odd but the fact that it doesn't close with the gui is my issue.
    I get no error messages when running from the command line.
    Has anyone else encountered this problem?
    I'm using GNOME appearance 2.20.3
    Thanks

    I'm thinking it is an issue related to the gtk themes. I tried changing the window control theme in xfce earlier today and noticed the same spike in CPU usage (w/o the lingering after closing though).
    Also, while I had gnome installed I was unable to change to a gnome style window control (e.g., mist, industrial, etc.) in xfce. After uninstalling gnome, I can now use those gtk themes in xfce.
    Need to look into this some more.
    edit:
    It seems the spike in CPU usage while changing the window control theme in xfce occurs only when firefox is running. Which makes some sense, although I don't remember that ever being an issue before.
    Last edited by kr22 (2008-01-27 01:57:02)

  • Understanding Exception handler activity

    All,
    I created 2 view activities in my adfc-config.xml and established a navigation flow between them. The flow happens on click of a button on view1. I have defined an exception handler activity to show unhanded error that may arise. On click of the button in the view1, AM IMPL methods gets called and this is the code
        public void newPage(){
            int k = 5/0; //expecting the error handler activity to get invoked here   
        } When i click on the button, i get the exception however the page associated with exception handler is not getting invoked. I want the exception handler page to be shown for error and not the default popups. How do we do that?
    thnks
    Jdev 11.1.1.5

    No, this is only one possibility...
    checkout Andrejus blog about exception handling http://andrejusb-samples.blogspot.com/2011/03/jdevadf-sample-exception-handler-for_19.html and of cause the docs http://download.oracle.com/docs/cd/E24382_01/web.1112/e16182/taskflows_complex.htm#BACJCBIC
    Timo

  • Exception handler activity doesn't execute

    I have an exception handler in my bounded task flow but it not always executes when an error is raised by some of the BTF activities.
    In my application I'm having a problem with connections closed.
    I don't know if the database, the firewall or who is closing connections but sometimes I get an error in the logs "oracle.jbo.JboException: JBO-29000: Se ha obtenido una excepción inesperada: java.sql.SQLRecoverableException, mensaje=Conexión cerrada" translation "oracle.jbo.JboException: JBO-29000: Un unexpected exception has been raised: java.sql.SQLRecoverableException, message=Closed connection".
    That is bothering me specially because my task flow continues execution despite of the error. ADF opens the connection and then continues execution. This is fatal because previous updating in the entity objects is lost and the consequence is very bad.
    Well, I have tried to insert an exception handler in my task flow in order to capture this errors and then stop execution of the task flow.
    Currently, I'm more upset because of task flow continues execution after the connection closed error that for the error itself.
    The problem is that sometimes the connection closed appears in the log window but the exception handler is not executed. Sometimes yes, some others no.
    In order to test I'm forcing the error manually killing the sessions in the server.
    Any help for any of both problems ? (1- BTF continuing execution after this error raising and 2-Why the exception handler doesn't always execute when a java error stack appears in the log window).
    Thank you.

    this might be caused by a bug I found too causing eventhandlers not to work, the work round in your case would be:
    blar blar blar
    </variables>
    <!-- start work round --><scope><!-- end work round -->
    <faultHandlers>
    blar blar blar
    blar blar blar
    </sequence>
    <!-- start work round --></scope><!-- end work round -->
    </process>
    i.e. what I'm saying is that top level handler don't work since they are ignored by the engine because they are not in a scope. Try it and see....

  • GP Exception handling doesn't work

    I had implemented the GP Exception handling scenario described in [Configuring Exception Handling|http://help.sap.com/saphelp_nw2004s/helpdata/en/44/10bd4029450d1be10000000a114a6b/frameset.htm].
    But when I start the process and input a wrong user id, the exception handling action doesn't start and the process keep in running status. When I check the Background Action Processor Queue, the queue entry of action "Retrieve User Details" retry executing continously.
    And when I check the background callable object, it report that "Obsolete process exception: E_NO_USER_FOUND  " in section Process Exceptions Check .
    Is it a system bug or Is something wrong in system configuration?
    BTW: The environment is NW7.0 SP13 Java Stack

    Reposting

Maybe you are looking for

  • Problem in installation of oracle11g on vista home premium 32 bit.

    when i am installing oracle 11g it is showing following error message: Output generated from configuration assistant "Oracle Net Configuration Assistant": Command = C:\Windows\system32\cmd /c call F:\app\ishaan arora\product\11.1.0\db_1/bin/netca.bat

  • Error -50: Unable to Prepare Project for Publishing

    Please advise on what to do when this error appears: "The project could not be prepared for publishing because an error occurred. (-50)" I checked and Time Machine is turned off. Any advise appreciated.

  • Creation Of SAP PM WO

    Hi , Is that possible to create SAP PM Work Order from SAP SD order in IS - U? What will be the trigger points for this? Thanks & Regards, VEER

  • Free Hard Drive Space on a new MB

    I'm about to get a Black MB and was wondering how much of the hard drive is being used with programes and the OS and how much free space can i expect?

  • Desktop Manager Install Error 1904, nothing resolves...

    I have been having the following problem the last few days.  On my work desktop (WinXP x64) I installed the DesktopManager software without hitch, but on my home desktop (WinXP Pro SP3) I also keep getting the error message: Error 1904.Module C:...GW