ABAP OO Exception Class based processing

Hi there,
Note: In going forward with SAP WAS 6.20, one can handle exceptions using exception-class based handling using RAISE EXCEPTION TYPE abc and then CATCHing it in TRY/ ENDTRY block. Standard method like GET_TEXT can be used to get the text of the exception raised.
Question: If I know the EXCEPTION CLASS and Exception ID of my exception class, is it possible to get the exception text directly from the repository without creating the exception class object?
E.g. Exception class is CX_MY_SECRET_ID
and Exception IDs for this class are
ID_NOT_FOUND,
ID_EXPIRED,
ID_IS_FOR_SPECIAL_ACCESS
E.g. last two exception IDs are my warning conditions, and if such conditions are encountered, all I want to do is collect the warning messages. Whereas first exception ID condition (i.e. ID_NOT_FOUND) is an error for me, in which I have pass the exception back to the calling program. E.g. the source code is like this:
PERFORM.......
If ID is not found
   RAISE EXCEPTION TYPE ZCX_MY_SECRET_ID
           EXPORTING TEXT_ID = 'ID_NOT_FOUND'.
else if ID has expired
   ...... then do I have to first raise the exception like raised above and CATCH it before I can get its text? or can I get the exception text directly without raising the exception first (as I know i have to retrieve the text of ZCX_MY_SECRET_ID exception class for Exception ID ID_EXPIRED)?
In other words, if a certain condition is warning for my program, can I get the condition for that exception (from exception class based on exception class name and exception ID), or do I have to RAISE it first explicitely and then CATCH it immediately and execute GET_TEXT to get its text?
Thanks very much!

Hello Chetan,
in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block.
The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this.
As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).
So both the code which throws the exception and the one which catches it are aware of the different semantic.
Kind Regards
Klaus

