Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UPDATE TASK and STARTING NEW TASK

Former Member
0 Likes
1,378

Hi guys,

Here's the challenge.

When posting a document, I want to run a program that prints a layout for that document.

Prerequesite #1: I want to use a program to be used outside this, therefore all data should be read from database

Prerequesite #2: Canceling printing should not cancel the posting

Solution #1: Database reading whlie posting can be done with update task, or perform on commit.

Solution #2: Printing interface can the independent with starting new task.

Problem: How do I maintain these two?

Using update task inside starting new task, does not work since there is no COMMIT WORK in the update task code.

Using starting new task inside update task, causes errors with some abap commands and interface as far as I checked.

Thanks in advance,

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
603

Hi,

... Canceling printing ...

I guess you mean "any runtime error during print processing".

Prerequesite #1: I want to use a program to be used outside this, therefore all data should be read from database

Prerequesite #2: Canceling printing should not cancel the posting

Problem: How do I maintain these two?

You could use tRFC (call function ... in background task). It will be executed during the COMMIT WORK, after the update task has been run successfully. In case of failure, you can manage it using SM58.

Using update task inside starting new task, does not work since there is no COMMIT WORK in the update task code.

Sure, COMMIT WORK is forbidden inside update tasks, because the update task is started by COMMIT WORK.

Using starting new task inside update task, causes errors with some abap commands and interface as far as I checked.

starting an RFC commits database, so it must be used very carefully during an update task (always before any database update)

Sandra