cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help: When a new assignment is created need To change Partner Function

Former Member
0 Kudos

When a new assignment is created for a Service Order, by chosing a Service Order and then a resource (technecian).

When we click "APPLY" to generate the Assignment, I need to make a change in the Partner Function.

That is : Parnter function (Employee Responsible) = name of the person/resource in the assignment.

Kindly help me; how to go about it. Is there a BADI which can be used to do that?

I found a a few BADIs : CRM_SRV_SDL and CRM_PARTNER_BADI; but not sure of it. also not sure how to proceede.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This is what I did.

1. Before clicking on the "apply" Button, i clicked on a field in the CRM WEB UI View of the assignment. and then pressed F2. It displayed the UI Component and the view of that field.

2. Now in the backend CRM system i went to Tcode BSP_WD_CMPWB and pasted the UI Component Name... then on the next screen on the left side i expanded "Views" and selected the View (which was displayed in the UI's F2 popup).

3. On the right side i expanded the "Events" and i cud see a event "ONAPPLY".

4. I Double clicked it and saw the code writen for it. Also if i put a external "Breakpoint" in this code, it gets triggered when i run the Assignment creation in UI.

My Question: I know that i must use CRM_ORDER_MAINTAIN, but WHERE do i write the code ? in there.

Former Member
0 Kudos

Hi Gaurav,

Please tell component name and view where you are trying to do that.

Also, it would be lot beneficial for you if you debug when the code when you change the partner function in UI and see how it is handled in code - press F2 on partner function on UI and see component, view, event handler - how they are doing it.

Also, as far as possible - avoid direct calling of FM (crm_order_maintain) from UI View directly as it may create sync problem.

Try to do it through reading partner relations, something like from BtadminH -> read BtPartner using relations and then read partner functions and the set attribute. Then doing Save should take care of saving it in database.

Please check genil_model_browser for component set ALL to drill down all relationships between different bol entities.

I hope it helps.

Thanks,

Rohit

Former Member
0 Kudos

Find the event triggered when you click on the apply button. Modify the event and change the employee responsible partner function using CRM_ORDER_MAINTAIN FM.

Once the partner is changed reload the page.

Make sure when you modify the event for apply button you call super method first and then write your own code.

Regards