cancel
Showing results for 
Search instead for 
Did you mean: 

Find out the agent based on the responsibility from a rule via function module

former_member240605
Participant
0 Kudos

Dear Experts,

I have a rule and under the responsibility of this rule  purchase groups are maintained. I want to pick up the only those agents which are maintained under purchase group RU50. I have called the function module  - 'RH_GET_ACTORS' and passed the rule no in ACT_OBJECT , sy-datum and in table - ACTOR_CONTAINER, I have passed  EKGRP, 003, C, RU50 to get the agent - 'ABCD' which is maintained under the purchase group - RU50. But ACTOR_TAB is returning all the agent of this rule. It is not checking RU50. So kindly suggest how I will get that specific agent maintained under the Pr.Group - RU50.

Accepted Solutions (1)

Accepted Solutions (1)

I042439
Employee
Employee
0 Kudos

Hi

Please pass ACTOR_CONTAINER-ELEMENT = Actual name of the container element defined in the rule...is it EKGRP? it should be passed in Quotes..

Ignore TAB_INDEX, ELEMLENGTH and type TYPE. Populate VALUE = 'RU50' in quotes

If this does not works, try:

Include container operation macro definitions in your code:

  • INCLUDE <cntain>.

Define the container:

  • swc_container ac_container.

Populate container:

  • swc_set_element ac_container <'actual element name in quotes'> <variable which has the valur to be passed'

Pass this ac_container to the RH FM.

Regards,

Modak

former_member240605
Participant
0 Kudos

Hello Modak,

Thanks for your reply. I have changed according to you. But still it is passing all the agent. It does not count the purchase group - R80, which I have passed to ACTOR_CONTAINER-VALUE.

I042439
Employee
Employee
0 Kudos

Hi


Can you please provide your code and the screen shot of the Rule Container Definition (double click on the variable and then give the Screen shot of it's definition).

Regards,

Modak

former_member240605
Participant
0 Kudos

Hi,

Below is my code and rule container 'purchasereqisition', it passes purchase group to the function module. Initially  I passed l_it_actor_container. to the fm - RH_GET_ACTOR, it returns all the agent after changing it I passed ac_container to fm but still result is same.  My aim is to find out the proper agent, if not exists then pass wf-batch to actor_tab. Possible?

I042439
Employee
Employee
0 Kudos

Hi

There are two mistakes here.

If you are passing AC_CONTAINER...use SWC_SET_ELEMENT instead of SWC_GET_ELEMENT.

If you are using L_IT_ACTOR_CONTAINER, then pass that.

here you are passing AC_CONTAINER without setting any value (SWC_SET_ELEMENT)

Also, where is the code to set l_v_eban???? it will be empty!

regards,

Modak

former_member240605
Participant
0 Kudos

Hello Modak,

I have  done the below correction in my logic:

swc_get_element ac_container 'PURCHASEREQUISITION' l_v_ebeln.

Now l_v_ebeln has been populated and in the fm - 'RH_GET_ACTORS' I am passing the inernal table - l_it_actor but still it returns all the agents.

I042439
Employee
Employee
0 Kudos

Hi

You got it all wrong!!!!!

if you are populating AC_CONTAINER then WHY are you sending L_IT_ACTOR????

Pass AC_CONTAINER to ACTOR_CONTAINER of the FM and receive the Agents from ACTOR_TAB of the FM.

Understand that you need to pass the container WHICH HAS THE VALUE.

If you populate the values in AC_CONTAINER and pass an EMPTY Table L_IT_ACTOR ,  we will not get the desired results.!!!

if you are still not able to figure this out, send the WHOLE code...as text and not screen shot.

Regards,

Modak

Answers (1)

Answers (1)

I042439
Employee
Employee
0 Kudos

Hi

Were you able to resolve this? If yes, Please do post your resolution for others who may come searching and do close this thread please.

Regards,

Modak