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

Similar Messages

  • 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

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

  • How to Maintain Translation of texts of Exception Class

    Hi Experts,
    I have an exception class ZCX_CHECK . I have maintained a text in the text tab of the exception class
    like No components  Exists in  Package  &PACKAGE_NAME&
    PACKAGE_NAME is the Attribute . How do I maintain Translation of the TEXT. When I navigate like Goto->Translation , it is saying Empty Object list.
    When I maintain text elements and give text-001 in the text tab of the exception class , the ouptu is coming as text-001 in the Report .
    How do I amintain translation , or how can I integrate a message class with an exception class .I know where to metion messsage class  . But how do I use it inside exception class

    Let me rephrase this: When entering a text in your Exception class it will be automatically part of the OTR. You can check this by looking this up in SOTR_EDIT.Press the binoculars button (Find), and search on package (development class).
    Now via SE63: Translation->ABAP Objects->Short texts
    open node OT on pop-up and double click on Subnode.Enter a * on screen for Object name and press F4. Now enter collection (package / development) class. Select the text to be translated.
    BTW: Via SOTR_EDIT you can retrieve the logical key (field concept) which is needed for translation. Select the GUID (logical key / concept) from SOTR_EDIT.

  • Exceptions classes in 4.6C

    Hello SDNers,
    as Uwe had already written in the thread Throw statement equivalent in ABAP Objects.
    What would be better?
    1. Would you try to develop in 4.6C the exception classes
       (plenty of work, but keeping myself updated, and I can use them also in the future)
      CX_ROOT                             -> ZCX_ROOT; ZIF_MESSAGE
      CX_STATIC_CHECK (I need this slass) -> ZCX_STATIC_CHECK
    2. just to solve the problem with traditionally
      METHOD get_xxx.
        IF sy-subrc = 0.
        ELSE.
            RAISE wrong_xxxx.
        ENDIF.
      ENDMETHOD.
    With regards,
    Peter

    You may appreciate that whatever is possible in OO ABAP is still possible in procedural ABAP with difference in the extent of SW reusability, visibility control etc. So its a design decision whether to go for OO ABAP. In case you have a business case for a class ( you feel that the class will be used many times in your project, you need to control visibility, you have chances of enhancing the functionality of the class, you do not want to incur more resources in testing etc. ), you can go for the development of the exception class.
    Otherwise traditional development may be helpful.

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

  • Create a Exception Class

    hi all ,,
    can any one tell me how to create a exception class in ABAP OOPS concept ??
    if possible can give link also for document

    HI Jayakumar,
    Please go thru this document
    Exceptions are represented by objects that are instances of exception classes. Defining an exception is, therefore, the same as creating an exception class.
    All exception classes must inherit from the common superclass CX_ROOT and one of its subordinate classes:
    CX_STATIC_CHECK
    CX_DYNAMIC_CHECK
    CX_NO_CHECK
    . The assignment of exception classes to one of these three paths of the inheritance hierarchy determines the way in which the associated exceptions are propagated. There is a record of predefined exception classes CX_SY_... whose exceptions are raised in error situations in the runtime environment. These classes all inherit from CX_DYNAMIC_CHECK or CX_NO_CHECK but not from CX_STATIC_CHECK (see hierarchy in the ABAP keyword documentation).
    All exception classes must begin with the prefix CX_. They are usually defined globally with the Class Builder of the ABAP Workbench. Local exception classes can, however, also be defined.
    Individual (abstract) exception classes that are used as the superclass of further exception classes can be defined. The exceptions of the subordinate classes can be handled together using a superclass.
    Exception classes have the following features:
    Constructor
    The constructor must have a predefined structure and a specific interface. With global classes, the Class Builder generates the correct constructor and sets it to an unchangeable status. The constructor has two IMPORTING parameters:
    TEXTID of the SOTR_CONC type
    This parameter can be used to determine which of your exception texts the exception will use.
    PREVIOUS of the CX_ROOT type
    This parameter can be used to assign the PREVIOUS attribute a previous exception.
    Methods
    In exception classes, you can define your own methods. The following two predefined methods are inherited from the root class CX_ROOT:
    GET_TEXT
    Sends back the exception texts of a class (controlled by the TEXTID attribute) as a string.
    GET_SOURCE_POSITION
    Returns the program name, the name of a possible include program, and the line number of the statement that raised the exception.
    Attributes
    The attributes of exception classes are used to transport additional information on an error situation to the handler. The main piece of information is, however, always the fact that an exception of a particular class has occurred. The following attributes are inherited from CX_ROOT:
    TEXTID
    Used to specify the exception of a class more precisely by using several exception texts. Is evaluated in the GET_TEXT method.
    PREVIOUS
    If an exception is mapped to another exception, a reference to the original exception can be defined in this attribute via the EXPORTING addition of the RAISE EXCEPTION statement and by means of the constructor IMPORTING PARAMETER with the same name. This can result in a chain of exception objects. In the event of a runtime error, the exception texts of all the exceptions in the chain are output. Mapping an exception to another exception is only beneficial if the context in which the original exception occurred is important for characterizing the error situation.
    KERNEL_ERRID
    The name of the associated runtime error is stored in this attribute if the exception was raised by the runtime environment, for example, COMPUTE_INT_ZERODIVIDE with a division by zero. If the exception is not handled, precisely this runtime error occurs.
    Parameters cannot be transferred to the constructor for this attribute. If the exception is raised with RAISE EXCEPTION, the attribute is set to initial.
    Global Exception Classes
    Global exception classes are defined and managed in the Class Builder. If the correct naming convention (prefix CX_) and the class type Exception Class is chosen when a new class is created, the Class Builder automatically becomes the Exception Builder.
    The Exception Builder offers precisely the functionality required to define exception classes and generates independently-defined components that must not be changed. When classes are created, the category of the exception must be specified, in other words, whether it is to inherit from CX_STATIC_CHECK, CX_DYNAMIC_CHECK, or CX_NOCHECK.
    Tab Pages of the Exception Builder
    The Exception Builder has the tab pages Properties, Attributes, Methods, and Texts.
    The properties do not normally need to be changed.
    Except for the four inherited attributes mentioned above, further public attributes can be generated by the Exception Builder. The contents of these attributes specify the exception more clearly and manage the exception texts.
    All of the methods are inherited from CX_ROOT. New methods cannot be added. The instance constructor is generated automatically. It ensures that, when an exception is raised, the attributes have the right values. It also transfers the text of the superclass for an exception class whose exception text is not specified explicitly.
    The instance constructor is generated on the basis of the attributes, which are set up on the basis of the exception texts. Changing the attributes in superclasses can, therefore, invalidate the constructors of subordinate classes. The constructors of subordinate classes can be regenerated under Utilities ® CleanUp ® Constructor.
    Texts are a special feature of exception classes and the Exception Builder. For further information, refer to Exception Texts.
    Local Exception Classes
    Local exception classes can be defined for specific exceptions that only occur within one single ABAP program. The condition for a local exception class is that it inherits from one of the three classes CX_STATIC_CHECK, CX_DYNAMIC_CHECK, or CX_NO_CHECK, or from their subordinate classes. An individual constructor and individual attributes can be created. Individual methods should not be created, however, and the methods of superclasses should not be redefined.
    Examples of Local Exception Classes
    report DEMO_LOCAL_EXCEPTION_1.
    class CX_LOCAL_EXCEPTION definition
                            inheriting from CX_STATIC_CHECK.
    endclass.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION.
        catch CX_LOCAL_EXCEPTION.
          message 'Local Exception!' type 'I'.
      endtry.
    This example shows a minimal local exception class, which is simply the local representation of one of the three direct subordinate classes of CX_ROOT. It can be used in the program.
    report DEMO_LOCAL_EXCEPTION_2.
    class CX_LOCAL_EXCEPTION definition
                            inheriting from CX_STATIC_CHECK.
      public section.
        data LOCAL_TEXT type STRING.
        methods CONSTRUCTOR importing TEXT type STRING.
    endclass.
    class CX_LOCAL_EXCEPTION implementation.
      method CONSTRUCTOR.
        SUPER->CONSTRUCTOR( ).
        LOCAL_TEXT = TEXT.
      endmethod.
    endclass.
    data OREF type ref to CX_LOCAL_EXCEPTION.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION
                          exporting TEXT = `Local Exception`.
        catch CX_LOCAL_EXCEPTION into OREF.
          message OREF->LOCAL_TEXT type 'I'.
      endtry.
    In this example, the exception class from the previous example is extended to include an individual attribute and constructor. The IMPORTING parameter of the constructor must be supplied when the exception is raised (it is required here). The attribute can be evaluated in the handler of the exception.
    report DEMO_LOCAL_EXCEPTION_3.
    class CX_LOCAL_EXCEPTION definition
          inheriting from CX_SY_ARITHMETIC_ERROR.
      public section.
        methods CONSTRUCTOR importing SITUATION type STRING.
    endclass.
    class CX_LOCAL_EXCEPTION implementation.
      method CONSTRUCTOR.
        SUPER->CONSTRUCTOR( OPERATION = SITUATION ).
      endmethod.
    endclass.
    data OREF type ref to CX_LOCAL_EXCEPTION.
    data TEXT type STRING.
    start-of-selection.
        try.
          raise exception type CX_LOCAL_EXCEPTION
                exporting SITUATION = `START-OF-SELECTION`.
        catch CX_LOCAL_EXCEPTION into OREF.
          TEXT = OREF->GET_TEXT( ).
          message TEXT type 'I'.
      endtry.
    In this example, an exception class is derived from one of the predefined exception classes for error situations in the runtime environment. An individual constructor is defined with an individual IMPORTING parameter that supplies the superclass constructor with this parameter. When the exception is handled, the exception text, as defined in the superclass, is read with GET_TEXT.

  • About exception class CX_TPDA_SYS_SYMB_FSUNASSIGNED

    Can any tell me how to use this exception class.
    I try to use this exception class to catch unassign exception when using field symbol. But failed.Is there a way to catch unassign exception of field symbol?
    Thanks
    DATA: int TYPE I.
    FIELD-SYMBOL: <int> TYPE I.
    DATA: r_exception TYPE REF TO CX_TPDA_SYS_SYMB_FSUNASSIGNED.
    TRY.
      <int> = 1.
      CATCH CX_TPDA_SYS_SYMB_FSUNASSIGNED INTO r_exception.
    ENDTRA.
    When execute <int> = 1.ABAP dumps occurs.

    Hi Chris,
    it seems that the exception of using an unassigned field symbol is not catchable. I've tried out your example and replaced the class after CATCH statement with main exception class cx_root. Even cx_root is not able to catch this exception.
    I recommend that you avoid this situation by using code like this:
    IF <int> IS ASSIGNED.
    <int> = some_value.
    ELSE.
    RAISE EXCEPTION your_exception.
    ENDIF.
    Hope this helps!
    Regards
    Mark-André

  • What are exception class and persistant class?

    hi,
    what are exception class and persistant class?
    how are they different from the normal class?
    Regards,
    Anil

    Hii!
      Persistent Classes
    To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.
      Check out this link
    http://www.sapnet.ru/abap_docu/ABENABAP_EXCEPTION_CLASSES.htm
    Regards
    Abhijeet

  • Assertions vs. Exceptions Classes

    Hello Everyone,
    in the last weeks we were progressing with the use of exception classes in our current project...
    I continued reading about ways to improve software quality and such that I reached the the new way of using Assertions thought this paper: http://www.sapnow.cn/upload/7871465e846771cf9.PDF
    My Questions is now when do I use what in my code?
    As an example:
    Select * from vbak where vbeln = lf_vblen
    What do I do to "check" that
    lf_vblen
    is not initial? Or what do I do IF it IS Inital and it shouild not be, should I raise an exception oder use Assert?
    I can imagine that there will be no clear statement, but I would like to get a feeling when to us what ...
    Thanks for your reply or comment.

    You may appreciate that whatever is possible in OO ABAP is still possible in procedural ABAP with difference in the extent of SW reusability, visibility control etc. So its a design decision whether to go for OO ABAP. In case you have a business case for a class ( you feel that the class will be used many times in your project, you need to control visibility, you have chances of enhancing the functionality of the class, you do not want to incur more resources in testing etc. ), you can go for the development of the exception class.
    Otherwise traditional development may be helpful.

  • Get the values from Exception class

    Hi all ..
    In class i have raised one exception
    when i catch this exception in my program i m able to get the
    error message but i need to get all the parameters that i pass
    when i raise the exception ...
    i have raised like this
          RAISE EXCEPTION TYPE cx_bapi_error
            EXPORTING
              textid = cx_bapi_error=>cx_bo_error
              class_name = 'ZHS_'
              log_no = wa_bapi_return-log_no
              log_msg_no = wa_bapi_return-log_msg_no
              t100_msgid = wa_bapi_return-id
              t100_msgno = wa_bapi_return-number
              t100_msgv1 = wa_bapi_return-message_v1
              t100_msgv2 = wa_bapi_return-message_v2
              t100_msgv3 = wa_bapi_return-message_v3
              t100_msgv4 = wa_bapi_return-message_v4
              STATUS = lt_status
    and caught the exception like this in my program
        CATCH cx_bapi_error INTO go_error.
          gd_text = go_error->get_text( ).
          EXIT.
      ENDTRY.
    in this i m just getting the class name which i have passed in exception
    i need all other parameters that i have passed ..
    if u have any idea pls let me know ..
    Thanks in advance ...

    Hello Jayakumar
    Usually the attributes of standard exception classes are defines as <b>public</b> and <b>read-only</b>. Thus, you should be able to use the following coding:
    DATA:
      go_error   TYPE REF TO cx_bapi_error.  " specific exception class !!!
    TRY.
    RAISE EXCEPTION TYPE cx_bapi_error
    EXPORTING
    textid = cx_bapi_error=>cx_bo_error
    class_name = 'ZHS_'
    log_no = wa_bapi_return-log_no
    log_msg_no = wa_bapi_return-log_msg_no
    t100_msgid = wa_bapi_return-id
    t100_msgno = wa_bapi_return-number
    t100_msgv1 = wa_bapi_return-message_v1
    t100_msgv2 = wa_bapi_return-message_v2
    t100_msgv3 = wa_bapi_return-message_v3
    t100_msgv4 = wa_bapi_return-message_v4
    STATUS = lt_status.
    CATCH cx_bapi_error INTO go_error.
    gd_text = go_error->get_text( ).
    WRITE: go_error->t100_msgid,  " perhaps the attributes have different name
                go_error->t100_msgno, " check attribute names in SE24
    EXIT.
    ENDTRY.
    Regards
      Uwe

  • DAC ERROR EXCEPTION CLASS::: java.lang.NullPointerException

    hello guru,
    when i creating a execution plan in my local envt for testing
    I have assemble the subject area
    but while building the execution plan i am getting below error:
    SHTEST-TEST
    EXCEPTION CLASS::: java.lang.NullPointerException
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.substituteNodeTables(ExecutionParameterHelper.java:174)
    com.siebel.analytics.etl.execution.ExecutionParameterHelper.parameterizeTask(ExecutionParameterHelper.java:141)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.getExecutionPlanTasks(ExecutionPlanDesigner.java:738)
    com.siebel.analytics.etl.execution.ExecutionPlanDesigner.design(ExecutionPlanDesigner.java:1267)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:169)
    com.siebel.analytics.etl.client.util.tables.DefnBuildHelper.calculate(DefnBuildHelper.java:119)
    com.siebel.analytics.etl.client.view.table.EtlDefnTable.doOperation(EtlDefnTable.java:169)
    com.siebel.etl.gui.view.dialogs.WaitDialog.doOperation(WaitDialog.java:53)
    com.siebel.etl.gui.view.dialogs.WaitDialog$WorkerThread.run(WaitDialog.java:85)
    can anyone help on this.
    thanks

    Hello Shiva,
    I have tried to generate the paramenter index in going into execute tab.
    Acutally I have two database one is SH(for sales fact table) as source and other is SHTST (for target w_sales_F).
    when i go into that it try to click on generate button it shows only for SHTST not for SH
    more over in SHTST the value is coming as Informatica folder Sales where i created all mapping.
    SH and SHTST both are in same database oracle 10g.
    please help

  • ABAP proxy exception to SOAP fault and vice versa not getting mapped

    Hi there,
    I have these scenario's: ABAP proxy to SOAP (AXIS framework) and the other way around, synchronous, using AAE.
    When declaring the Synchronous Service interfaces we also defined error message types in order to pass system and application exceptions back to the service consumers.
    The behavior we are observing is as follows;
    When an exception is generated on the ABAP proxy, the error message type is correct generated and filled with the corresponding values in the ABAP proxy runtime. However, when the response arrives at the service consumer, it only contains a SOAP fault filled with some kind of generic PI mapping exception information.
    1. Why is the original ABAP proxy exception not mapped/passed into the SOAP response?
    2. What can we do in order to change that situation?
    3. Does it has to do with the use of the AAE - Advanced Adapter Engine or the AXIS framework?
    PS: We have performed a test of the Operation Mapping - OM using the ABAP exception as input and it did work correctly, so the error structure seems to be Ok.
    Many thanks for your replies.
    Edited by: Roberto Viana on Jul 26, 2010 8:30 PM

    Problem was caused by some differences in namespaces between source and target.

  • Exception class: RFC not found

    Hi,
    Do you know whether there is an exception class in web dynpro java that i can catch in case the RFC is not found in the backend system?
    Thanks and regards,
    Nada

    Thank you!
    Are the mentioned exceptions general exceptions if something is going wrong with the execute() method or they are specific for the problem 'RFC not found in the backend).
    So I need this specfic information that the RFC is not found in the backend.

Maybe you are looking for

  • ORA-04016 - Sequence no longer exists

    Hi, In the below scenario 1. All the sequences are dropped 2. When a process requires a value from a sequence and the sequence is not available, it is created and then a sequence.nextval is executed. This statement is returning a ORA-04016 - Sequence

  • Question Mark instead of video - Frustrated

    Hi All I hope someone can help fix this problem. I am having problems opening videos on the web with quicktime player 10.0(118) when trying to view them on Safari 10.6.6. I can open the videos fine on Firefox but not on Safari. I have searched everyw

  • HT1725 How can I avoid the network from resetting?

    Everytime I try and download a movie it keeps giving me an error with the the network resetting. What can I do about this?

  • When opening iphoto, grey screen with the wait cursor is as far as i can get!

    hey there. i am running snow leopard 10.6.8 and have currently got ilife 11 installed on my imac. however, after accidently deleting a photo from my library (and possibly an important file which helps iphoto to run, im not too sure) i now cannot open

  • Volume Header & Kernel Panic - Related??

    Hello! I am a fairly new Apple user and my Intel iMac has been running great - so these two seemingly unrelated issues that suddenly popped up this week have me a little panicked, so please bare with me :P This is what happened, in order, and my main