‎2005 Dec 15 5:41 AM
Dear Friends ,
While creating a Quatation thru transaction VA21 , system has to check for the same customer already is there are any open quatations aganist the same material and the user will decide whether to save the quatation or not.
I have used exit MV45AFZZ(USEREXIT_SAVE_DOCUMENT_PREPARE)
were if the above condition met i wil pop up a screen for the user to decide save it or not. If user clicks
NO , iam showing error message and the user has to go our of VA21 transaction and create a new one.
Is there is any way where i can stop the SAVE operation and allow user to change the details ?
Thanks and Regards,
Vijay
‎2005 Dec 15 6:48 AM
Hi,
There is a variable called <b>DA_SUBRC</b> which is normally used during Save to stop save at certain stages..
So I suggest when user clicks NO, set DA_SUBRC = 4 inside USEREXIT_SAVE_DOCUMENT_PREPARE and give an info message.
Check this out and get back if you have doubts..
<b>Did this help or not?</b>
Hope this helps..
Srikanth
Message was edited by: Srikanth Pinnamaneni
‎2005 Dec 15 5:43 AM
if he says 'NO' then give error message, then it may stop. or try to exit form the trxn.
‎2005 Dec 15 5:46 AM
HI Vijay,
Thanks for your quick response.
I have given error message. But its not enabling the user to change the details. What i need is , after error message user need to change the details and save it once again.
Regards,
Vijay
‎2005 Dec 15 5:48 AM
is it a custom field on screen, i mean did you added that field.
regards
vijay
‎2005 Dec 15 5:58 AM
Hi Vijay ,
No. The routine which i have written will check is there is any quatations already created for the customer is so it will pop-up a message and for user to decide to save it or not.
If he do not want to save it , the user should able to change the details.
Hope its clear...
Regards,
Vijay
‎2005 Dec 15 6:03 AM
after he says No , then try to use <b>leave to screen 0</b>.
it will work..
‎2005 Dec 15 6:35 AM
Hi Vijay,
It is not working. It's is coming out from the transaction.
Regards,
Vijay
‎2005 Dec 15 6:38 AM
or do you know the screen number then you can try like this
set screen 500 (number).
leave screen.
try this...
‎2005 Dec 15 6:17 AM
i think if he says NO, then a PAI module should run which wud call the screen again with the earlier details he had entered. Then he can change the details again.
Please acknowledge if it works. m also new in user-exits.
Regards,
Bikash
‎2005 Dec 15 6:48 AM
Hi,
There is a variable called <b>DA_SUBRC</b> which is normally used during Save to stop save at certain stages..
So I suggest when user clicks NO, set DA_SUBRC = 4 inside USEREXIT_SAVE_DOCUMENT_PREPARE and give an info message.
Check this out and get back if you have doubts..
<b>Did this help or not?</b>
Hope this helps..
Srikanth
Message was edited by: Srikanth Pinnamaneni
‎2005 Dec 15 7:37 AM
Hi Srikanth ,
I tried to assign DA_SUBRC = 4 inside my User Exit but it gives..me a compilation error that object not declared.
Can you help..me to overcome this problem
Regards,
Vijay
‎2005 Dec 15 7:57 AM
Hi Vijay,
Sorry it's my fault, it was local variable which I mistook for a global variable. Then I can think of another option when user clicks on NO which is following,
FCODE = 'ENT1'.
PERFORM fcode_bearbeiten.
Hope this helps..
Sri
‎2005 Dec 15 8:04 AM
Hi Srikanth ,
Thanks for your reply.
I have tried this option also. Its not working.
Regards,
Vijay
‎2005 Dec 15 8:13 AM
Hi Vijay,
I am assuming that you are not giving an error message any more (try giving a warning or info message) and then try some thing like the following, (I know this is getting redundant but I found it one of our customer's systems)..
fcode = 'ENT1'.
LEAVE TO SCREEN sy-dynnr.
Hope this helps..
Sri
‎2005 Dec 15 8:15 AM
try one of these
set screen 'number'.
leave screen.
or leave to screen 'number'..
regards
vijay