Similar Messages

  • How to enhance exception class based on CX_ROOT

    I have created an exception class based on CX_ROOT (or CX_STATIC_CHECK, CX_DYNAMIC_CHECK). Now, I need to enhance its "constructor" method with my own parameters. How can I do this? Currently system does not allow this. But, I have seen many other exception classes enhanced the way I want? Any idea?
    Any pointers will be helpful.
    Regards, Neetu

    Hello Neetu
    Two steps are required to get additional IMPORTING parameters in the CONSTRUCTOR method of your exception class:
    (1) Create exception IDs (tabstrip Texts )
    Example:  ID=ZCX_SDN_CLASS, text=Invalid data type for field &FIELD& on screen &SCREEN& &REPORT&
    (2) Add corresponding instance attributes (read-only) to your exception class
    Examples: attributes FIELD, SCREEN, REPORT
    Now the CONSTRUCTOR has the additional IMPORTING parameters FIELD, SCREEN and REPORT.
    If you raise your exception class using id=ZCX_SDN_CLASS then the wildcards (e.g. &FIELD& in the text) will be replaced by IMPORTING parameter FIELD.
    Regards
      Uwe

  • ABAP OO Exception Class

    Class Based Exception Handling involves raising exception (RAISE EXCEPTION TYPE), catching it (CATCH within TRY/ENTRY block) and maybe execute GET_TEXT method to get the text for that exception.
    Allowing exception texts be stored as part of exception classes, does that mean that SAP is moving away from using SAP Message Class (transaction SE91 messages) and relying now onwards upon storing texts in respective Exception Clases?
    My understanding is that SE91 holds not only the texts for exceptions (or hard errors) but also informational and warning messages, and hence if program condition has to display an informational or warning message, there is not need to create an Exception Class for such a condition (and then get the TEXT for that informational message from that Exception Class). Right?
    Pls explain. Thanks much.

    Hi Chetan,
    Sap is not moving away from T100-based (SE91) messages at all.
    In fact you do not store exceptions texts in exception classes but in the OTR (Online Text Repository) and still in T100. If an exception class implements the interface IF_T100_MESSAGE (as of Release 6.40), you can use the statement
    MESSAGE excref TYPE ...
    to display the message after
    CATCH INTO excref.
    It is recommended to use T100-messages for texts send to the user via MESSAGE and OTR-texts for texts not sent to the user but used internally, e.g. for writing into logs.
    Regards
    Horst

  • 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.

  • 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

  • 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

  • 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

  • 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 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

  • How to create message based exception class?

    Hi Guys,
    I try to create exception class at Workbech (se24), for example ZCX_TEST. At header information everything is default, but radiobutton "Exception class" is set and checkbox "With message class" is set. After this I enter text for my exceptions, for example TEXT, I assign it to SAP message (for example, class 00, message number 002). I'm going to tabstrip "Attributes" and public constant with name "TEST" should appear with assigned associated type SOTR_CONC and initial value with ID (normal behavior), but attribute "TEST" is created without type and value. It is not possible to use such exception. Where I am wrong?
    Regards,
    Evgeni

    Hmmm. It looks that it works fine with such definitions. Sorry for disturbs.

  • Catch class based exceptions

    hi
    i am calling a outbound proxy class from a inbound proxy class. when i dragged the ourbound proxy the below code is inserted by system directly.
    TRY.
    CALL METHOD oref1->SEND_OUT
      EXPORTING
        OUTPUT = output
    CATCH CX_AI_SYSTEM_FAULT .
    ENDTRY.
    i want to know the difference between writing just
    CATCH CX_AI_SYSTEM_FAULT .
    and
    CATCH CX_AI_SYSTEM_FAULT . into objref. where objref refers to exception class CX_AI_SYSTEM_FAULT .
    how does the system behave in either of the case if exception is raised.
    thanks

    In both cases, no short dump is generated, because the exception is caught. However, no info about the actual error can directly be retrieved like is done in the following example.
    DATA: lv_message TYPE string,
          lr_error TYPE REF TO cx_sy_zerodivide,
          y TYPE i VALUE 10,
          x TYPE i.
    TRY.
        x = y / 0.
      CATCH cx_sy_zerodivide INTO lr_error.
        lv_message = lr_error->get_text( ).
    ENDTRY.
    But this will only be of interest, when you want to determine the error. If the catch is part of another TRY  ENDTRY block, the error is navigated upwards the chain.
    Hope this was somehow helpful.

  • ABAP OO - Exceptions & Events

    Hello all:
    Two questions specific to ABAP OO world:
    1. Is anyone using "RAISE EXCEPTION TYPE exception-class" to raise business process errors (e.g. a customer is not found, or a sales order number is invalid, which originally was referred using ABAP Message Class (transaciton SE91)), Or are you keeping the 'RAISE EXCEPTION TYPE exception-class' limited only to raise and handle global level errors like (CAST_ERROR, TYPE_CONVERSION_ERROR, etc)?
    2. Class Method M1 of class C1 raises event E1.
       Class Method M2 of class C2 handles the event E1.
       In method M1, is it possible to check - immediately
       after the statement that raises event E1 - whether the
       execution of M2 was successful? If yes, can you please
       briefly describe how we can achieve that.
    Thanks!

    In my personal opinion all errors that make the further regular processing within a certain context impossible, should raise an exception.
    The problem with the message statement is, that if a function throws out dialog messages at the user, you can't use it as an API anymore, because if errors occur, the caller of your function cannot intercept the message anymore.
    Of course on may use "message raising" but the use is a bit awkward and the especially if the caller decides propagate the error messages of the funtion that was called, it has to use these sy-msgid and all these Variables.
    An Exception can also have an error text associated to it and in 640 an exception class may have an old-fashioned message class associated with it.
    As error handling with try/catch has advantages (you may treat similar errors of a whole related block in one piece of code, error messages will be handed on to the caller, the compiler will check, if the error is taken care of), in my opinion all application-level errors should use exception classes. An exception class should be created for each type of error that can occur.
    Exception classes can also be derived from each other, thus forming a hierarchy of errors. The caller may then even decide, if all errors of a certain "family" are treated equally, or if more specific checks are done, based on the specific type of exception.
    For bringing up error messages to the user, you can get the exception's text and output it via message, if the error has really been propagated to a level of the application that is clearly dialogue-related.
    This model is in my opinion much superior to the earlier error handling model.
    Hope that helps.
    Yours
    Christian

  • ABAP Proxy Exception

    Hello everybody i have this error in my sxmb_moni of xi for a abap proxy server receiver:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIProxy</SAP:Category>
      <SAP:Code area="ABAP">DYNAMIC_CALL_FAILURE</SAP:Code>
      <SAP:P1>UNCAUGHT_EXCEPTION</SAP:P1>
      <SAP:P2>ZFUS_CL_MI_FMGOB_CAT_FONDOS_C1</SAP:P2>
      <SAP:P3>EXECUTE_SYNCHRONOUS</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText>Unable to execute the dynamic application call (kernel error ID UNCAUGHT_EXCEPTION, class ZFUS_CL_MI_FMGOB_CAT_FONDOS_C1, method EXECUTE_SYNCHRONOUS)</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    any suggestions?
    Regards,
    Julio Cesar

    Hi
    Below is the full details of above links
    For link 4196517?
    Q) Hi All,
    I have got a requirement to raise an exception from existing ABAP Proxy depending on condition. XI consultant created a fault messge type and attached to the inbound interface message type. I have regenerated the ABAP proxy but I cant find any thing in excpetion tab to raise exception.
    Please let me know the solution for this.
    Answers : 1) Go to Sproxy .
    Select the message interface for which you generated the proxy.
    Click on the Structure tab. Do you see any Exception Class generated for fault message ?
    2) Just follow all the steps defined in the below Blog and you will find the solution.
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    3) I can't find any exception class there in 'Structure' tab. what might be the problem.
    4) In SProxy ..under the Message Interface you will see Fault Message Type.
    Click on Fault Message Type and check if you can see the fault message type created by xi consultant.
    Also ask your xi team to login to IR and re-activate the interface.
    5) I can't find any fault message type under Fault Message Type. I will ask my XI consultant to reactivate the interface.
    Is this the only problem for this or is htere any other reason for not finding this fault message type in SPROXY.
    6) Ideally the fault message type should be visible unless he has defined Software Dependencies and using MT from some other SC.
    Even if the fault message type is not visible everything could be all right.
    Ask him to check if he selected the fault message type while activating the interface.
    Do update us when you get a reply from ur xi team.
    7) I have checked with XI admin, he said that he created fault message types in Development Xi but R/3 Development refers to Production XI system in exchange profiles. He asked me to change it to XI development in exhange profile settings. So I am searching info on how to set exchange profiles.
    8) The following link will guide you ..
    http://help.sap.com/saphelp_nw04s/helpdata/en/c9/7a1041ebf0f06fe10000000a1550b0/frameset.htm
    I dont think we need to do any changes in Exchange Profile for proxy communication.
    Changing the RFC Destinations (in your R/3 system)- LCRSAPRFC & SAPSLDAPI should solve your problem.
    II) For Link :4147406?
    Q) Hi All,
    We have an ABAP Proxy implemented for posting goods movement and it is calling BAPI function module to post good movement. We have got a requirement that if BAPI returns any error, this error message send back to SAP XI.
    data call proxy
    Legacy -
    > XI -
    > SAP R/3(call bapi)
    <----
    error message
    Please let me know how to send the message back to XI.
    Answers: 1) Refer the following
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy - ABAP Proxy to File
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy - File to ABAP Proxy
    2) you can utilize the fault messages for such an usage -
    Ref:
    Fault messages -
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    Handling Web Service SOAP Fault Responses in SAP NetWeaver XI -
    /people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi
    3) You have to do Fault message implementation in this case...
    A no. of exception will be there.For any error proxy will catch the exception and will write it in the fault message...so....from r/3 response will go to Xi as Fault message response in case any error/exception occours......
    have look here...
    Fault message implementation.
    /people/shabarish.vijayakumar/blog/2006/11/02/fault-message-types--a-demo-part-1
    4) Please go through it is very useful.
    /people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy --Monitoring for Processed XML messages in ABAP Proxy
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy --ABAP Proxies in XI(Client Proxy)
    /people/sap.user72/blog/2005/12/29/service-enable-your-sap-application-component --- Service Enable Your SAP Application Component
    5) the file adapter can work only asynchronous, so you cant have a response. You should build two asynchronous messages. File -> proxy inbound and after the bapi call an outbound proxy is called which is sending a second messge to the file adapter.
    6) you can define a synchronous scenario which will include request/response messages.
    send the response back to XI.
    the file adapter supports BE QoS.
    http://help.sap.com/saphelp_nw04s/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    7)I have an interface Z_stock_move(message interface(inbound)) and class z_STOCK_MOVE in that. I have clicked exception tab but not able to add exception there as its not enabled for change.
    Please let me know how to add the exception to an existing abap proxy.so that i can raise an exception when bapi call to goods movenment returns errors.
    Might be useful to U.

  • ABAP Object Exception handling

    Hi all,
    I would very much like some links to learn how to create Exception objects, and how to use them in my ABAP Object apps.
    Thanks in advance!

    hi,
    Object Services classes work exclusively with Class-Based Exceptions. The exception classes are predefined in the system. They always start with CX_OS_.
    Exceptions of the CX_DYNAMIC_CHECK category are passed to the caller using the RAISING clauses of interface methods; class-specific methods of the class actor; attribute access methods of persistent classes; in the transaction object; and the system actors. Such exceptions must be handled here by the user, (in contrast to the general rule that exceptions should be handled within a procedure, not passed along the hierarchy). Thus semantically, the above exceptions of the CX_DYNAMIC_CHECK category belong more to the CX_STATIC_CHECK category. However, they could not be defined as such, due to their incompatibility with existing Object Services applications.
    Check out the link.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/66/bc7aec43c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/fb/35c62bc12711d4b2e80050dadfb92b/content.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/17/f9f44295bae2499e8c56ca4f5106fb/frameset.htm
    Regards,
    Richa.

  • Portal Runtime Error : An exception occurred while processing a request

    Hello friends,
    After upgradation of my portal to the following patch level, SAP J2EE 6.20:
    <b>Portal Version :</b> EP 6 SP 2 patch 29 hotfix 0
    <b>Content Mgmt and Collaboration  version</b> : 6 SP2 patch 5
    i faced many performance related issues. Portal seems to be <b>very slow</b>. After logging in, most of the time I get 2 errors:
    <b>Either</b>
    <b>1></b> Iview remains blank.
    <b>Or
    2></b> Portal Runtime Error : An exception occurred while processing a request. Portal Runtime exception occured. Please check the System Log.
    But when I refresh that particular iview, it works fine.
    I went through the portal.log file (/usr/sap/PEP6/j2ee/j2ee_00/cluster/server/managers/log/portal/logs). And found <b>the root cause of most of the exceptions as "com.inqmy.services.servlets_jsp.server.ServletNotFoundException: The requested servlet ( portal ) not found."</b>Aug 18, 2005 6:07:42 PM # PRT-Async 2          Fatal           Exception ID:06:07_18/08/05_0669
    com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
    Component : pcd:portal_content/ACCContent/ACCContent.Roles/Company/R.Employee/W.MyWork/P.MyWork.DesktopTools/I.Contacts
    Component class : com.sapportals.portal.prt.pom.RootComponentNode
    User : tempuser
            at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:853)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:311)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:363)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:376)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
            at java.lang.Thread.run(Thread.java:479)
    Caused by: com.sapportals.portal.prt.component.PortalComponentException: PortalComponentException
            at com.sapportals.portal.prt.pom.RootComponentNode.service(RootComponentNode.java:153)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:363)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:376)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
            at java.lang.Thread.run(Thread.java:479)
    Caused by: com.inqmy.services.servlets_jsp.server.ServletNotFoundException: The requested servlet ( portal ) not found.
            at com.inqmy.services.servlets_jsp.server.ServletContextFacade.loadServletLocal(ServletContextFacade.java:3660)
            at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:81)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.inqmy.services.servlets_jsp.server.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:275)
            at com.inqmy.services.servlets_jsp.server.RequestDispatcherImpl.include(RequestDispatcherImpl.java:384)
            at com.sapportals.portal.prt.pom.RootComponentNode.service(RootComponentNode.java:144)
            at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:301)
            at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:138)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable$1$DoDispatchRequest.run(AsyncIncludeRunnable.java:363)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sapportals.portal.prt.core.async.AsyncIncludeRunnable.run(AsyncIncludeRunnable.java:376)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:729)
            at java.lang.Thread.run(Thread.java:479)
    <b>Help needed.(</b>as i am helpless now.)
    Regards,
    Nilz

    Anthony,
      I had check it. It was correct. But the thing when I saw in the component Inspector of portal, my iview did not appear.
    I created like this
             project-> rightclick->   export-> par ->selecting project-> givint protal password-> and finish.
    The NW didn't give any error, but the par file didn't appear in the portal componet Inspect.
    but the par file is  created in the NW studio Navigation bar.
      Let me know any help regarding this
    thanks
    venkat

Maybe you are looking for

  • How to access a jar file in EAR file?

    I have a EAR file which contains EJB.jar file and util.jar file. Outside of EAR, I mean in client side, I need to reference util.jar file. How can I access it? EAR structure is |--+META-INF/ |--|---application.xml |--|---manifest.mf |--EJB.jar |--|--

  • Mail client settings for Sony Z2 tablet

    Tried to use standard mail client. However incoming mails are ok and are being downloaded. As for outgoing mails...here there is no synchronization with other devices, if You send mail there, it will appear in outgoing folder, if some message is sent

  • Error mesage related to storage type

    Hi Iam PP guy and getting following message while making container full in Kanban board PK13n Storage type  xxx not suitable as an interface (SU management is active)

  • VAT registration number and ISO code

    Dear All, Is there anyway to enter country code and two letters of VAT registration number differently  in vendor master data ? For example Country code : GR VAT registration number : DK0101.. Thanks Dash

  • AS JAVA server nodes

    Hi,, How can I decidethe the numbrer of the server node. Heap size?  CPU thered?