on 10-29-2015 7:29 PM
Hello all,
I am trying to SAVE a contract via VA41. A script button is written which will first make a call to Incompletion Log button, if the message is successful, then I am pushing SAVE button. The script works fine but the only thing is, after it checks the incompletion log, it waits for few seconds which is sort of incorrect as the user can make additional changes...I am attaching the script for review and suggestions.
Any help is appreciated.
Thanks,
Salil
I don't really understand what is incorrect here... saving the document needs some time and depending on the load on the system, it may take a few seconds if the update task is busy. During this time the document remains locked so there should be no way for any user to make changes to the same document. Or what 'additional changes' did you mean?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are correct Tamas based on standard SAP functionality, but between after the Incompletion check and SAVE, I am able to edit the document. Ideally the document should be locked for any changes...is there a way to achieve this ...i dont want the user to edit instead of waiting for the commit to happen.
I have to reopen this issue as it is causing the problem.
After creating Contract in VA41, if I hit SAVE, then there is a 2 step process that SAP does
1) Checks for Incompletion - Here it gives pop-up
If the document is complete, it does not give any popup.
2) Commits
If my document is complete, the script works fine.
When my document is not complete, I get the following script error.
I need a script that would handle both the conditions without breaking.
Following is my script.
Your script would have to query whether there is a popup alerting to the incomplete document, and handle that situation accordingly.
Sounds like your script already handles the "happy path" when the document is complete. Add logic to check whether the incompletion popup appeared - you have a 'control exists' condition for this in scripting. If there is a popup, you could click on the 'Save' button.
Don't forget a 'Refresh Screen' before using the IF control exists condition.
Thanks Tamas.
I implemented the things suggested by you. But there is a weird thing that happens. If the pop-up comes, i want to click on Edit so that it will take me to the fields for completing the contract. But it so happens that, the contract gets Saved ie On the pop-up we have 3 options : Save, Edit, Cancel.
Although I have script for Push Edit still it looks like, it selects Save. Dont know how to override that behavior. Following is my script.
Well, does it really save the order? I'm just asking because right after your script presses the Edit button, it also starts a new transaction. I'd think that if Edit is pressed, then you wouldn't want to immediately leave to another transaction because the user will not have the chance to actually perform the edit.
In other words, to me it seems that you need to separate the logic of what happens when there is a popup and you'd want to edit the document vs. when there is no such popup and the document is complete.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.