cancel
Showing results for 
Search instead for 
Did you mean: 

Read CR_Type in BADI USMD_RULE_SERVICE

Former Member

Hello MDG experts,

How can we read CR Type from CR Data in BADI USMD_RULE_SERVICE. The requirement is that certain checks should only be executed for specifc CR Types. How can I see that ongoing CR if of what CR Type ?

Also, I need to know if some how I can read the CR Step number from CR Data in BADI USMD_RULE_SERVICE because some of my checks should run only for certain steps.

Best Regards,

Dheeraj

Accepted Solutions (1)

Accepted Solutions (1)

benjamin_allsopp
Active Participant

Best way in my opinion is to implement cl_usmd_app_context in the code.

  • First use get_context to store it into a local object (type ref to if_usmd_app_context)
  • And then use  get_attributes on your local object which will allow you to export CR type and CR step amongst other things.

Answers (2)

Answers (2)

former_member1270519
Participant
0 Kudos

Hi,

I you have CR Number, you should be able to read CR type, Step and other details from table USMD120C.

Regards,

Sagar Dixit

Former Member
0 Kudos

Hi Dheeraj,

In BADI in the CHECK_ENTITY method, try using cl_usmd_crequest_util=>GET_CR_TYPE_BY_CR for getting the CR type from CR and

cl_usmd_crequest_util=>GET_CR_STATUS_BY_CR for getting the CR status. From CR status you get know what is the current CR step number.

Please check the utility class cl_usmd_crequest_util once.  There are some other useful methods also which could help you.

Former Member
0 Kudos

Hi MDG User,

Getting the CR Type worked fine for me. Thanks for your inputs.

Regarding the Step number, We have the same status being used at different steps in different CR Types, so setting up the logic on CR status would not be appropriate here.

Best Regards,

Dheeraj

Former Member
0 Kudos

Hi Dheeraj,

As Benjamin mentioned already, please try using cl_usmd_app_context=>get_context and then from the returning context use get_attributes method to read the WF step.