cancel
Showing results for 
Search instead for 
Did you mean: 

Date Calculation in CRM service request

Former Member
0 Kudos

Hi,

In the CRM service request creation, the requested end date is auto calculated based on the formula "current date + 3 days".

My issue here is, the formula "current date + 3 days" is calculated regardless whether it is public holidays or Sunday (non working days).

Example lets say todays date is 02.06.2011 (Thursday), the requested end date will be auto calculated as 05.06.2011 (which is Sunday).

Is there any way to determine the date profile to skip the Sunday or Public Holidays using the standard CRM?

For the example case above, the requested end date should be 06.06.2011 (Monday) -> Sunday should not be calculated.

Kindly please advise. Thank you.

Accepted Solutions (0)

Answers (8)

Answers (8)

0 Kudos

Hello,

Maybe you already had solve the problem. But anyway, this can help to other people:

First go to SCAL. There you have to maintain the holidays calendar.

Once is done, you have to maintain the factory calendar. There you can put the week working days.

Then go to CRMD_SERV_SLA and maintain the user calendar and working hours.

Hope this help. Best regards

Mundo

former_member186887
Active Contributor
0 Kudos

Dear Sim Phoi Li,

I am working on Incident Management currently.  Could you please help me with your experience how you achieved your requirement, your experience would really help in solving the similar issue in my current project.  Please explain me how you resolved this issue.

Thanks in advance.  Awaiting for your help.

Regards

Maddy

Former Member
0 Kudos

Hi,

I am not sure if you have fixed this issue already - if not, then this is how I fixed the same problem that I encountered on Service Incident SLAs.

I did not use any coding to make this change. When I tried to define the response times in Days, Hours, Weeks and Months, I kept seeing the same issue. The holidays and weekends were beig considered. I did two things to make it work the way it should:

1) I converted all my response times in the Response Profile to hours. So I defined let's say 5 days into 40 hours ( 8hrs. per day X 5 days).

2) I checked the Holiday Calendar in the Service profile instead of the Factory Calendar. I chose No exceptions in the Exceptions section.

That is all I did to fix this issue. I used this option based on config documentation for Date types, rules and durations:

Durations are only valid in connection with a time unit, and must always be printed in entire numbers (for example, two days). You cannot combine two time units (for example, "90 minutes", and not "1 hour 30 minutes").

Hope it helps you or anyone else looking for a solution.

Regards,

Ramesh

Former Member
0 Kudos

u can use DATE_COMPUTE_DAY fm to get the day for that date.

it will give u day then if it is sunday add one .

by this u can solve the sunday issue

former_member191572
Contributor
0 Kudos

Hi ,

for these things u need to nimplement a badi using theb definition CRM_Appointment_badi write the code in the method merge.

Former Member
0 Kudos

You may influence the date calculate using the calendar in the Reference Objects in your date profile.

In you date profile, Reference objects section, add a Reference objects that can have calendar attached, i.e. CUSTOMER, SERWI, SHIP_TO. In my opinion SERWI is the most suitable as has lots of flexibility on maintaining the working dates and hours.

Then in your Date Type configuration where the formula is used, select the Reference Object at the bottom section.

If that doesn't work, then you can also use the CRM_APPOINTMENT_BADI Badi to do the calculation.

Former Member
0 Kudos

Dear Sim Phoi Li

This has to be handled through Service Profile and Respose Profile. Go to T Code : CRMD_SERV_SLA and define Service Profile. When you click on Availability time, you will get a option to choose Factory Calendar and Exceptions. Select the Option : +on non working days move to the next working day.

This will automatically takes only working days into consideration (ignores holidays based on Factory Calendar).

Let me know if you need any further details.

Thanks

Surya

Former Member
0 Kudos

Hello Sim,

I had similar but more complex requirement wherein the dates were calculated based on some SLAs maintained in a custom table. My solution was that I implemented the BADI ORDER_SAVE which is called whenever a transaction is saved. I used FM CRM_ORDER_MAINTAIN in the method CHANGE_BEFORE_UPDATE to populate the dates according to my logic. You can also get the desired result in the same way. Hope it helps.

Regards,

Amit