cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry Work Manager 6.0: BADI to enhance assignment type

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I have the requirement to more or less combine the work order assignment types 1 and 2. I have to fetch the operations based on its assigned personal number, but at the same time I have to fetch a work order and all the operations if the Agentry user is the work order header responsible.

Unfortunately this is a single value parameter so I set the assignment type to 2. Now I thought it would be really easy to fetch the work orders based on the assignment type 1 since there is a BADI available after each assignment call method:

WHEN '2'.                                           "Operation level
           me->get_assignment2(
             EXPORTING
                iref_rfc_oo_data = iref_rfc_oo_data
             IMPORTING
                et_return        = lt_return
                et_wo_object     = lt_wo_object ).

           IF NOT gref_badi_wo IS INITIAL.
             CALL BADI gref_badi_wo->get_assignment_type2
               EXPORTING
                 iref_mdo_data = me->oref_mdo_data
               CHANGING
                 ct_wo_object  = lt_wo_object.
           ENDIF.



So inside the BADI gref_badi_wo->get_assignment_type2, I wanted to call the me->get_assignment1 method, and then join the 2 internal tables values.


But the problem is once the BADI is called it is not possible to call this method since we only have the OREF_MDO_DATA object which has the original class as a inaccessible private attribute. I could try to copy and adapt the me->get_assignment1 code but there are some attributes that are not accessible inside the BADI. Do you see a simple and elegant solution to this requirement?


I would like to avoid creating a new Z handler class inheriting from the standard one...


Thank you.





Tags edited by: Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

I just wanted to close this old thread since what I did long ago to solve the issue is to replicate the me->get_assignment1 inside the me->get_assignment2 BADI method code. It is not just a copy paste since from the BADI you don't have access to some MDO handler private data.


But it is possible to replicate all the fetch process except when doing a delta with exchange since I couldn't easily get the necessary data from the main MDO. But even if you get all the work orders ID's, after the BADI the standard code checks the exchange table again and rules out the unnecessary WO ID's.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Marcal , You can also do like , add one more assignment with 2 . and get both values data and manipulate based on requirement . use between in agentry framwork when you add new rule in assignment type. Thanks & Regards, Kunal Varaiya

tahir_z
Contributor
0 Kudos

Hi Marçal,

Have you checked the following doc for assigment types :

Why you need to combine types ?



Tahir

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Tahir, thanks for the document.

I need to combine the assignment types because is what users want.

We need to have the header responsible with the work order and all it's operations and the operation responsible only with the items where he is assigned.

tahir_z
Contributor
0 Kudos

Have you tried to provide range for assigment type in admin page as below, i am not sure if it works.

Marçal_Oliveras
Active Contributor
0 Kudos

Even the configuration panel allows it, this parameter doesn't support multiple values. All the ABAP code and Agentry project is assuming a single value for the assignment type