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

put a delay in the code

Former Member
0 Likes
2,329

In a delivery user exit,

Is there a way to tell the program to execute a particular function module 2 minutes after it SAVES the document?

11 REPLIES 11
Read only

Former Member
0 Likes
1,920

try

WAIT UP TO 120 SECONDS.

Read only

Former Member
0 Likes
1,920

Hey..

Use wait..it worked for me..

WAIT UP TO 5 seconds.

Check the duration of time other process needs to complete and then specify the time.

Regards,

KC

Read only

Former Member
0 Likes
1,920

Hi,

Press F1 Help on WAIT. That is the only possible way to delay the program.

Thanks,

Babu Kilari

Read only

Former Member
0 Likes
1,920

Hi,

You have to use

WAIT UP TO 10 seconds statement.

Regards,

Jyothi CH.

Read only

0 Likes
1,920

Thanks for all the repsonses. Sorry I was out for a while. The code is in the user exit which triggers after hitting the SAVE button when the delivery is being created. I want the function module to execute 120 seconds after the delivery is saved

Read only

0 Likes
1,920

As suggested by others you should use the WAIT statement to acheive your requirement.

what function module you are calling, is it a standard one or z?

Regards

Karthik D

Read only

0 Likes
1,920

My problem is as follows.

I go to sales order in change mode and do Sales Order--> Deliver

Then when the delivery is saved, sales order is still in change mode as I started from the sales order in change mode. While doing this I need to update the order quanity of sales order with the delivery quantity (as they will always be off by few percentage poitns) by going in to the same sales order. I do this through BAPI_SALESDOCUMENT_CHANGE and BAPI_TRANSACTION_COMMIT.

When the sales order is changed it puts the sales order on credit hold. I need to undo it

I try to do this though CALL FUNCTION 'SD_ORDER_CREDIT_RELEASE' but I get a message saying the sals order is locked. It will be unlocked only once te delivery is saved. How do I make this function mdule execute after the delivery is saved.

Read only

0 Likes
1,920

Hi,

Instead i suggest you to go for user exit routines available and change the item quantity before the SO gets stored.

There are several form routine to help you achieve your requirement.

Regards

Karthik D

Read only

0 Likes
1,920

Ite, quantity is changing fine with the BAPI. Its the credit that needs to be released with the function module 'SD_ORDER_CREDIT_RELEASE'

Read only

Former Member
0 Likes
1,920

Hi,

Refer these FM's

SWE_CD_TST_DELAY

TH_DELAY_FUNC_TEST

C14Z_WAIT_N_SECONDS

Regards,

Jyothi CH.

Read only

rainer_hbenthal
Active Contributor
0 Likes
1,920

First of all, this is really a weired whish. Why do you want to do so? There must be a really good reason for that, cause all those suggesting the wait keyword didnt mention that the wait will do a DATABASE COMMIT and i'm really in doubt that you want to have this in a user exit where you dont have control when und who is executing that.

Telling the reason for that may lead to a good solution. Using wait isnt one.