I am trying to code for reason of rejection in doc_check_badi however facing issues in implementing the functionality
We have placed a custom code in DOC_CHECK_BADI to have the approval note as mandatory while the SC is rejected . This is the piece of code in DOC_CHECK BADI
* Check if user Rejected the Shopping Cart
IF lv_decision EQ 'REJECTED'.
* Read Approval Note
SORT lt_appnote BY guid.
READ TABLE lt_appnote ASSIGNING <fs_appnote>
WITH KEY guid = iv_doc_guid BINARY SEARCH.
IF sy-subrc EQ 0.
CHECK <fs_appnote> IS ASSIGNED.
IF <fs_appnote>-tdid NE 'NOTM'.
* Save error message
ls_messages-msgty = zsrm_if_wf_constans=>gc_msg_type.
ls_messages-message = 'Please enter reason for rejection'.
APPEND ls_messages TO et_messages.
ENDIF.
*********START OF MODIFICATION for making reason of rejection Manadatory ************************ "001
ELSE.
* Save error message
ls_messages-msgty = zsrm_if_wf_constans=>gc_msg_type.
ls_messages-message = 'Please enter reason for rejection'.
APPEND ls_messages TO et_messages.
Case 1 : When trying through UWL buttons --- not working
Case 2 : When clicking on Submit ---- not working
Case 3 : when clicking on Check --- working and throws the error message ‘Please enter the reason of rejection
We want case 1 and case 2 to work like case 3 and also would like to work this for line item based rejection as well .
We are in SRM_SERVER 701 0009 SAPK-70109INSRMSRV SRM_SERVER
Do you think we should apply the below notes ?
1621624 - SC cannot be rejected because of document error messages
1565582 - SC item based rejection cannot carry out due to errors
I tried to download the note in my system and status says : Cannot be implemented
Please see the attached screenshots for reference ..
Case 1 : When clicking from UWL buttons it goes into DOC CHECK BADI and checks for the code however it still lets the approver reject the SC without reason of rejection it justs gives a warning no error message as is written in doc_check
Case 2 : When clicking on Submit button without entering the reason of rejection it is not stopping in DOC_CHECK_BADI . Thus reason of rejection is not being mandatory and gets successfully submitted . Thus it is not working ..
Case 3 : When clicking on the check button it works