Working with class based exception and dynamic method calls

Hi Gurus,
we just changed out ERP from EHP6 to EHP7.
Since we did so we are facing an issue with an Z-Report we are using quite often.
This reports looks up Workitems and executes the according methods so that we can go into debugging if we were facing any problems or errors.
since the EHP Upgrade this statement has problems:
  data:        lt_parmbind   type abap_parmbind_tab,         lt_excpbind   type abap_excpbind_tab,         lo_runtime    type ref to object.     call method lo_runtime->(iv_cls_method)       parameter-table       lt_parmbind       exception-table       lt_excpbind.this CALL METHOD Statement has Problem with the Exception Table. We are quite often getting DYN_CALL_METH_EXCP_NOT_FOUND short dumps with Exception "CX_SY_DYN_CALL_EXCP_NOT_FOUND".
The system has problems handling the content of lt_excpbind. if i clear this table the CALL METHOD statement works fine.
AS an example we are trying to call /IDXGC/CL_PD_PROCESS_STEPS-->CREATE_DATA. This method has 2 exceptions
/IDXGC/CX_PROCESS_ERROR
Process Layer Exception
CX_BO_TEMPORARY
Temporary Business Exception
The Content of LT_EXCPBIND is
INDEX
NAME
VALUE
2
/IDXGC/CX_PROCESS_ERROR
1
2
CX_BO_TEMPORARY
2
From my point of view the Problem ist, that they are marked as "class based". I think so because if you looked up the SAP Help for the EXCEPTION-TABLE Statement it is written that is statement only works for none-classbased exception.
I think that restriction is quiet clear. But what i am wondering about is.. that restriction also exists for EHP6. And in EHP6 it work. Does anyone know why? Or how i can change me CALL METHOD Statement that i will work again?
Best Regards
Udo

Class-based exceptions must be caught using try/catch statement.
Calling dynamically a method catchable exceptions are:
CX_SY_DYN_CALL_EXCP_NOT_FOUND
CX_SY_DYN_CALL_ILLEGAL_CLASS 
CX_SY_DYN_CALL_ILLEGAL_METHOD
CX_SY_DYN_CALL_PARAM_MISSING 
CX_SY_DYN_CALL_PARAM_NOT_FOUND 
CX_SY_REF_IS_INITIAL
Anyway catching cx_root (as shown by Matthias) will catch everything is catchable.

