cancel
Showing results for 
Search instead for 
Did you mean: 

Determine BBP_DOC_CHECK called by Approver or Requestor

ashish_shah
Contributor
0 Kudos

Hi ,

I am using SRM 702.

I wanted to determine if the BBP_DOC_CHECK badi is called by approver or by requestor in complitioner workflow.

If it is called by approver , i wanted to throw some warning messages.

How can i determine this?

Regards,

Ashish

Accepted Solutions (1)

Accepted Solutions (1)

konstantin_anikeev
Active Contributor
0 Kudos

Hi Ashish,

please, try following.

1. Call method /SAPSRM/CL_PDO_FACTORY_SC_ADV=>GET_BUFFERED_INSTANCE( document guid ); to get reference to SC.

2. Call method of SC object /SAPSRM/IF_PDO_ADV_BASE~GET_ADV_MODE() to get current mode.

Best Regards

Konstantin

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Ashish,

Goods recepient of shopping cart is same as requester. So check goods recepient which can be obtained by iv_partner details .Compare with logged in user.If both are same then it is requestor every one else is non requester.

To check whether logged in user is approver or not check the role or u can check whether the cart is completion work flow or N step approval work flow.

U can check using the work flow tasks TSXXXXXX. 

Former Member
0 Kudos

Hi Ashish,

If is not possible to differentiate approvers and requestor's by roles then you have following options-

Check badi will have a standard importing parameter - IV_MODE which has following 2 values in runtime

1) C - Create Mode -  when shopping cart is being created

2) U - Update mode - when shopping cart is being update (by creator / approver)

I would simply check the this mode and put the condition that current user (sy-uname) is not equal to 'creator' / 'requstor' as per your requirment.  In case if you are using team cart then you would need to extend this check to include requestor's team as well.

Best Regards,

Amit

laurent_burtaire
Active Contributor
0 Kudos

Hello,

yes, BAdI is called: put a break-point in GET_INSTANCE method from CL_EXITHANDLER class.

Regards.

Laurent.

ashish_shah
Contributor
0 Kudos

Hi LAurent,

I am looking for an identifier to distinguish a call by Requestor from a call by Approver.

Do you know how can i achieve this?

Regards,

Ashish

laurent_burtaire
Active Contributor
0 Kudos

Hello,

don't know...

Use role, check if current user is purchasing document requester or whatever...

Regards.

Laurent.

Former Member
0 Kudos

Hi,

To the below function module if you pass the userid you will get the list of roles that are assigned.

CRM_ROLES_OF_USER_GET

Once you get the roles you can identify if its a purchaser or approver.

Regards,

Naveen

Former Member
0 Kudos

Hi Ashish,

You could also try using CALL STACK if it gives some information.

Regards,
Prasanna