cancel
Showing results for 
Search instead for 
Did you mean: 

Date type 04 already exists error during Rehire action

Former Member
0 Kudos

Hi Friends,

The requirement is that, during the Rehire action the Date Type 04 i.e. Hire Date needs to be updated with the Rehire date automatically. Below is the code done in T588Z to achieve this. In this code 03 stands for Rehire action.

The date is updated correctly if the Date Type 04 already exists in the filed DAR04, but if the Date Type 04 exists in some other field like DAR03 then the system gives an error "Date type 04 already exists". Please see below snapshot.

Is there a possibility to fix the above issue with some changes in T588Z or some other approach needs to be done?

Please share your thoughts.

Thank you in advance.

Regards,

Vish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Friends,

We checked the routine creation approach but it involves changes to standard SAP code hence not recommended. Please share if there are any other approaches.

Regards,

Vish

Former Member
0 Kudos

Why don't you just create a new date type for rehire date?  That way you can keep a clearer picture of the original hire date vs. the rehire date. 

Former Member
0 Kudos

Hi Scott,

As mentioned earlier the client doesn't want a separate date type else we would have already done that. Because that was the first proposal we had made.

Regards,

Vish

Former Member
0 Kudos

In that case, the dynamic action you have written will not be enough.  As Jimson suggested, you can update your dynamic action to call a custom routine as seen below:

In the example above, we use the custom routine to determine the specific location of specific date types and then handle updating them accordingly based on different scenarios.  Not sure why you said that this approach involved changes to standard SAP code.

Former Member
0 Kudos

Hi Scott,

Thanks for the sharing the screen shot. Our technical consultant did try with the custom routine but it didn't work as expected hence the suggestion was to touch the SAP code.

But since you've confirmed that your custom routine approach worked we are trying with the now.

Below is the screen shot of our dynamic action part for the Rehire action.

With these steps we will be populating date type 02 with Rehire action date. With the routine GET_REHIREDAT(ZHR_REHIRE_DA) we are trying to fill the date type 04 Hire Date.

The logic in the routine is "Checking if date type 04 already exists. If any of the 12 date type fields has 04 then populate the date field with the action begin date. If no match found then to fill the 12th date type and date fields with 04 and the date value respectively."

The issue we are facing is that the routine does get called but IT41 isn't getting updated. So only the dynamic action steps work.

Please let us know if we are missing out on something.

Thank you in advance.

Regards,

Vish

Former Member
0 Kudos

You should first make sure include MPPDAT00 is in your program.  Then you can do something similar to the following to ensure IT0041 is updated accordingly:

Of course you will need to adjust your code to fit your needs but I hope this at least gives you a good place to start!

Former Member
0 Kudos

Hi Scott,

Thank you for the sharing the include MPPDAT00. We were able to get the routine work as expected.

Regards,
Vish

Answers (5)

Answers (5)

Sanky
Active Contributor
0 Kudos

Hi Vish,

If you will use same date type for two different purpose then at time of calculation for any thing in payroll or time managment how you will bifurcate this two.

In this table you can create 12 date type but there should be unigue always. So my advise to you that use two different date type for hiring and rehiring action.

It's the best practice would be. Your client does not want, client does not know the sap table design and you can give them one example how they will bifurcate two date of they will maintain in the same date type (like two same chocolate will keep in the same shelf where one is 2day's old and another one is 1day's old).

Hope so client will understand and accept the design process about date type in IT41.

Regards,

Sankarsan

Former Member
0 Kudos

Hi Sankarsan,

Thanks for the example. Would really appreciate if you have any inputs on the custom routine approach.

Regards,

Vish

Sanky
Active Contributor
0 Kudos

Hi Vish,

I would suggest you don't go with this solution for custom routine. I don't know about this.

Since in the future you can't query this two date type if it's required. So i would suggest you go with the different date type with dynamic action updation.

Convince example.

Regards,

Sankarsan

leelamohan_kavali
Active Contributor
0 Kudos

Dear Vishwanath,

I think so same name can't be accepted for little information kindly click on below link

Date Specifications (Infotype 0041) - Infotypes for Personnel Administration and Payroll - SAP Libra...

Ur's Mohan

Former Member
0 Kudos

Hi,

Are you assigning the same old personnel no. For rehire employee ?

Former Member
0 Kudos

Hi Praneeth,

Yes, the same Personnel Number will be utilized.

jimso101
Active Contributor
0 Kudos

Hi Vish,

In case if you are going ahead with Date type 04 for re-hire, then you will have to create a routine.Because its very difficult to know which date type has 04. The date type position can be varying for different employee categories. So its only possible with creation of routine which eventually will not be used if new date type is going to be used for re-hire.

Thanks & Regards

JIm

Former Member
0 Kudos

Is there a reason why rehire date does not have its own date type? Seems rather odd to have two different dates tied to the same date type. Think in terms of reporting - how will you differentiate? Of course, there is option to write logic to compare both dates and the one that is more recent will be the rehire date but you can avoid doing that.

I have 2 recommendations for you -

1. Create a seperate date type for rehire date.

2. Use DAR12 in your dynamic action - It is very unlikely that a person will have 12 dates on a single record. Using DAR12 will ensure the date type and date will default in the last spot and upon saving, it'll adjust.

Hope this helps.

Donnie

Former Member
0 Kudos

Thanks Donnie.

Going for a separate date type for rehire will surely solve the issue, we had already proposed this approach but the requirement confirmed by the user is to use the same date type 04 - Hire Date.

Please let me know if you have any further thoughts on this.

Thanks in advance.

Regards,

Vish

Former Member
0 Kudos

Hi Vish,

check this document may help you

Auto Updation of Date Specifications and Mail G... | SCN

In FC give 06 and instead of COP go with INS then it overwrite the value

Former Member
0 Kudos

Hi Praneeth,

Thank you for the quick reply and the document link.

Going with INS instead of COP will not copy the previous date types and values of IT 41. It will create a new blank record. FC 06 also won't be helpful.

We need to retain the existing Date Types and their respective dates and only the Date Type 04 needs to be populated with the Rehire action date. Another concern is the Hire Date could be in any field and need not be in DAR04 only.

Regards,

Vish