Skip to Content
author's profile photo Former Member
Former Member

a addition question about update task

Hi, everybody.

I have ask a question about update task yesterday, do you remeber?

I assign several update/insert actions in a function, and call it in a update task way.

As there are several tables should be deal with, if return an error, how to know which table update/insert is failed in this update task.

it looks like this:

function XXXXX

insert talbeA ....

update tableB .... (if there is an error)

end function.

call function XXXX in update task.

commit work and wait.

if sy-subrc <> 0 .


if failed, how can I know the error is due to tableB?

As the function can't return anything in update task mode by parameter, I try some crossing-program mechansim.

I used the Import/export(both ABAP memory and cluster mode), try to use export in funcion to trap(export a flag after every update/insert), and import trap result after commit. when result successful, trap is correct,but when error occur, the import is also null.

Can anyone give me some suggestion, in which way I can get I want. by which technology?

Any suggestion is welcome.

thanks a lot

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2005 at 11:36 AM

    Hi Zhenglin,

    This is not really possible when using the CALL FUNCTION ... IN UPDATE TASK.

    As I stated in the previous thread, all checking is supposed to occur prior to the UPDATE FM call, and therefore you really shouldn't have to check the success of the UPDATE FM. Therefore SAP doesn't really provide the capability of diagnosing failures (other than sy-subrc ne 0) from the calling program. Transaction SM13 is provided for this, and usually should only be available to system administrators.

    As you are using the COMMIT WORK AND WAIT command, can I suggest that if you really want to know the details of the update, that you just call your function normally (without the IN UPDATE TASK) addition and either raise exceptions or set a return parameter which you can interpret in your calling program. The results for the update will be the same, but you will get the benefit of error handling plus it will be more efficient (only one work process involved, not two).

    Hope that helps.


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2005 at 12:07 PM

    Thanks, Brad.

    As I have tried several ways in this two days, it looks no way to get the more details datebase operation error in a update task.

    So, you are right, Brad, I think the better way is do all of the validation work before update/insert(business check), and get the sy-subrc after update/insert(datebase operate result).

    At last, it seems I should negotiate with my client to make him abandon the requirement.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      No problems Zhenglin,

      Can you please close the thread.

      As stated earlier its really helpful if you do.

      You have two options:

      1. Against your original post you have "solved it on my own"

      2. Against any of other peoples responses, you have "solved problem".



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.