Skip to Content
avatar image
Former Member

Raise exception in sap workflow

Hi,

I have a requirement in one of workflow step I am doing some sales order updates when update fails am using Raise statement like 'Raise Order locked'. i did debug my code is working and exception is triggering.

But when i see work item error log error says 'Person doesn't exist 1130016 P'.

1. why this error message is coming

2. why exception details are not displaying which i have raised

3. work item is getting fail but some of updates are getting save in database. I dont want to save the changes in database if any error occur.

Please suggest.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • How are you:

    Performing the update, catching the failure, raising the exception? And how is it handled?

  • Former Member Mike Pokraka

    In step, am using oo method. I have created exception(mail_not_sent) for the method in se24.

    eg:

    method step2.

    ------

    update ztable from lt_tab

    lf lv_update is good.

    try

    send email(importing ev_return = lv_return )

    if lv_return = 4.

    Raise Mail_Not_sent.

    endif.

    endtry.

    endif.

    endmethod.

    I am doing Sales order update then sending email. if I get any exception while sending email I want to fail the work item and Sales Order changes should not save in the database.

    Let me know if it is not clear.

    Thanks, Awaiting response.

  • Get RSS Feed

1 Answer

  • Nov 21, 2017 at 06:59 AM

    There's still a lot of guessing with the pseudocode you provide, but from what I can see this is a straightforward ABAP issue. Please call it from a report and get it to work, then you'll be fin in WF.

    A couple of hints:

    - Use OO exceptions,

    - If you're doing this in WF, I would separate distinct business operations. So posting and sending an email would be separate steps, this makes much clearer and is easier to troubleshoot.

    - Regarding saving, you say you're updating a sales order but post pseudocode that your're updating a Z table, so we have no idea what you're really doing. There is no transaction or rollback, so updates are immediate.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I was trying to follow this.

      https://blogs.sap.com/2013/04/25/use-exceptions-in-abap-oo-workflow-with-custom-text/

      In the oo method added the exception CX_BO_TEMPORARY and in the method coding if my validation fails then I put the code like below.

      RAISE EXCEPTION TYPE CX_BO_TEMPORARY EXPORTING textID = '002342DFG56FD98WKREW923S323'.

      but I am getting warning messages as below. Please let me know am I following right process.

      Old exceptions and class-based exceptions cannot be used at the same time.

      The exception CX_BO_TEMPORARY is neither caught nor is it declared in the RAISING clause of "MEHOD_NAME****".

      Awaiting for your response.