cancel
Showing results for 
Search instead for 
Did you mean: 

SC - BBP_DOC_CHANGE_BADI

Former Member
0 Kudos

Dear SRM Experts,

I have a requirement, when SC data changes BBP_DOC_CHANGE_BADI triggers with Shopping cart details.

I need to have a validation in BBP_DOC_CHANGE_BADI only when changes happens from Approval/Review screen (for example: Operational purchaser changes any SC data ) . is there any way/function/method/BADI Signature can I check,  from which screen the  BBP_DOC_CHANGE_BADI is triggering? So that I can have the validation only when Operational purchaser changes the data. Because the BBP_DOC_CHANGE_BADI triggers when SC create/change from Create/Review/Approval screens.

It would be great if you could let me know, if there any way to find out on which process (Create/Review/Approval ) the BBP_DOC_CHANGE_BADI triggers, So that I will include my condition based on approval/Review process.

Thank you

Magesh

Accepted Solutions (0)

Answers (2)

Answers (2)

robin_janke
Contributor
0 Kudos

Hi,

use the following code in your BADI (this is just an incomplete snippet but should give you enough information to get it working).


      TRY.
         CALL METHOD /sapsrm/cl_wf_process_manager=>get_current_process_level
           EXPORTING
             iv_document_guid = es_header-guid
           IMPORTING
             es_process_level = ls_process.
       CATCH /sapsrm/cx_wf_not_found .
     ENDTRY.


The ls_process will either contain a process_level -> approval (you have to look into the variable to determine what type of approval. Or it is initial -> no approval yet.


Regards,

Robin

Former Member
0 Kudos

Hi Robin,

Thank you for your suggestion.

I was trying to use whatever you have suggested, looks like this will resolve my issue.

I will update you once I completly test it.

Thank you

Magesh.


former_member181995
Active Contributor
0 Kudos

Hi Magesh,

Can this be checked with user's role assigned for Operational purchaser?

Check user Attributes if it has role for operational purchaser, then trigger your code, else not.

Cheers

Amit

Former Member
0 Kudos

Hi Amit,

Thank you for the update.

I am not sure I can use the user's role. because operational purchaser himself can create a SC. so checking the user's role will not really help to resove the issue.

Thank you

Magesh