How to implement: Exception class CX_BO_TEMPORARY thrown
Florin Wach
florin.wach at gmx.net
Thu Apr 24 04:41:49 EDT 2008
Hi,
ok, this beast was nasty:
I was using the ENQUEUE-Function with COLLECT=X and the Function FLUSH_ENQUEUE to request them all at once (all within the method).
If this doesn't work, I raise the exception.
Later on, the TransactionManager object is also calling the FLUSH_ENQUEUE function (at CL_SWF_RUN_TRANSACTION_MANAGERCP->Save), but does not catch any EXCEPTIONS, so the tRFC gets aborted and the table SWWLOGHIST isn't updated due to the DB-rollback.
Probably the enqueue-package was persistent enough for the next debuggin sessions when I changed the source code (to figure out, where the problem was), so I got the same (bad) results, even though the coding was fine.
Solution: Call Function RESET_ENQUEUE after unsuccessful FLUSH_ENQUEUE
The rest with the ABAP-OO-Workflow seems to be working fine.
Best wishes,
Florin
-------- Original-Nachricht --------
> Datum: Thu, 24 Apr 2008 09:20:03 +0800
> Von: "Dart, Jocelyn" <jocelyn.dart at sap.com>
> An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> Betreff: RE: RE: How to implement: Exception class CX_BO_TEMPORARY thrown
> Hmmm ... well I've used it in ECC 6.0 in a couple of different support
> packs without problem and after function calls so perhaps it because you are
> using a DESTINATION statement in your RFC call?
>
> Have you tried a FM call without DESTINATION?
> Regards,
> Jocelyn
>
> ________________________________
>
> From: sap-wug-bounces at mit.edu on behalf of Florin Wach
> Sent: Wed 23/04/2008 7:11 PM
> To: SAP Workflow Users' Group
> Subject: Re: RE: How to implement: Exception class CX_BO_TEMPORARY thrown
>
>
>
> Hi Jocelyn,
>
> thanks for sharing that piece of coding, as I was wondering about the
> error's message text anyway ;-)
>
> As with the exception itself, I'm using the same RAISE statement, but it's
> still not working as expected. I have found out, that it works fine, as
> long, as there's no statement "CALL FUNCTION" before the RAISE statement. It
> doesn't matter, which function you're calling.
>
> * CALL FUNCTION 'RFC_PING' DESTINATION 'BACK'.
> CLEAR: sy-msgno, sy-msgid, sy-msgv1, sy-msgv2, sy-msgv3,
> sy-msgv4, sy-msgty.
> RAISE EXCEPTION TYPE CX_BO_TEMPORARY.
>
> Works fine: The workflow log says: "Temporary exception..." and the report
> RSWWERRE picks it up.
>
>
> CALL FUNCTION 'RFC_PING' DESTINATION 'BACK'.
> CLEAR: sy-msgno, sy-msgid, sy-msgv1, sy-msgv2, sy-msgv3,
> sy-msgv4, sy-msgty.
> RAISE EXCEPTION TYPE CX_BO_TEMPORARY.
>
> Doesn't work. Message: "Execution will continue in backgroun" (ha ha, I
> remember some previous thread here), and the exception is not logged at all.
>
> To confirm this, I have used the statements above as the *very first*
> statements in the coding of the object method.
>
>
> I will now try to use an instance of an exception class to see what
> happends. If I'd guess, I'd say it's a kernel problem with the ABAP runtime.
> We're using SAP ECC 6.0, SAP Basis 700 SAPKB70013, Kernel 700, Sup Pkg 139,
> ABAP Load 1563, CUA 30.
>
>
> Best wishes,
> Florin
>
>
>
> -------- Original-Nachricht --------
> > Datum: Tue, 22 Apr 2008 22:09:24 +0800
> > Von: "Dart, Jocelyn" <jocelyn.dart at sap.com>
> > An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> > Betreff: RE: How to implement: Exception class CX_BO_TEMPORARY thrown
>
> > 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 <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
> >
> > _______________________________________________
> > SAP-WUG mailing list
> > SAP-WUG at mit.edu
> > http://mailman.mit.edu/mailman/listinfo/sap-wug
> _______________________________________________
> 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