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 for VA01/VA02

Former Member
0 Likes
4,099

Hi,

I'm looking for a user-exit which will prevent the save/modification of a sales order given certain conditions. Right now, I'm using MV45AFZZ (FORM USEREXIT_SAVE_DOCUMENT_PREPARE). This works when pressing the save button. However, when user presses on the cancel button, they are prompted if they want to save or cancel. when pressing on SAVE the document is still saved. Is there a way to suppress this or is there a way to invoke another user-exit when this dialog message is displayed?

Please let me know if you have any ideas or suggestions. Thanks

Hi,

I'm looking for a user-exit which will prevent the save/modification of a sales order given certain conditions. Right now, I'm using MV45AFZZ (FORM USEREXIT_SAVE_DOCUMENT_PREPARE). This works when pressing the save button. However, when user presses on the cancel button, they are prompted if they want to save or cancel. when pressing on SAVE the document is still saved. Is there a way to suppress this or is there a way to invoke another user-exit when this dialog message is displayed?

Please let me know if you have any ideas or suggestions. Thanks

7 REPLIES 7
Read only

Former Member
0 Likes
2,399

Hi,

User exit of VA01/VA02

SDAPO001 Activating Sourcing Subitem Quantity Propagation

SDTRM001 Reschedule schedule lines without a new ATP check

V45A0001 Determine alternative materials for product selection

V45A0002 Predefine sold-to party in sales document

V45A0003 Collector for customer function modulpool MV45A

V45A0004 Copy packing proposal

V45E0001 Update the purchase order from the sales order

V45E0002 Data transfer in procurement elements (PRreq., assembly)

V45L0001 SD component supplier processing (customer enhancements)

V45P0001 SD customer function for cross-company code sales

V45S0001 Update sales document from configuration

V45S0003 MRP-relevance for incomplete configuration

V45S0004 Effectivity type in sales order

V45W0001 SD Service Management: Forward Contract Data to Item

V46H0001 SD Customer functions for resource-related billing

V60F0001 SD Billing plan (customer enhancement) diff. to billing plan

Reagrds,

Anirban

Read only

Former Member
0 Likes
2,399

Hi Denz .,

I dont think You can find an Exit for that .

its an SAP Standard Functionality to reconfirm the cancel operation . Becuse some Click Cancel By mistak they can not get the data back , if you skip the reconfirmation option .

thanks

Sreenivas

Read only

Former Member
0 Likes
2,399
I'm looking for a user-exit which will prevent the save/modification of a sales order given certain conditions. Right now, I'm using MV45AFZZ (FORM USEREXIT_SAVE_DOCUMENT_PREPARE). This works when pressing the save button. However, when user presses on the cancel button, they are prompted if they want to save or cancel. when pressing on SAVE the document is still saved. Is there a way to suppress this or is there a way to invoke another user-exit when this dialog message is displayed?

You are almost on right track. in same routine do one thing just restrict user by checking the certtain condition by putting the error message.

no need to exit here.just use error message once you check the certain condition.

Amit.

Read only

0 Likes
2,399

what is the best flag for this?

sy-ucomm eq 'YES'?

Read only

Former Member
0 Likes
2,399

Use FORM USEREXIT_SAVE_DOCUMENT in stead of

FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

Read only

Former Member
0 Likes
2,399

Hi,

You can write your code in user exit MV45AFZZ

of FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

Eg.

if sy-subrc NE 0.

message i001(00) with 'error while save'.

leave to transaction sy-tcode.

endif.

Regards,

Raju

Read only

Former Member
0 Likes
2,399
what is the best flag for this?

sy-ucomm eq 'YES'?

No sy-ucomm check would be needed.

only check should be placed by somthing like that

if sy-tcode = 'VA02' or 'VA02'.

if your condition check.

message.

endif.

endif.

cause system automaticaly triggers that routine when SAVE triggers

Amit.

Edited by: Amit Gujargoud on Aug 27, 2008 9:17 AM