Application Development 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: 

dynamic report scheduling / submit report AND CONTINUE

Former Member
0 Kudos

Hi all,

I have a requirement a bit complicated for me (I've never done before): I have to launch a material price update while registering with MIGO: I found the correct exit but I cannot update, because while registering, MIGO locks material and the exit is triggered while lock is still on and so my update cannot be done; I have a report that makes update and I thought I can solve it in two ways (that I don't know if are possible):

1) in user exit, I could launch report without stopping transaction waiting report has finisched(like to start a thread ) then I should put a WAIT UNTIL n SECONDS in the report to let the MIGO release lock on material and then update data.

2) schedule a job dynamically to start n seconds after the user exit is reached so that the MIGO ends its processes and material lock is released.

Does anybody can give me an hint about these solutions?

thanks

gabriele

4 REPLIES 4

former_member555112
Active Contributor
0 Kudos

Hi Gabriele,

I finally understand your requirment.

What i suggest is that after the MIGO is done trigger a workflow.

In this workflow you can submit your program to update the material price.

An another alternative is to call a FM in background as a separate task in the BADI MB_DOCUMENT_BADI in the method MB_DOCUMENT_UPDATE.

In this FM write your code to update the material price.

When the material document is posted, this FM will start as a separate task on commit work and it will update the price.

I hope it is useful.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jul 20, 2009 8:16 PM

0 Kudos

I don't know what exactly is workflow because I am really new ni this world (can you explain me pleaz or post me some link about this); for now I solved in this way: I submit the report for update via a job scheduled in background with VIA JOB statement and in the report I wait 15 seconds for the MIGO ends.

0 Kudos

Hi,

Creating a JOB is not a ideal solution.

Since if MIGO goes into error your JOb might still run which is not advisable.

Incase you do not know a workflow then you can try the other solution.

Create a FM in which you add your code to update the material price.

Make this FM as a RFC FM.

Implement the BADI MB_DOCUMENT_BADI

In the method MB_DOCUMENT_UPDATE call this FM in background starting as a new task.

CALL FUNCTION func IN BACKGROUND TASK

DESTINATION 'NONE'

[AS SEPARATE UNIT.

DO f1 on CALL FUNCTION and read the documentation on CALL RFC function for more details.

Do not use commit work or submit or call transaction statements in this BADI. It will lead to a message termination.

Regards,

Ankur Parab

Edited by: Ankur Parab on Jul 20, 2009 8:36 PM

former_member194669
Active Contributor
0 Kudos

I will not suggest 1 option you mentioned.

1. if any user locks a for longer time, then in that case whether do your program wait till that time ?

Possible options

1. Find a after save user exit in MIGO, and code it

or

2. Within the user exit update data to custom table, then write a background program take entries from this and process. and schedule this for 2 to 5 minutes