Similar Messages

  • ENQUEUE and Class-based Exceptions

    Hi,
    If I use the ENQUEUE Function module in a method which also raises class-based exceptions, I'd like to be able to raise equivalent class-based exceptions which map to the standard ENQUEUE function module exceptions.
    Normally I'd simply propogate the FM exception by calling MESSAGE ... RAISING and then raise my own exception with the message that the ENQUEUE FM returned in sy-msg* etc.
    But you can't have normal exceptions and class-based ones in the same method interface. Does anyone know if there's a SAP standard CX exception which has all the same messages and parameters in it so that we can raise the relevant class-based exception in the method after an ENQUEUE fails?
    Thanks
    Paul

    Hello Paul,
    I am not sure whether I understand your problem correctly, so please excuse me if I am completely off track
    I assume you want to transport the information that is normally stored in sy-msg variables via class-based exceptions.
    If you define your own exceptions, you can add attributes to the exception class. Any attributes, basically. I did something along this line by adding all relevant fields (message class, type, number, the four variables) as attributes to my exception class. Then, if you raise an exception with RAISE EXCEPTION TYPE <yourExceptionClass> and you use, for example, drag-and-drop from SE80 or the pattern feature for that, in the EXPORTING part of the statement you can fill these fields. As they are public fields, any method catching your exception can look into these and figure out what went wrong with the ENQUEUE.
    Hope this helps (if I understood your question right)
    Joerg

  • How to store a class-based exception as container element?

    Hello,
    In a BO type method, there are situations where unexpected class-based exceptions can occur, I handle them with TRY ... CATCH ... ENDTRY.
    If such an error occurs, my BO type method also returns a BO type method exception using a return code (as usually).
    1) Now, my question is how can I store the exception instance in the task container ? (so that to get more information about what happened... it is an unexpected error as I said)
    Note that my question may apply to any class instance.
    2) To achieve this, I have an idea but not sure if it's realistic (maybe the question is not realistic too ). I'll create a new BO type ZOOINSTANC with string attribute containing the serialized instance, with a method to display it.
    Example how it could work, in my BO type method (it returns EXCEPTION parameter of type ZOOINSTANC):
    TRY.
      CATCH cx_root INTO lo_exc.
        DATA l_exc TYPE string.
        CALL TRANSFORMATION id
            SOURCE oo = lo_exc
            RESULT XML l_exc.
        DATA l_bor_zooinstanc TYPE swc_object.
        swc_create_object l_bor_zooinstanc 'ZOOINSTANC' ''. "no key
        swc_set_property l_bor_zooinstanc l_exc.
        swc_set_element container 'EXCEPTION' l_exc.
        exit_return 1001 '' '' '' ''.
    ENDTRY.
    One important issue is that I don't know any API to display the instance :-p
    Do you have any ideas, advices, ... ?
    Thx
    sandra

    Hi Mike, thank you for your answer, and sorry for the delay.
    > I'd rather go with the idea of returning the error details in a structured format that you can view in the container
    Yes, but that's the issue as I don't know which exceptions can be triggered, as I'd like to handle all exceptions.
    > I'd also ask why it's necessary to use BOR for this?
    When a BOR method fails, I want technical support to have all the details of the error, not only a generic error message. It's why I want to store the exception in the workitem container, and be able to display it later.
    > It's obviously your own development, so why not use classes. Subclasses of CX_BO_ERROR are recognised by workflow and you can even  bring a proper message back to the WF log. There's also some info on this in the second edition of the WF book.
    I did a test using demo workflow WS56400159 ("absence"), where I forced CX_BO_ERROR right after SWX_FORMABS_CREATE call in CL_SWF_FORMABSENC / CREATE method, but it seems that only the short text of the exception is kept.
    So, I'm a little disappointed to see that we have a great exception "tool" with class-based exceptions, but only the last text is kept in the system! That would have been great to be able to store the whole information (the attributes, and the whole bunch of cascading exceptions (PREVIOUS attribute), instead of only a simple text).
    sandra

  • Working with Classes and Arrays

    hello to all,
    public class Store
    //private data
    private Person list[];
    private int count;
    private int maxSize;
    //constructor starts
    public Store(int max)
    count = Person.count(); //sets count to 0     
    maxSize = max;//maxSize is equals to max
    Person list[] = new Person[maxSize];
    }//end of store
    //constructor ends
    //accessor starts   
    public int getCount()
    for(int i=0; i<list.length; i++)
    int result = list;
    return result;
    }//returns the number of elements currently in store
    the code above is working with classes and some arrays
    what am trying to do is to display what the array holds
    and then i meet an error saying that
    INCOPATIBLE TYPES - FOUND PERSON BUT EXPECTED INT
    Please note that am new to this!
    Thank you in advanced!
    <img src="file:///C:/Documents%20and%20Settings/fh84/Desktop/untitled.JPG" alt="" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    public class Store
        //private data
        private Person list[];
        private int count;
        private int maxSize;
    //constructor starts
        public Store(int max)
             count = Person.count(); //sets count to 0     
             maxSize = max;//maxSize is equals to max
            // Person list[] = new Person[maxSize];
             Person list[] = new Person[maxSize]; //set tne
        }//end of store
    //constructor ends
    //accessor starts  
        public int getCount()
            for(int i=0; i<list.length; i++)
                int  result = list;
    return result;
    am sending the code again                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do Standard class based exceptions understand an exception?

    Dear All,
    Can any one explain how does the standard class based exceptions understand and identify the specific exception. For example CX_SY_ZERODIVIDE is an exception class we use to catch the divide by zero exception. How does the class understand it. To clear my point  please refer the code below
    data: v1 type i,
            v2 type i.
    try.
    v2  = v1 / 0.
    catch CX_SY_ZERODIVIDE.
    The above code will work and an exception will be handled properly. But how??
    suppose if i write..
    try.
    v1 = Apple
    catch CX_SY_ZERODIVIDE.
    it obviously doesnt work.
    so my point is how does an exception class understand the exception?
    I have very poor knowledge about it, i have checked the class CX_SY_ZERODIVIDE and its methods. There is no code in it. .
    Any help would be greatly appreciated.
    Thanks and Regards,
    Abdullah.

    1) You can write your own log class. Call the log method from your catch
    2) Upgrade to JDK1.4.0 and you can use the Logger function
    3) Check jakarta for log4j

  • Where-used list for class-based exception texts

    G'Day,
    With traditional exceptions, one can look at a message, go to SE91 and do a where-used for that particular message. This is not possible with ZCX classes, a where-used can be done for the entire class but there doesn't seem to be a way to find where individual exception texts are raised.
    Now whilst exception classes do offer the possiblity of a far better structuerd approach that reduces the need for a where-used in first place, this is still a shortcoming of exception classes... or is it? (or am I missing some other way to search for it?)
    Cheers,
    Mike

    D'Oh! That one was so obvious that I was blinded by it  
    (Believe it or not I've been using ex. classes for some time!)
    However it still leaves another issue (which was actually the one that sparked this debate here in the office): In the old message concept it was far easier to navigate from an error to find the offending code. One could click on a message, see the message class/ID, drop into SE91 and (provided the where used is small enough) go straight to the offending code via a where-used.
    Unless class-based exceptions are caught and re-raised as an old MESSAGE statement with a message number, this is not so simple anymore. Or is it?
    Thanks,
    Mike

  • Handling general errors via class based exceptions

    Fairly standard scenario: I've got this.
      DATA:  l_requester TYPE xubname.
      CALL FUNCTION 'ENQUEUE_EZMYTAB'
        EXPORTING
          username             = i_username
        EXCEPTIONS
          foreign_lock         = 1
          system_failure       = 2
          OTHERS               = 3.
      CASE sy-subrc.
        WHEN 1.
          l_requester = sy-msgv1.
          RAISE EXCEPTION TYPE zcx_my_exception EXPORTING textid   = zcx_my_exception=>lock_error
                                                          user     = i_username
                                                          lockedby = l_requester.
        WHEN 2.
          RAISE EXCEPTION TYPE zcx_my_exception.
      ENDCASE.
    But what I really want for WHEN 2 is the class based exception of
    MESSAGE sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1...
    I.e., in my calling code, I want to catch the exception, and display whatever the original error message was as generated by the ENQUEUE function module.
    I suppose I could do this
    DATA: ls_error TYPE scx_t100key.
    WHEN 2.
      ls_error-msgid = sy-msgid.
      ls_error-msgty = sy-msgty.
      ls_error-msgno = sy-msgno.
      RAISE EXCEPTION TYPE zcx_my_exception EXPORTING textid = ls_error
    but I can't help feel I'm missing something staggeringly obvious...
    matt

    Hi Matt,
    this may sound too simple:
    For me the real advantage of class-based-exception is that they can be raised in an inner block and caught in an outer block at any level.
    I never use the exception attributes to communicate any details, but use
    IF SY-SUBRC NE 0.
      MESSAGE sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1... INTO lv_string.
      Raise Exception type zcx_my_exception.
    ENDIF.
    Catching the exception I may (roughly) know where it comes from. As the message variables are present, I can check their values or repeat the MESSAGE without INTO. The main function of MESSAGE INTO is for transparency, the ability to see the whole message in debugger in lv_string and the where-used-list if message is created by programmer..
    If I really need different reaction for different SY-SUBRC ( = different untyped exception), I'd rather create different class-based exceptions. This helps transparency.
    In other oo language you do not have an ABAP message concept with everywhere-present message variables. Why use this crutch of putting the message variable filled by functions exception into exception object attributes only to convert them back to message output?
    I prefer [KISS|http://en.wikipedia.org/wiki/KISS_principle].
    Regards,
    Clemens

  • Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine, tried solutions from other threads with no luck, just thought i'd see if anyone else had any ideas, thanks.

    Hi all, i can't sync over wifi between my iPhone 4 and Windows 7 64 bit, wifi sync works with the same phone and my Windows 8 machine so the problem seems confined to Windows 7. I've tried solutions from other threads -
    Making sure everything is allowed through firewall
    Rebooting phone/laptop/router
    Disabling ipv6
    Disabling all networks except the one curently on
    Re-installing iTunes
    Restoring iPhone
    No luck with any of those unfortunately so i just thought i'd see if anyone else is still without wifi sync after trying those as well and if you ever found a fix, thanks.

    I just wanted to leave a note that it's working now. I'm not sure if it was the latest iTunes update that got it working or that i decided to start a new library instead of using the one i had backed up on Windows 8 (it didn't occur to me to check using the old library when i re-installed iTunes). But if anyone is having this problem, it might be worth trying again with a new installation of iTunes to see if the latest update works for you, and if not, try using a fresh library instead of a backup (by fresh library i mean discard your old library completely and start a new library, not just restore as new iPhone, a whole new library).

  • Case that works with iPad 2 Dock and Smart Cover

    The title says it all , if possible list websites and full product details.
    Many Thanks

    This case meets all my requirements, however I am not sure that anyone makes one that will work with the dock, except an amoured film shield.
    http://www.coolous.com/ipad.html?view=product&cid=2&id=33
    http://www.bodyguardz.com/apple-ipad-2-cases-screen-protectors-covers-shields-sk ins-films.html

  • If i buy a new ipad and bring it to England will it still work with the different voltages and the 3G/4G?

    if i buy a new ipad and bring it to England will it still work with the different voltages and the 3G/4G?

    They both seem to cover the same 3G bands - from http://www.apple.com/ipad/specs/ :
    Wi-Fi + 4G for AT&T model: 4G LTE (700, 2100 MHz); UMTS/HSPA/HSPA+/DC-HSDPA (850, 900, 1900, 2100 MHz); GSM/EDGE (850, 900, 1800, 1900 MHz)
    Wi-Fi + 4G for Verizon model: 4G LTE (700 MHz); CDMA EV-DO Rev. A (800, 1900 MHz);UMTS/HSPA/HSPA+/DC-HSDPA (850, 900, 1900, 2100 MHz); GSM/EDGE (850, 900, 1800, 1900 MHz)
    CDMA isn't any use here as there aren't any UK CDMA based carriers, they are all GSM/sim card based (I'm not aware of any CDMA carriers in Europe). As the AT&T version appears to support an extra 4G LTE band then that might be the better one.

  • Which MIDI keyboards work with Logic Pro x and Yosimite?

    can anyone suggest some midi keyboards that work with Logic Pro x and yosimite

    Hi Jacub,
    I have a 2i4 running Mavericks 10.9.2 on a Mac Book Pro, and my unit works properly, please make sure your run the unit with the class compliant mode app (click the link below):
    http://us.focusrite.com/downloads?product=iTrack+Solo
    Please contact Focusrite support if you have any more concerns.
    Best Regards,

  • Can the iPad work with a wireless keyboard and mouse?

    Would like to know if the new iPad will work with a wireless keyboard and mouse!

    There are quite a few threads requesting this facility, so I thought I would choose this recently active (at the time of writing) post to reply to, in the hope some thinking appleite with influence stumbles upon it.
    I totally get Apples philosophy of not polluting their interface design concepts with the introduction of a clunky so-last-year cursor; I actually agree.  What I can't understand so much is that there are a number of apps that could benefit from mouse support. The one I need is RDP.  This class of apps allow us to connect to servers running other operating systems using the IPad; why not authorise CERTAIN APPS to access the Bluetooth mouse stack, and let us have joy.  It doesn't affect the iPad experience in the slightest, at least not to it's detriment.
    The new retina screen is such that I actually prefer the experience of using my iPad to connect to the server than my laptop!, but given I develop software, there is no way my stubby finger can compete the clinical accuracy of a mouse when using intricate interfaces such as MSDE.  With just that one addition, I would practically move into the post pc era you tout so much, at least in my interfacing With the post pc pc,s :).
    Thanks
    Paul

  • I changed my sim on my iPhone n reconfigured iMessage, it configured with my number but when i sign in with my apple id it says username/password is wrong while in all other things like FaceTime, App Store it worked with the same id and password

    i changed my sim on my iPhone n reconfigured iMessage, it configured with my number but when i sign in with my apple id it says username/password is wrong while in all other things like FaceTime, App Store it worked with the same id and password..
    can anyone help me to solve this issue

    i just opened my ipad, started my apple account/I.D. and realized I put the wrong e mail. I was having trouble correcting my I.D on the Ipad so I went to my laptop and make the proper changes/slash e mail address I wanted for my apple ID. I got back to my ipad and try to download an app I can't because I have to sign in my apple account and I can't because it still has the irrelivant I.D/email address..
    So, i did what you said.. went to setting>app store> tapped on my e mail.. it asked me to sign in (with my invalid emails address showing). I signed in with the password I had created. It said "incorrect".. I went to reset password. I reset password, tried to sign in and it says again "unvalid password".. this is getting irritating.  I have been asking and no one knows what to do.

  • Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this?

    Only one of my earbuds on my bose headphones works with my ipad, iphone and macbook- if I hold them there the right earbud will work, but for the life of me, I can't get them to both work. Why is this? And is Apple doing anything about this? While Apple's headphones have (finally) admittedly gotten better of late, I still prefer the much more comfortable headphones & sound quality that Bose makes and that I spent the money for.

    Bose Product Support

  • HT1338 Presently running mac osx 10.5.8. Recent Firefox update says it no longer works with osx 10.5 and it's no longer supported by apple. Any suggestins?

    Presently running mac osx 10.5.8. Recent Firefox update says it no longer works with osx 10.5 and it's no longer supported by apple. Any suggestins?

    Use an earlier version of Firefox, use Safari, or upgrade to a later version of OS X. Any Intel Mac can run Snow Leopard.
    Latest version of Safari for Leopard: http://support.apple.com/kb/DL1422
    Information for Firefox: http://support.mozilla.org/en-US/kb/firefox-no-longer-works-mac-os-10-4-or-power pc
    http://support.mozilla.org/en-US/kb/firefox-no-longer-works-mac-os-x-10-5

Maybe you are looking for