How to implement: Exception class CX_BO_TEMPORARY thrown

Dart, Jocelyn jocelyn.dart at sap.com
Tue Apr 22 10:09:24 EDT 2008


Hi Florin, 

Yes I have used all 3 of the exception message types successfully.
Although I always created sub-classes of the exception classes.  You can
create an attribute MESSAGES type BAPIRET1_TAB to pass when you raise
your exception and code the method IF_MESSAGE~GET_TEXT to send messages
to the "Message" tab of the Workflow log. 

You should also see the failure in the technical log in the tab "Step
History" .

Here's the code you need for the method. 
  DATA:
    ls_messages TYPE bapiret1.

* Get the message text from the super class
  CALL METHOD super->if_message~get_text
    RECEIVING
      result = result.

* Append all message texts from messages to this text
  LOOP AT messages INTO ls_messages.

    IF ls_messages-id IS NOT INITIAL
    AND ls_messages-number IS NOT INITIAL
    AND ls_messages-message IS INITIAL.


      CALL FUNCTION 'BAL_DSP_TXT_MSG_READ'
        EXPORTING
          i_msgid        = ls_messages-id
          i_msgno        = ls_messages-number
          i_msgv1        = ls_messages-message_v1
          i_msgv2        = ls_messages-message_v2
          i_msgv3        = ls_messages-message_v3
          i_msgv4        = ls_messages-message_v4
        IMPORTING
          e_message_text = ls_messages-message.
    ENDIF.

    CONCATENATE result
                ls_messages-type
                ':'
                ls_messages-id
                ':'
                ls_messages-number
                ' -'
                ls_messages-message
                cl_abap_char_utilities=>cr_lf
                INTO result.

  ENDLOOP.

endmethod.

Regards,
Jocelyn Dart
Senior Consultant
SAP Australia Pty Ltd.
Level 1/168 Walker St.
North Sydney 
NSW, 2060
Australia
T   +61 412 390 267
M   + 61 412 390 267
E   jocelyn.dart at sap.com
http://www.sap.com

The information contained in or attached to this electronic transmission
is confidential and may be legally privileged. It is intended only for
the person or entity to which it is addressed. If you are not the
intended recipient, you are hereby notified that any distribution,
copying, review, retransmission, dissemination or other use of this
electronic transmission or the information contained in it is strictly
prohibited. If you have received this electronic transmission in error,
please immediately contact the sender to arrange for the return of the
original documents. 
Electronic transmission cannot be guaranteed to be secure and
accordingly, the sender does not accept liability for any such data
corruption, interception, unauthorized amendment, viruses, delays or the
consequences thereof.
Any views expressed in this electronic transmission are those of the
individual sender, except where the message states otherwise and the
sender is authorized to state them to be the views of SAP AG or any of
its subsidiaries. SAP AG, its subsidiaries, and their directors,
officers and employees make no representation nor accept any liability
for the accuracy or completeness of the views or information contained
herein. Please be aware that the furnishing of any pricing information/
business proposal herein is indicative only, is subject to change and
shall not be construed as an offer or as constituting a binding
agreement on the part of SAP AG or any of its subsidiaries to enter into
any relationship, unless otherwise expressly stated. 


-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Florin Wach
Sent: Tuesday, 22 April 2008 11:14 PM
To: SAP Workflow Users' Group
Subject: How to implement: Exception class CX_BO_TEMPORARY thrown

Hi Wuggers,

I have a simple method that declares as exception class the
CX_BO_TEMPORARY
and throws this by using the statement
RAISE EXCEPTION TYPE CX_BO_TEMPORARY.

In the workflow pattern I can see this particular outcome. So all seems
to be fine.

When the work item is executed (in background) it keeps it's status "in
work", which is fine, as the excecution isn't repeated 3 times, yet,
which usually should set this temporary error into a permanent one.

What happends is, that not error message is logged (in the detailed log
of the workflow), nor is it picked up by the report RSWWERRRE.

The system log doesn't gives me a clue about uncaught exception or
something, so I'm wondering, if someone did use the exception classes
successfully  (under ECC 7.00)


Best wishes,
Florin
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug




More information about the SAP-WUG mailing list