cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Service Order's Based on Contract Validity Dates Using Action Profile

former_member196521
Active Participant
0 Kudos

Dear All,

We have a requirement where based on the contract validity dates the service order's need to get triggered at the back end, I have used using action profile method call copy_document for the same. Following is the requirement which is given below

1) If Contract Validity Date is 1 year- Trigger All 4 Service Order's

2) If Contract Validity Date is 9months- Trigger 3 Service Order's

3) If Contract Validity Date is 6 Months- Trigger 2 Service Order's

4) If Contract Validity Date is 3 Months- Trigger 1 Service Order.

I am pasting the screen shot of my contract first created in SAP CRM Web Ui with all 4 service order's which got triggered using action profile

Following configurations done.

Created action profile, assigned start condition to the same and assigned the action profile to my contract. In the container  I have selected status profile, with this container all 4 service order's get triggered, however which container should I select so that if the contract validity is say 9 months then only 3 Service Order's need to get triggered and if the contract validity is 6 months then the contract should trigger only 2 Service Order's as mentioned above.

Following are the action profile settings which I have made

The method call used is copy_document

Kind Regards

Atul

Accepted Solutions (1)

Accepted Solutions (1)

nicolas_busson
Active Contributor
0 Kudos

Hi Atul,

Unfortunately "Date" fields are not available in SAP standard BOR object BUS2000112. So you'll have to add them yourself as mentioned in the following OSS note (point 6):

Note 670544 - FAQ: Actions

And by the way: why do you generate 4, then 3, then 2... service orders at the same time? Why don't you use a condition that allows you to create a new service order every 3 months until the contract ends for example?

Regards,

Nicolas.

former_member196521
Active Participant
0 Kudos

Hi Nicolas,

Thanks for the response, I will go through Point No 6 as mentioned by the note that you gave me thanks for the same.

The requirement is there is an AMC (Annual Maintenance Contract) which the customer will enter into with the company, however based on the duration of the contract the system should throw PMC( Preventive Maintenance Calls) which need to go into the service engineer's work list, these calls are dependent on the duration of the contract hence if the contract is for 12 months( start and end date of the contract) then there should be 4PM calls which need to be triggered, if another contract say with customer B is created for 9 months then 3 PM calls need to be triggered, the triggering of PMC would be customer based and also based on the duration of the contract,

Say Customer A has entered into  Contract No 5402111 which has a contract validity of 12 months then 4 PMC should get triggered

Say Customer B  has entered into Contract 5402112 which has a contract validity of 9 months then 3 PMC should get triggered

Hence require your inputs for the same.

Kind Regards

Atul

nicolas_busson
Active Contributor
0 Kudos

Hi Atul,

Thanks, but you're just repeating what you said in your first message. You're not answering my question.

Anyway, the note I gave you will explain how to add the dates you need in the action editor.

Regards,

Nicolas.

former_member196521
Active Participant
0 Kudos

Hi Nicolas,

Thanks for the reply, yeah after going through the note we will add the validity date to the standard BOR object BUS2000112 and then write the condition for the action profile, we did check with our client with regards to your valuable suggestion  to create the new service orders every three months until the contract  validity ends however the client wants the system to trigger the service order, based on the validity dates, I will again check with the client with regards to your suggestion offered, if you could briefly let me know how to create the same it would be helpful and can this suggestion which you offered be achieved functionally or technical help would be required.

As per my understanding it would be to create an action using the alert category to remind creating service order once every three months however please do share your valuable inputs on the same.

Kind Regards

Atul

nicolas_busson
Active Contributor
0 Kudos

Hi Atul,

Indeed the system have to create the service orders automatically.

To do this, store a date ("ZNSOC - Next service order creation" for example) in your service contract. Then use this date to trigger the service order creation every 3 months (if sy-datum > ZNSOC).

In your action profile, adapt the method of the corresponding action that will actually create the service orders, to make sure that if this action is successfully executed, ZNSOC will be updated with the next occurrence.

That's something very simple to do with very few lines of coding. You can have a look at action profile CREATE_RECURRENCE and process type RECU for some guidance. In my opinion you will end up with a far more consistent flow between the service contract and the service orders:

1) In case the service contract is canceled or ended prematurely, you won't have to delete the service orders that you created "too soon"

