06-27-2015 8:05 PM
Hi Experts,
I need to populate the reason for rejection(VBAP-ABGRU) when the sales document is created.
I found a SAPNOTE334524 to change the reason for rejection. However, this note is implemented in USEREXIT_SAVE_DOCUMENT_PREPARE.
I need to change this field in USEREXIT_SAVE_DOCUMENT because some parameters of PREPARE userexit is not yet populated at the moment.
****SAPNOTE334524****
LOOP AT xvbap WHERE updkz NE updkz_delete .
svbap-tabix = sy-tabix.
PERFORM vbap_bearbeiten_vorbereiten(sapfv45p).
vbap-abgru = 'ZP'. "<===== enter your rejection code
PERFORM vbap_bearbeiten(sapfv45p).
PERFORM vbap_bearbeiten_ende(sapfv45p).
ENDLOOP.
****SAPNOTE334524****
I also tried to copy this code in USEREXIT_SAVE_DOCUMENT but it does not work. TIA.
Regards,
Paul More
06-29-2015 5:39 AM
Hi Paul.
Please goto SPRO -> Sales and Distribution -> System Modification -> UserExits -> UserExit in Sales --> UserExit in Sales Document Processing.
There you can read, that USEREXIT_SAVE_DOCUMENT_PREPARE is the last possibility to change the sales document data.
But both USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT are called from form BELEG_SICHERN. So what are you missing in form USEREXIT_SAVE_DOCUMENT_PREPARE ?
Regards,
Klaus
06-29-2015 5:39 AM
Hi Paul.
Please goto SPRO -> Sales and Distribution -> System Modification -> UserExits -> UserExit in Sales --> UserExit in Sales Document Processing.
There you can read, that USEREXIT_SAVE_DOCUMENT_PREPARE is the last possibility to change the sales document data.
But both USEREXIT_SAVE_DOCUMENT_PREPARE and USEREXIT_SAVE_DOCUMENT are called from form BELEG_SICHERN. So what are you missing in form USEREXIT_SAVE_DOCUMENT_PREPARE ?
Regards,
Klaus
07-01-2015 10:10 PM