Code that Runs for All Exceptions

I have PL/SQL code that I want to run for any exception that I might encounter in a given block of code.  Basically, this code resets a package variable that was set earlier in the block.  So if my block is running and it encounters an exception, I want to reset the package variable, no matter what the exception.
So do I need to run this reset code under every possible WHEN clause to be sure that I've hit all the possibilities?
I think I can probably create a nested block that raises the error into the main block so that the main block can have just a single WHEN OTHERS clause, wherein I can execute my single reset statement; however, this seems like overkill.  Is there any simpler way to do this?
Thanks for any help you can give.
Wayne

Hi, Wayne,
201cbc0d-57b2-483a-89f5-cd8043d0c04b wrote:
I have PL/SQL code that I want to run for any exception that I might encounter in a given block of code.  ...
That's a good way to get into a lot of trouble.  That's kind of like saying "My daughter is supposed to be home from school by 4:00.  If she's not, ignore it and keep working."
Your code should check for mistakes that you expect will happen (e.g., no data in a table, an invalid DATE, or a string in the wrong format).  Sometimes, an EXCEPTION handler is a good way to check for those expected errors.  But if anything that is not expected happens, you ought to know about it.

Similar Messages

  • Schedule a Webi XIR2 report to run for all values of the prompt ...

    Hi there,
    Any ideea about if it's possible to schedule a Web Intelligence XIR2 report to automatically run for all  150 different prompt values in the LOV (and have 150 different instances)?
    BOXIR2, Java deployment.
    Many thanks.

    You'd be scheduling the document 150 different times, each for one value of the LOV.
    You'd use the ReportEngine (REBean) SDK to read the LOV values, then use the Enterprise SDK to schedule.
    Here's a bit of code that illustrates how to schedule a Webi doc a single time with specified prompts.  You'd do something similar, but iterate the prompt setting and scheduling:
        IInfoStore iStore  = (IInfoStore) eSession.getService("InfoStore");
        ReportEngine reportEngine =  ((ReportEngines) eSession.getService("ReportEngines"))
                                        .getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
        IInfoObjects objs = iStore.query("Select TOP 1 * From CI_INFOOBJECTS Where "
                                          + " SI_KIND='Webi' And SI_INSTANCE=0 "
                                          + " And SI_NAME = '" + reportName + "'");
        //============================================================================
        // Open Webi document, then get and set Prompts collection
        //============================================================================
        IWebi            webi    = (IWebi) objs.get(0);
        DocumentInstance di      = reportEngine.openDocument(webi.getID());
        Prompts          prompts = di.getPrompts();
        for(int i = 0, m = prompts.getCount() ; i < m ; i++) {
            Prompt prompt = prompts.getItem(i);
            String name   = prompt.getName();
            if("Enter value(s) for State:".equals(name)) {
                Lov lov = prompt.getLOV();
                lov.refresh();
                Values values = lov.getAllValues();
                prompt.enterValues(new ValueFromLov[] { values.getValueFromLov(0),
                                                        values.getValueFromLov(1)});
            } else if ("Enter Shop Id:".equals(name)) {
                prompt.enterValues(new String[] { "261" });
        //===========================================================================
        // Copy prompts over to InfoObject
        //===========================================================================
        PromptsUtil.populateWebiPrompts(prompts, webi);
        //===========================================================================
        // Schedule Webi report to run once now
        //===========================================================================
        webi.getWebiFormatOptions().setFormat(IWebiFormatOptions.CeWebiFormat.Webi);
        ISchedulingInfo schedInfo = webi.getSchedulingInfo();
        schedInfo.setRightNow(true);
        schedInfo.setType(CeScheduleType.ONCE);
        iStore.schedule(objs);
    Sincerely,
    Ted Ueda

  • Costing Run for all Hub Plants

    I just want to understand from you regarding your Monthly Costing Run for all Plants.Actually we have Plant 5000 (Ruwais) which is our Manufacturing Plant having BOM.
    We have two other Plants 7000 ( Shanghai ) and 7100 ( Singapore ) these are our Hub Plants not Manufacturing Plants and having no BOMs. 
    When we run our Monthly Costing Run for Plant 5000 using TCode (CK40N), it’s completes smoothly without any error.
    We have to create a material cost estimate in monthly basis using TCode (KKPAN) before we execute cost estimate for both Plants 7000 & 7100.
    We see these runs at the months end as very time consuming and we are not manage on time set for such update in SAP as part of the month end procedure.

    Hello Yasir,
    In our system I see that PC01 and PC02 are the same for cross plant costing:
    1 - Future Cost Estimate - valid for fiscal year
    2 - Current Cost Estimate - no age restriction
    3 - Previous Cost estimate - no age restriction
    If your system is set this way, then for cross plant costing, it does not make a difference which one you use.
    If all plants are in one company code then the currency should be the same in all, so P rate should not be an issue.
    Take one part number: What period and FY is your current cost estimate? What are the validity dates?
    go to CK11n, input the part number; <b>hub plant</b> number and create cost estimate.
    On the Tab "QTY STRUCT."  you should see only Special procurement data, the plant number should be the mfg plant.
    Look at the Costing Structure.  Top level should be the part in hub plant.
    The first level below should be the part in the mfg plant.
    theTosts should be the same and I would expect it to be the same as the current cost estimate.  (Pay attention to the currency)
    If the first level from the mfg plant is not the same as the current cost estimate, you will need to figure out where that cost estimate is coming from.
    If you would like to send screen shots of your cost estimate screens, give me your e-mail and I will contact you with pictures of what I expect to see.
    Althea

  • How to avoid report running for all the values in roll up of guided naviga

    Hi
    Thanks in Advance
    I have 3 reports on three different pages of a dashboard. (Implemented guided navigation on one column of each report).When I click on value of guided navigation column it guides me to report 2 for that particular value (is prompted), same way for 3 report also till here it works fine.
    However when I return from report 3 to report 2 and 2 to 1, the reports are running for all the values instead for the value which was passed by guided navigation of previous report earlier (Value on which I clicked to pass to the next report).
    Edited by: 808623 on Nov 9, 2010 2:10 AM

    Yes
    Example : If i click on values 'X' in report 1
    Report 2 shows results for 'X' only. And if i click on Value say 'Y' in 2 then report 3 shows for only 'Y'. But when i rollup from 3 to 2, Report 2 is showing for all values rather than showing 'x'.
    I'm using Link or Image Dashboard Object > Destination>Request or Dashboard (path of previous report)
    Edited by: 808623 on Nov 9, 2010 2:37 AM

  • SAP VIM Integrated Invoice Cockpit - single default layout variant for all exceptions

    Dear all,
    I hope some one has found the solution for this problem we are experiencing in SAP Vendor Invoice Management 600:
    For the Integrated Invoice Cockpit ( transaction /OPT/VIM_IIC ) we want to be able to define ONE global layout variant ( available for all users)  that is available for all exceptions in  the ICC. This so we only have to define and maintain one layout variant centrally.
    However this seems not possible: we tried to do so with the  transaction /OPT/VIM_EIIC_ADM  but  it appears that it is only possible to define global layout variants for each exception in the ICC separately ( which is a lot of maintenance work)
    Is there a solution available for this ?
    Many thanks in advance for your help.
    Kind Regards,
    Arjan

    Dear all,
    I hope some one has found the solution for this problem we are experiencing in SAP Vendor Invoice Management 600:
    For the Integrated Invoice Cockpit ( transaction /OPT/VIM_IIC ) we want to be able to define ONE global layout variant ( available for all users)  that is available for all exceptions in  the ICC. This so we only have to define and maintain one layout variant centrally.
    However this seems not possible: we tried to do so with the  transaction /OPT/VIM_EIIC_ADM  but  it appears that it is only possible to define global layout variants for each exception in the ICC separately ( which is a lot of maintenance work)
    Is there a solution available for this ?
    Many thanks in advance for your help.
    Kind Regards,
    Arjan

  • Return code (SY-SUBRC) for the EXCEPTION will not be processed

    Hi,
    when I was doing the EPC check i have approached this messgae.
    Return code (SY-SUBRC) for the EXCEPTION will not be processed after CALL FUNCTION
    'CU_READ_RGDIR'
    (You can turn off this check by setting all EXCEPTIONS to 0)
    (The message can be hidden with "#EC *)
    Any pointers on how to handle this.
    Regards
    Rohini.

    Hi Rohini,
    Try doing something like this.
    TYPE-POOLS: hrpay.
    DATA: w_pernr              TYPE          p0000-pernr ,
          w_buffer             TYPE          hrpay_buffer,
          w_no_authority_check TYPE          xfeld       ,
          w_molga              TYPE          t500l-molga ,
          t_in_rgdir           TYPE TABLE OF pc261.
    CALL FUNCTION 'CU_READ_RGDIR'
      EXPORTING
        persnr             = w_pernr
        buffer             = w_buffer
        no_authority_check = w_no_authority_check
      IMPORTING
        molga              = w_molga
      TABLES
        in_rgdir           = t_in_rgdir
      EXCEPTIONS
        OTHERS             = 0.

  • Function module that runs for every info package

    Hi,
    Please can you give me name of function module that runs for every info package irrespective of data source.
    Cheers,
    Reddy.

    use below function module
    RSSM_SDL_START_INFOPACKAGE

  • Would like help with treeset ,the codes that using for sorting, please ?

    hi every body. i faced a problem while writing this program, everything worked properly except this one. The program is related to Jframe and it asks the user to add three labels , three text field , one text area and three Jbuttons which are add sort and exit. i could deal with add and exit but sort, i couldn't do it properly because i don't know the codes that should be added in actionperfomed?
    These codes are :
    package gui;
    import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import java.awt.Rectangle;
    import java.util.ArrayList;
    import javax.swing.JButton;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    import sun.misc.Sort;
    import domain.Student;
    public class StudentFrame extends JFrame {
          * This method initializes btnAdd     
          * @return javax.swing.JButton     
         private JButton getBtnAdd() {
              if (btnAdd == null) {
                   btnAdd = new JButton();
                   btnAdd.setBounds(new Rectangle(13, 135, 59, 27));
                   btnAdd.setText("Add");
                   btnAdd.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                        btnAddClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnAdd;
         protected void btnAddClicked() {
              // TODO Auto-generated method stub
         String name = txtName.getText();
         String id = txtID.getText();
         String age = txtAge.getText();
         Student s = new Student(name , id , age);
         txtArea.setText(String.valueOf(s ));
          * This method initializes btnSort     
          * @return javax.swing.JButton     
         private JButton getBtnSort() {
              if (btnSort == null) {
                   btnSort = new JButton();
                   btnSort.setBounds(new Rectangle(95, 136, 62, 25));
                   btnSort.setText("Sort");
                   btnSort.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             btnSortClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnSort;
         protected void btnSortClicked() {
              // TODO Auto-generated method stub
          * This method initializes btnExit     
          * @return javax.swing.JButton     
         private JButton getBtnExit() {
              if (btnExit == null) {
                   btnExit = new JButton();
                   btnExit.setBounds(new Rectangle(173, 134, 61, 23));
                   btnExit.setText("Exit");
                   btnExit.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             System.exit(0); // TODO Auto-generated Event stub actionPerformed()
              return btnExit;
          * This method initializes txtName     
          * @return javax.swing.JTextField     
         private JTextField getTxtName() {
              if (txtName == null) {
                   txtName = new JTextField();
                   txtName.setBounds(new Rectangle(79, 11, 60, 23));
              return txtName;
          * This method initializes txtID     
          * @return javax.swing.JTextField     
         private JTextField getTxtID() {
              if (txtID == null) {
                   txtID = new JTextField();
                   txtID.setBounds(new Rectangle(73, 55, 65, 26));
              return txtID;
          * This method initializes txtAge     
          * @return javax.swing.JTextField     
         private JTextField getTxtAge() {
              if (txtAge == null) {
                   txtAge = new JTextField();
                   txtAge.setBounds(new Rectangle(74, 96, 61, 24));
              return txtAge;
          * This method initializes txtArea     
          * @return javax.swing.JTextArea     
         private JTextArea getTxtArea() {
              if (txtArea == null) {
                   txtArea = new JTextArea();
                   txtArea.setBounds(new Rectangle(138, 5, 154, 128));
              return txtArea;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        StudentFrame thisClass = new StudentFrame();
                        thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        thisClass.setVisible(true);
          * This is the default constructor
         public StudentFrame() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
              return jContentPane;
    }Edited by: hypocrisy on Apr 26, 2009 6:51 PM

    There are three actionPerformed in that program.One for add Jbutton , Sort , and Exit
    the codes that i have added for add button after action performed are
    String name = txtName.getText();
    String id = txtID.getText();
    String age = txtAge.getText();
    Student s = new Student ( name , id , age);
    System.out.println(s);
    the codes for Exit button to make it works properly was :
    System.out.println(0);
    But when i came to Sort Button and i tried to enter many codes but it didn't sort properly so would you like to help me with the right codes :)

  • How to create a JavaMe library that runs on all devices?

    I have the Java ME 3.0 SDK. If I start a Java ME project (Midlet) I have to choose a device that I'm developing for. While I want to create an 'Engine' library that runs on any device. This library won't use any device specific libraries. So if I make different midlets for different devices they can all use the same generic 'Engine' library.
    I've googled a lot on this already and did quite some reading in the documentation of Java ME but didn't find any info on how to do this. I found a way to convert Java projects to midlets with the J2ME plugin for eclipse, but then I'd have to reconvert my Engine project to midlets for every device I want to support every time I make a change in the code of my 'Engine' library.
    Edited by: user8973897 on 23-feb-2011 4:42

    You can find some information here I guess:
    http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S
    http://www.c-sharpcorner.com/uploadfile/anavijai/custom-timer-job-in-sharepoint-2010/
    http://blogs.msdn.com/b/guruketepalli/archive/2012/01/23/sharepoint-2010-custom-timer-job-send-an-email.aspx
    ***If my post is answer for your query please mark as answer***
    ***If my answer is helpful please vote ***

  • Sale Order MRP Run for All Order Line Items

    Greetings...
                     I have One Sales Order , in which i have ten different Line Items .
    Now I have to Run the MRP on basis of Created sales Order so that all Line items wi get consider insingle MRP Run on sales order base MRP Run.
    How to take MRP Run of One Sale Order for all Line Items.???
    In MD50 , we can have sales Order with Item..

    In MD50 you can give only one item at a time.
    Its a standard transaction meant to accomodate changes relevant for MRP after plant level MRP run  related to specific sales order Item.
    so either you need to do it multipal times by changing material or you need to go for MD02.
    Please explain bussiness case in detail why you want to restrict your MRP run for items in a specific sales order.
    Regards

  • Reg: MRP Run for all Materials

    Hi Abapers,
    I have an issue where in using MD01( Material Run), i need to raise one PR for all materials below the re-order stock. Currently system creates one PR for each material below the re-order stock.
    Please throw any ideas regarding this.
    Thank you

    Hi ,
    to procure assembly take 10 days.
    And delivery date is after 2 days
    After MRP run , system will take first backward schedulling from delivery date will take 2 days and going forward scheduling and take 8 days .
    So that from current date system will take 10 days so assembly will procure easily .
    Suppose today date 19/05/2011. And delivery date is after 2 days .( on date 21/05/2011 )
    if MRP is run on 19/05/2011. System will create delivery date 29/05/2011.So assembly will be easily procure within span of 10 days from 19/05/2011 to 29/05/2011. Delivery of FG is easily available on 29/05/2011.
    Regards
    Vinod

  • EZT Codes mass change for all products

    Hello all,
    Currently I only find a way to change the EZT codes (european customs tariff), like Y900, for every single product in GTS (customs products).
    Is there a possibility to change the EZT Code Y900 for all products in the system?
    BR

    Hi Jörg,
    Your example is interesting, and maybe leads to further discussion...
    As far as I know, the 'Y900' code is not changing, so is your requirement to change the entries only theoretical, or do you want to delete the entries due to mistakes?
    Could you consider proposing the 'Y900' (or other) document using the Data Proposal mechanism, perhaps based on the Tariff Code, rather than maintaining the document in all Products?
    I can see that SAP have provided a Function Module /SAPSLL/PRDOC_FAE_SELECT that allows you to find all Products that have particular documents assigned.  Perhaps that could help your developer if you decide to create a maintenance program?
    Let us know if you need further assistance or sympathy with this :-)
    Regards,
    Dave

  • Attr changes runs for  all Infoobject in a process chain

    Hi,
    I have a process chain for the master data ( ATTR, TEXT and HIER),I want a Hierarchy/attribute change run like a last process in my chain and actives all the InfoObject and Hierarchy.
    How can I carry out the structural changes for all InfoObject in a process chain?
    Thanks!

    yes but it requests me a variant. then a layout "execute infopackage", then the attr change doesn´t have Object.
    I don´t know what I do?
    This process actives all my ATTR and HIER in my chain???
    Message was edited by: Victoria León

  • Java Code  that can find all the specified functions in a sql statement

    If i pass a string like
    SELECT CONCAT(region_name,store_name) , length( region_name) , region_name || store_name, region_name, store_name FROM Geography
    WHERE store_name = 'Boston';
    Then my code should return
    CONCAT(region_name,store_name)
    length( region_name)
    region_name || store_name
    i.e all function related stuff. Is there any parser in java that can parse all the functions a sql or ny code that can d that. Any help is highly appreciated

    I suspect a regular expression may be able to handle this, or 'grep'. Why do you need to do it in Java?

  • I turned on My MacBook Pro, And there is no picture on the screen, Even though the keys have lite up as if the laptop is running perfectly, All except my blank screen ??

    Any one help .... av tried the pram thing ??
    took the battery out etc etc ??? am at a loss..

    I agree Thedave413..... Just this aint never happened to me before you no .... Press the power button.. , the macbook pro makes the normal sound.... But the screen doesnt go blue, Or it doesnt do anything even though the keys soon light up as if the macbooks running perfectly, Al except my screen.. which is completely blank ???
    Can anyone help at all with some good advice ???
    As a trip to the genius bar is a 2 bus journey away from were I live....Good lord ....Oooooffftttssss...

Maybe you are looking for