2) If tomorrow your client wants to sell 24/36 months duration contracts, you don't have to change anything at all in your action profile... And even more convenient: you won't have to create 8 or 16 service orders that will stay "inactive" for many years in your system.

3) Etc.

Regards,

Nicolas.

former_member196521
Active Participant
0 Kudos

Hi Nicolas,

Thanks for your detailed feedback appreciate the same.

I have done the following as per your feedback above

1) Copied the standard action profile CREATE_RECURRENCE to Z_CREATE_RECURRENCE(screen shot attached)

2) Copied the standard date profile RECU_DTPROFL TO zrec_dtprofl.

3) Created a new date type ZNSOC as per your message above.

4) Assigned both the date profile and action profile to my contract type which is YSC

5) However now when I go to my contract the contract validity dates are greyed out and in the date tab the dates are greyed out when I open my contract

6) My technical team member is sick and may not come for the next couple of weeks hence appreciate if you could help me with the coding logic.

Appreciate all your help and patience in resolving the same, thanks again for all the help offered.

Kind Regards

Atul

nicolas_busson
Active Contributor
0 Kudos

Dear Atul,

I'm sorry but I tried to give you as many hints as possible to implement this functionality as efficiently as possible. But I'm afraid can't do the coding for you. If time allows I'll publish a wiki article some day with a step by step procedure to implement recurring activities in SAP CRM.

Thanks for your understanding,

Best regards,

Nicolas.

PS: the dates fields are greyed out because you changed the date profile. You should keep the same date profile and add date ZNSOC in it (or create another one, but with the same date types as the original one).

former_member196521
Active Participant
0 Kudos

Dear Nicolas,

Thanks for the update and the help appreciate the same, with your guidance I did get the next service order date in my contract, one last query before I close this, just wanted a clarification on one point which you mentioned in your previous post

In your action profile, adapt the method of the corresponding action that will actually create the service orders, to make sure that if this action is successfully executed, ZNSOC will be updated with the next occurrence,


The term next occurrence would be the date of service order creation please let me know if my understanding is correct on the same

Kind Regards

Atul


nicolas_busson
Active Contributor
0 Kudos

Exactly!

The idea is to have an action that will both:

1) Create one service order as soon as today's date is greater than ZNSOC

2) Update ZNSOC with ZNSOC + 3 months.

So if the action is executed on the 2014.01.01, one service order will be created and ZNSOC will be updated to 2014.04.01. As a result, on the 2nd or April 2014 -- today's date will be greater than ZNSOC--, a new service order will be created and ZNSOC will be updated again to 2014.07.01... and so on until the condition you set for scheduling your action is not valid anymore.

Hope that clarifies your concerns.

Best regards,

Nicolas.

former_member196521
Active Participant
0 Kudos

Dear Niclolas,

Thank you again for the detailed help provided, appreciate the same and I am also presuming that I need to include end of recurrence logic in my condition for actions, in case if the contract as you mentioned is valid only for 6 months then the service order should only be created twice once after every 3 months.

Kind Regards

Atul

nicolas_busson
Active Contributor
0 Kudos

Indeed... but I guess this is covered by the condition on the contract status that is shown in the screenshot you attached in your very first message.

Cheers,

Nicolas.

former_member196521
Active Participant
0 Kudos

Dear Nicolas,

Thanks for the prompt reply again appreciate your help, as per my understanding in the coding logic I also need to mention the contract validity dates for the service order creations, since contract statuses are Open, In process and closed, do let me know if my thinking is correct or I need to add any new custom status messages for the same.

Kind Regards

Atul

nicolas_busson
Active Contributor
0 Kudos

I just noticed that I said something misleading regarding date fields. I'm sorry.

Indeed the oss note I gave you is relevant for all the fields except date fields. They are not present in the BOR object, but that's normal: date fields are an exception. They don't need to be there at BOR object level to be used as condition criteria... Because they come from the date profile that you fill in when creating you're action profile definition.

Cheers,

Nicolas.

Answers (1)

Answers (1)

former_member186543
Active Contributor
0 Kudos

Hi Atul,

Other than using the workflow type for checking the schedule or start conditions , you can also use the BADI based check.

In the last screen shot under "Action determination and action merging" you can set this in the box where you have setup "Workflow condition" .

Then you have to implement the badi : EVAL_SCHEDCOND_PPF with a filter value. Here you can right your own logic to evaluate whether the action should get scheduled or not.

/Hasan