01-17-2007 1:56 PM
what is the difference between USEREXIT_SAVE_DOCUMENT or USEREXIT_SAVE_DOCUMENT_PREPARE
01-17-2007 3:29 PM
Hi Mike,
Both are same both few things which needs to be changed between the two userexit
USEREXIT_SAVE_DOCUMENT_PREPARE . : If you want to make the validation you use this userexti and this is the last time to do the changes.
USEREXIT_SAVE_DOCUMENT : If you want ot modify the code then you can use it for this userexit.
01-17-2007 1:58 PM
Hello Mike,
The exit USEREXIT_SAVE_DOCUMENT is used to change the SO when saving it.
USEREXIT_SAVE_DOCUMENT_PREPARE
U get the data which are all changes during saving.
If useful reward.
Vasanth
01-17-2007 2:00 PM
Hi,
- USEREXIT_SAVE_DOCUMENT_PREPARE: it's triggered before saving document,
- USEREXIT_SAVE_DOCUMENT: it's triggered while saving document.
If you need to store your data in Z-TABLE, yous should use the userexit USEREXIT_SAVE_DOCUMENT instead of USEREXIT_SAVE_DOCUMENT_PREPARE:
Here you have to insert all abap code you need to update your z-table.
U should consider all saving are made in update tusk, so it should be better you create a z-function to update your z-table and call that fm in update tusk into USEREXIT_SAVE_DOCUMENT.
01-17-2007 2:01 PM
USEREXIT_SAVE_DOCUMENT is used to change the Sales Order while saving data.
USEREXIT_SAVE_DOCUMENT_PREPARE is used to get the changes done during saving.
01-17-2007 2:22 PM
The main difference is that in USEREXIT_SAVE_DOCUMENT_PREPARE you can change data in x* internal tables and these changes will be passed to DB, while in USEREXIT_SAVE_DOCUMENT - it's too late to change data in SAP internal tables (x* tables) since SAP has already passed these tables to update task FM... save_document can be used for triggering your own table (Z* table) updates, for triggering workflow events, for final validation of order info and raising error message to prevent order save.
06-05-2009 12:50 PM
Thank you!! I could'nt find the right user exit and after your post...it is working!!!
01-17-2007 3:19 PM
Hi,
Check the sap help ..
USEREXIT_SAVE_DOCUMENT
Use this user exit to fill user-specific statistics update tables.
The user exit is called up by the FORM routine BELEG-SICHERN before
the COMMIT command.
Note
If a standard field is changed, the field r185d-dataloss is set to
X. The system queries this indicator at the beginning of the safety
routine. This is why this indicator must also be set during the
maintenance of user-specific tables that are also to be saved.
USEREXIT_SAVE_DOCUMENT_PREPARE
Use this user exit to make certain changes or checks immediately
before saving a document. It is the last possibility for changing or
checking a document before posting.
The user exit is carried out at the beginning of the FORM routine
BELEG_SICHERN.
Thanks,
Naren
01-17-2007 3:29 PM
Hi Mike,
Both are same both few things which needs to be changed between the two userexit
USEREXIT_SAVE_DOCUMENT_PREPARE . : If you want to make the validation you use this userexti and this is the last time to do the changes.
USEREXIT_SAVE_DOCUMENT : If you want ot modify the code then you can use it for this userexit.
01-17-2007 3:35 PM
If you really want to see from where can you get the information regarding userexit then
Go to SPRO --> Sales and Distribution --> System Modification --> UserExits --> UserExit in Sales --> UserExit in Sales Document Processing.
Go and check out all the userexit present for Sales will find it in.