cancel
Showing results for 
Search instead for 
Did you mean: 

Need to introduce a time lag into a script ...

Former Member
0 Kudos

I'm working on a variation of VA02 and I'm trying to simplify data entry. There are 3 different types of material that can go onto the sales order; most of the data is the same but there are technical differences the user doesn't need to know about (for instance the line item value is assigned to a different pricing condition depending on what material is used.

This all presented a number of challenges but I've ended up with a design where I am in a flavour of VA02 and input some line item data.

I use script buttons to take that data and use a WebRFC to update the order appropriately .... but of course I'm in the order already ... tricky.

SO ... I flip to VA03 - make the RFC call, and then flip back to VA02 .... sounds good - right?

BUT - the flip back to VA02 fails as the the system still believes the order is being processed ... D'oh!!

Does anyone have any thoughts on how to put a delay in to give the system a chance to catch up with the script?

Hmmmmm..... I probably should have started off in VA03 and used script calls to update .... D'oh!!!

Regards.

Patrick.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos


Guys - thanks for the replies ... I got around this is the end by using my own suggestion of starting the process from VA03 and not VA02 and therefore problem conflict doies not arise.

Regards.

Patrick

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm not sure I fully understand your design, what exactly are you trying to do and why... but:

As Steve suggested, the best way to do something like this would be taking care of the delay during a WebRFC. The WebRFC could check whether the order in question is still locked and wait until it has been released, then give control back to your script in the flavor.

Former Member
0 Kudos

Since you're calling a WebRFC anyway, why not just code the delay in there in ABAP? I can't think of another way to do it. There's no easy "sleep" function in Javascript...

The delay you need will obviously depend on system load - you're waiting for a background update task to finish and for locks to be released. How quickly that happens depends on what else is going on on the system.

Steve.