cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order to be blocked in a single batch job

Former Member
0 Kudos

Hi


we requirement where in if a sales order is being used in a batch job for delivery creation then it should be included into another batch job which is also running for delivery creation.

I tried some locking Function Modules but it is blocking even creation of the delivery also while locking the sales order,

Thanks

Raj

Accepted Solutions (0)

Answers (3)

Answers (3)

Jelena
Active Contributor
0 Kudos

I'm also confused what is the purpose of running two delivery creation processes at the same time and why is it required for an order ro be processed by both instances.

When delivery creation starts, the whole order gets locked - it's a standard functionality. One (but not the only) good reason for this is that delivery creation also updates order status at both line and header level. How do you envision this would work with two processes updating the same order simultaneously?

Maybe I'm mising someting, but such requirement just doesn't make any sense to me from the technical standpoint.

Former Member
0 Kudos

Hi Jelena,

Here is a scenario,

We have a DDL running which creates different jobs based on certain criteria (which could be shipping point or sales organization), now if we have sales order that is large (more than 50 Items), it will take some time to confirm and process so entry is there in VEPVG table. Since batch job is running for every hour if this order was picked by batch job during last minute, then the next job also will start and will pick this order since this is not locked.

This is happening frequently while we run batch jobs for DDL and this causing an issue for the batch job to fail or error log generated.

I hope you understand the issue now.

Thanks

Raj

Jelena
Active Contributor
0 Kudos

I would suggest to set up the variants/jobs in such a way that DDLs don't "run into each other". E.g. Sales Org is at the order header, so if you have DDL running for different SOrgs, they shouldn't lock the same order. If this is happening (i.e. a DDL run locks an order that doesn't meet the selection criteria) then a message should be sent to SAP.

The jobs schould also be scheduled to allow enough time for the first job to complete before the next job starts. But if the job runs every hour and can't be completed in one hour, then there must be some kind of a performance issue - DDL doesn't really take much time. Perhaps this should be looked at by an ABAPer/Basis.

On the functional side I really doubt anything could be done about this - sorry!

Former Member
0 Kudos

Raj,

You have a "wrapper" program which creates DDLs using some condiitons.

you just need to set the lock (better - record in custom table or use shared memory object) by each DDL job for their corresponding level (shipping point or sales org or...) and remove it when job is finished.

"Wrapper" program before submitting new job should check if there is active job running for the same level.

We've implemented similar logic,  it handled even manual DDLs (online program runs). It stored job info for batch jobs and user info for online DDLs and then "wrapper" program checked if the job is still active or if user is still running DDL online for the same level before submitting new job.

Former Member
0 Kudos

Hi Venkat,

Just for my understanding... When you say another job... is the same job running in a different slot.

For example: Order creation job is running at 11 AM... then the 11 am job picks up some order at around 11.58 am... Then the next job scheduled after one hour at 12 pm... should start ideally.

But in reality, when the first job is running, it would be updating the table and the order would be locked completely. Once the first job is complete, then the second job starts.

I have never come across a situation where a order is locked by a batch and the next batch is able to access it.. the reason being, the sales order details are always updated at table level.

Regards

Vamshi

Former Member
0 Kudos

Hi Sergey,

Yes this is what we did, we built a ZTABLE for sales orders with job number and checked this entry while running the next job.

It works correctly, it should be fine now, we are in the process of approvals from Business on this design.

Thanks every one who have shared your comments on this.

Regards

Raj

former_member182378
Active Contributor
0 Kudos

Raj,

From my understanding the requirement is as follows -

If a sales order is being process in a particular job (for the creation of delivery), then this sales order should be process in another job too.

Also, both these jobs are executed at the same time.

Is my understanding correct?

Why do you want both the jobs to run at the same time?

What is the result of the first and second jobs?

Former Member
0 Kudos

T W,

Yes your understanding is correct partly,

Here is a scenario,

We have a DDL running which creates different jobs based on certain criteria (which could be shipping point or sales organization), now if we have sales order that is large (more than 50 Items), it will take some time to confirm and process so entry is there in VEPVG table. Since batch job is running for every hour if this order was picked by batch job during last minute, then the next job also will start and will pick this order since this is not locked.

This is happening frequently while we run batch jobs for DDL and this causing an issue for the batch job to fail or error log generated.

I hope you understand the issue now.

Thanks

Raj

former_member186385
Active Contributor
0 Kudos

Hi,

In the Job you can get the underlying program ( RVV50R10C as per standard) and click on the sales order and exclude the sales order which you don't want to include in the job processing

hope it is clear

regards,

santosh