cancel
Showing results for 
Search instead for 
Did you mean: 

Merging/Combining records in TIP

Former Member
0 Kudos

Hi Gurus,

To meet a requirement, I need to merge the records with the processing type 'M' as listed below:

I used the function COMOT for the same...did not work.

Please guide.

Thanks

Kumarpal

Accepted Solutions (0)

Answers (2)

Answers (2)

vianshu
Active Contributor
0 Kudos

Hi Kumarpal,

What is the business driver behind this requirement?

I see that the source of the two time pairs are different - one is from IT2011 and another from IT2002.

Do you need to merge them only when the end time of first overtime pair matches with the start time of second overtime pair?

Regards,
Vivek Barnwal

Former Member
0 Kudos

Hi Shruti/Vivek,

The Daily work schedule has an automatic Overtime of 2 hours; whenever there is a clock-in and Clock-out. Therefore, the time event/2011 based 'M' is generated based on that concept of Auto. Overtime.

Further to that the employee worked additional overtime, which i am qualifying as Unapproved OT.

When manager approves this OT, this generates the second 'M' line in the TIP.

Do you need to merge them only when the end time of first overtime pair matches with the start time of second overtime pair? YES. This is the objective.


Thanks for your help.


Regards

Kumarpal

sikindar_a
Active Contributor
0 Kudos

Hi Kumar

After long time

vianshu
Active Contributor
0 Kudos

Why does the client wish to merge the two time pairs?

Regards,

Vivek

Former Member
0 Kudos

Hi Vivek,

For the moment, lets assume that the processing type is not M... but 'H'

H, for me, is Unapproved OT...assume it to be 3 hours.

Time Eval run 1:

Unapproved OT exists:

I have written a custom function, whenever i encounter the processing type as H, an attendance record (IT2002)/unapproved OT gets created with 3 hours.

PTMW:

Now, Out of the full unapproved OT, manager has approved partial OT say 1.20 hours.

Time Eval run 2:

Approved OT 1.20 has processing type M; Due to rounding down, the approved OT in TIP is 1.00.

the other TIP entries then would be,

Approved OT Balance of Rounding i.e. 0.20, which i am now changing the processing type to 'H'.

Unapproved OT that still remains (since manager did not approve): 1,40.

Since i am always passing the Processing Type H back to IT2002 as unapproved absence, my requirement is, during the second time, to pass one single record i.e. 0.20+1.40 = 2hrs

Regards

Kumarpal

Former Member
0 Kudos

Hi Kumarpal,

If you are looking for OT approval process then infotype 2007 would be helpful in your case it works exactly as your requirement ,

With Regards

Aditya.T.M

Former Member
0 Kudos

Thanks Aditya. Are you referring to PCR TO20/TO21?

Any which case, I am quite intrigued to know how this merging can happen, within TIP Entries, as per my requirement....

Any help?

Regards

Kumarpal

vianshu
Active Contributor
0 Kudos

It is going to be complicated since there is no limit to the no. of such time pairs which can exist. Here is a gist of the solution.

You will have to first create daily time types for ZMS1, ZME1 , ZMS2, ZME2....ZMS9, ZME9 where S is for start time and E for end time.

Then write a PCR to pass the values of start and end time to these time types for processing type M.

*

****

     OUTTPVTYPE

                      *

                         COLOP*

                      M

                         HRS=DZMS1

                         HRS?0

                                         <

                                          COLOP*

                                        =

                                          HRS=PBEG

                                          ADDDBZMS1Z

                                          HRS=PEND

                                          ADDDBZME1Z

                                         >

                                           HRS=DZMS2

                                           HRS?0

                                                      <

                                                        repeat the above.

Basically, we are trying to record the start time and end time of each time pair with processing type M.

The next step is to find out which time pairs need to be merged.

You can write a simple PCR to compare the values by calling multiple sub PCRs using PCY operation.

And then under each sub PCR, you write the below logic.

HRS=DZMS2

HRS-DZME1

HRS?0

        =

         HRS=1

         ADDDBZM12   (merge 1st and 2nd time pair)...Similarly create for ZM23, ZM34, ZM45, ZM56 and so on.

        *

after the above step, you will have to write another PCR to find the value of these time types ZM12 and so on. If their value is greater than 1, it means that time pairs need to be merged.

You will write a PCR where you will match the PBEG of the time pair with ZMS1. If it matches, it implies this is the time pair whose end time needs to be changed. You change the end time by taking value from time type ZME2.

Next you will have to remove the time pair with timings ZMS2 and ZME2. You can write another PCR where the timings match the time types and block them from going further forward.

You will have to repeat this logic for 9 such pairs.

We are assuming there can be 9 such pairs.

Regards,

Vivek Barnwal

Former Member
0 Kudos

Hi Kumarpal,

According to my understanding manager approves OT in IT2002 , instead if you use IT2007 you can follow below link and check for the feasibility .

Please check this link : http://scn.sap.com/thread/3699009

Here in the link  there is document created by Vivek , which is an wonderful document for OT approval using IT2007 .

Please correct my understanding if I am wrong , do let me know.

With Regards

Aditya.T.M


Former Member
0 Kudos

Hi Aditya,

Thanks for the link. However, this is for existing record of pre-approved OT in 2007.

In my scenario, I am generating a IT2002 record in Time Evaluation (Custom Function).


Vivek,

I am going to try this.

Regards

Kumarpal

vianshu
Active Contributor
0 Kudos

Hi Kumarpal,

I would recommend that instead of using custom function, you go with a standard approach.

Whenever the manager approves the unapproved OT in portal, you create a record in IT2002 as well as in IT2007 for the same timings.

This will ensure that the line item M will get generated in a standard way.

Thanks and regards,

Vivek Barnwal

ShrutiJoshi
Active Contributor
0 Kudos

Hi Kumarpal

COMOT is used when there are overlapping time pairs and you need to specify which one should prevail out of the two. However, your scenario here is quite different.

Separate time pair is formed for each record of time booking. So when the overtime is booked, cant you book it as 17:00 to 20:00 instead of two record of 17-19 and 19-20. If you book only one record, it will create only one time pair as you require.