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

Asynchronous function

FredericGirod
Active Contributor
0 Likes
763

Hello,

I need to add a line in a table (c) with data of two tables (a) (b). I have only one user-exit and it reads the data of only one table (a). I need both data of (a) (b) to add a line in (c). The user-exit is at the commit of the table (a), the commit of the table (b) comming just after.

I think to create an asynchronous function, call it in the user-exit and wait the commit of the table (b).

My user-exit is already call in an asynchronous function.

So, do you think it's dangerous to have two asynchronous function launch in the same time ? (process problem)

How would you do to wait a commit ? wait n seconds ? or there is a way to wait a commit on a table ?

Regards

Frédéric

1 ACCEPTED SOLUTION
Read only

christian_wohlfahrt
Active Contributor
0 Likes
602

Hi Frédéric!

You should search for different options.

Statement 'call function ... starting new task / in background' may trigger an implicit commit work -> this has to be avoided (at all costs), since later rollback work won't clear up whole transactions.

How about writing change pointers in exit for (a) and (b) - can be done without commit; only message (WE81) has to be customized, pointer activated (BD50) and CHANGE_POINTERS_CREATE_DIRECT can be used. Later you can read both entries 'asynchron' by a job.

Regards,

Christian

4 REPLIES 4
Read only

christian_wohlfahrt
Active Contributor
0 Likes
603

Hi Frédéric!

You should search for different options.

Statement 'call function ... starting new task / in background' may trigger an implicit commit work -> this has to be avoided (at all costs), since later rollback work won't clear up whole transactions.

How about writing change pointers in exit for (a) and (b) - can be done without commit; only message (WE81) has to be customized, pointer activated (BD50) and CHANGE_POINTERS_CREATE_DIRECT can be used. Later you can read both entries 'asynchron' by a job.

Regards,

Christian

Read only

0 Likes
602

Hi Christian,

Thanks for you repply,

Your solution looks very interesting, I never play with things like that. Do you know where I could find documentation ? I look in help.sap.com but I don't find a real doc.

I work in MSEG & MSEGO2 (OIL) this is not too big for this solution ?

Frédéric

Message was edited by: Frédéric Girod

Read only

0 Likes
602

Hi!

it's no problem - with appropriate server - to have 1 million change pointers per day (and jobs handling this).

Menu points for this settings are behind:

workbench - ALE - ALE development - IDOC - change service (free translated, but you should find it anyway). Documentation is linked to this key words, too.

But ALE-scenarios are much more sophisticated and have nothing to do with my process description.

Start was already described.

Your job should contain following:

FM CHANGE_POINTERS_READ

Your (a), (b), (c) handling

FM CHANGE_POINTERS_STATUS_WRITE

Daily or weekly BD22 'archiving'.

If you plan this job in higher frequency then your runtime (every 5 minutes, sometimes runtime of job is longer -> two active jobs), move ...status_write in the beginning (+ commit work) -> then second job only reads new pointers, not same again.

Regards,

Christian

Read only

0 Likes
602

Thank a lot for this answer Christian, I can stop borring SAP OSS now

Regards

Frédéric