‎2011 Aug 30 11:51 AM
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,
‎2011 Aug 30 12:51 PM
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