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

User Exit VA21

VijayasekarK
Active Participant
0 Likes
1,527

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,384

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

14 REPLIES 14
Read only

Former Member
0 Likes
1,384

if he says 'NO' then give error message, then it may stop. or try to exit form the trxn.

Read only

0 Likes
1,384

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

Read only

0 Likes
1,384

is it a custom field on screen, i mean did you added that field.

regards

vijay

Read only

0 Likes
1,384

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

Read only

0 Likes
1,384

after he says No , then try to use <b>leave to screen 0</b>.

it will work..

Read only

0 Likes
1,384

Hi Vijay,

It is not working. It's is coming out from the transaction.

Regards,

Vijay

Read only

0 Likes
1,384

or do you know the screen number then you can try like this

set screen 500 (number).

leave screen.

try this...

Read only

Former Member
0 Likes
1,384

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

Read only

Former Member
0 Likes
1,385

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

Read only

0 Likes
1,384

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

Read only

0 Likes
1,384

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

Read only

0 Likes
1,384

Hi Srikanth ,

Thanks for your reply.

I have tried this option also. Its not working.

Regards,

Vijay

Read only

0 Likes
1,384

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

Read only

0 Likes
1,384

try one of these

set screen 'number'.

leave screen.

or leave to screen 'number'..

regards

vijay