cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 2 SP3 - > Issue while Saving a Contract in VA41

former_member188001
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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?

former_member188001
Active Participant
0 Kudos

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.

former_member188001
Active Participant
0 Kudos

I tested again, even though we make changes, the changes are not getting saved. I guess, its just the slowness of the system.

Thanks Tamas.

former_member188001
Active Participant
0 Kudos

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.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

former_member188001
Active Participant
0 Kudos

Thanks Tamas for quick response.

But it is still failing, maybe I am messing up the script.

When the control exists, ie when there is a pop-up for incompletion, i need to click on Edit button.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

In step 3, you need the correct control ID - for checking if there is a popup, that would be ses[0]/wnd[1]

And I'm not sure where those \/ elements come from in your step 4 - was that the result of recording? It should just be a / if I'm not mistaken.

former_member188001
Active Participant
0 Kudos

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.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

former_member188001
Active Participant
0 Kudos

Thanks Tamas. I changed the script as below and it worked in both the cases. Thanks again.

Answers (0)