cancel
Showing results for 
Search instead for 
Did you mean: 

SRM 7.0 Issue

Former Member
0 Kudos

Hi Experts,

This issue is in the implementing of SRM 7.0 and in the rejection scenario of the Shopping Cart (thru SRM portal), we want to make the "Approval note" a mandatory field to be filled in by the Approver.

The following is what I have done thus far:

1. In the implemented class: ZCL_IM_SC_VALIDATE.

2. Use Function Module BBP_PD_SC_GETDETAIL to get E_LONGTEXT.

3. Use method GET_CURRENT_DECISION of class /SAPSRM/CL_WF_APV_FACADE to get current decision.

4. Check if current decision is REJECTED.

5. Check if E_LONGTEXT has TDID = NOTM.

6. Populate error message u201CEnter Rejection Reason in Approval Noteu201D on to ET_MESSAGE.

But when the approver clicks on REJECT button on the UWL, the SRM portal throws an exception. This exception is in class /SAPSRM/CL_PDO_BO_SC method CHANGE_DOCUMENT.

Thanks in advance,

Thembass.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Themba,

This sounds like a requirement we had to implement in our system. It was tricky, but we got it. Someone else on this forum mighthave a better method, but here is what we did:

1.) Enhance class /SAPSRM/CL_CH_WD_BOM_SC and add a Pre-Exit to method /SAPSRM/IF_CLL_BOM_SCREJECT,which gets called when the user rejects the shopping cart. In this pre-exit method, set a flag variable and export that variable to a memory ID. You should probably also create a pre-exit to method /SAPSRM/IF_CLL_BOM_SCAPPROVE that clears out this memory ID so if the user decides to approve the cart instead, they don't get the rejection logic.

2.) Use an implementation of BADI BBP_DOC_CHECK_BADI to import the memory ID with your rejection flag. If the flag is checked from your pre-exit, validate the rejection note stored in E_LONGTEXT, tdid='NOTM' from your call to BBP_PD_SC_GETDETAIL. (actually, it looks like you already have most of this step in place)

That should do the trick. Good luck!

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Guys,

i have used some modification to class /SAPSRM/CL_CH_WD_BOM_SC to method /SAPSRM/IF_CLL_BOM_SCREJECT and method /SAPSRM/IF_CLL_BOM_SCAPPROVE also there was some modification on CX_ROOT and the method is IF_MESSAGE~GET_TEXT to resolve the issue. all i did i use export and import the error message from custom BADI.

Thanks for all the help you have provided,

Regards,

Thembass

Former Member
0 Kudos

Hi Themba,

I am facing the exact issue which you have mentioned.

I have implemented the BBP_DOC_CHECK_BADI.

1.     In the implemented class: ZCL_IM_SC_VALIDATE.

2.     Use Function Module BBP_PD_SC_GETDETAIL to get E_LONGTEXT.

3.     Use method GET_CURRENT_DECISION of class /SAPSRM/CL_WF_APV_FACADE to get current decision. 

4.     Check if current decision is REJECTED.

5.     Check if E_LONGTEXT has TDID = NOTM.

6.     Populate error message "Please enter reason for rejection" to et_messages

Whenever the REJECT button is clicked,the error message is populated to et_messages.But I am getting an error in the popup.

"Document check returned at least one error message. The action can not be carried out. For more details, see message area".

Could you please tell me what steps you followed to correct the issue?

It would be very grateful if you try to help me in solving this issue.

Thanks and Regards,

Rohini

Former Member
0 Kudos

Hi Masa,

Our system is set up such that the approval process( approve or reject) is done via details button, however after validation and having populated et_messages within IF_EX_BBP_DOC_CHECK_BADI~BBP_DOC_CHECK we do not see our messages instead we see the sap standard error message within the abap webdynpro pop up. the message is "Document check returned at least one error message. The action can not be carried out. For more details, see message area".

Thanks in advance,

Thembass.

Former Member
0 Kudos

Masa is correct about the Approve and Reject buttons. The solution i posted earlier lets you do the rejection note validation from the UWL-level Approve and Reject buttons so you don't have to click into the shopping cart in order to approve or reject it. Sorry if I was confusing, it's been a while since I've looked at this and the details of everything I did are fuzzy.

More of it is coming back to me now, though. I remember encountering the same problem you are now with the pop-up, Themba. We had to implement OSS note 1471155, and I believe that addressed the problem you are encountering now.

Former Member
0 Kudos

HI

As Masa recommended, you can disable Reject Button in UWL for this purpose so that Approvers mandatorarily go to the cart detail and put the approval notes. UWL works in a different way as compared to iViews, so if there is any error in the Shopping cart while it is being approved by using UWL buttons, system wont display the errors in UWL.

Disabling REJECT button is the easist route to tackle your problem. But you may refer to the solution posted in response to your message if you still require REJECT to be enabled in the UWL

Regards

Virender Singh

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

You can hide the approve and reject buttons by UWL configuration. User has to open document and approve or reject. If user opens document, BBP_DOC_CHECK_BADI works.

Regards,

Masa

ricardo_cavedini
Employee
Employee
0 Kudos

Hello,

This happens because UWL is not prepared to display error/warning messages.

If such exception error occurs, the user has to go to the detail screen and check the document.

Kind regards,

Ricardo