Balance gets reverted in Infotype 2006 (Absence Quota)

Scenario:
staff has a balance of 36 availale with him and has entry in Infotype 2001 (for dates 13/12/2010 - 17/12/2010 -  ).i..e, 5 week days
Now if  the staff takes another leave on next working day i.e., 20/12/2010, system needs to deduct the weekend in between, ie. 18/19/2010
For this purpose i have written a code, where follwoing peace of cdoe is creaeting an abrupt situation.
i'm using the follwoing code.
[code]
REFRESH ABSENCE1.
in itab_pa2001 i get the original records from the system so need to get existing recrod from system
and limit the itab_pa2001 to only the week end record
THIS IS WORKING
  LOOP AT ITAB_PA2001.
    CALL FUNCTION 'BAPI_ABSENCE_GETDETAILEDLIST'
         EXPORTING
              EMPLOYEENUMBER   = ITAB_PA2001-PERNR
              TIMEINTERVALLOW  = ITAB_PA2001-BEGDA
              TIMEINTERVALHIGH = ITAB_PA2001-ENDDA
         IMPORTING
              RETURN           = RETURN
         TABLES
              ABSENCE          = ABSENCE1.
    IF RETURN-TYPE NE 'E' OR RETURN-TYPE NE 'A'
        OR RETURN-TYPE NE 'W'.
      LOOP AT ABSENCE1.
      ENDLOOP.
      DELETE ITAB_PA2001 WHERE
      BEGDA = ABSENCE1-VALIDBEGIN
      AND ENDDA = ABSENCE1-VALIDEND.
    ENDIF.
    REFRESH ABSENCE1.
  ENDLOOP.
  REFRESH ABSENCE1.
  CLEAR ABSENCE1.
now itab_pa2001 only having the week end record  follwoign code creates it
  LOOP AT ITAB_PA2001.
    STATUS = 'TRUE'.
    CALL FUNCTION 'BAPI_ABSENCE_CREATE'
         EXPORTING
              EMPLOYEENUMBER = ITAB_PA2001-PERNR
              VALIDITYBEGIN  = ITAB_PA2001-BEGDA
              VALIDITYEND    = ITAB_PA2001-ENDDA
              ABSENCETYPE    = ITAB_PA2001-SUBTY
         IMPORTING
              RETURN         = RETURN.
    IF RETURN-TYPE EQ 'E' OR RETURN-TYPE EQ 'A' OR RETURN-TYPE EQ 'W'.
      WRITE : RETURN-MESSAGE.
      NEW-LINE.
    ENDIF.
  ENDLOOP. [code]
what happens
Balance before was 36
now  it is 36 - 5 + 2 = 33.
i.e., 36 - days of old entry + days of new entry.
is using 'BAPI_ABSENCE_GETDETAILEDLIST' and 'BAPI_ABSENCE_CREATE' incorrect.

Found the solution 
can not use
'BAPI_ABSENCE_GETDETAILEDLIST'
and
'BAPI_ABSENCE_CREATE'  in sequence
as the internal table p2001 called in 'BAPI_ABSENCE_GETDETAILEDLIST' does not get refreshed fro the next call to 'BAPI_ABSENCE_CREATE' as they are in the same function group.
using "BAPI_PTMGRATTABS_MNGCREATION" instead of 'BAPI_ABSENCE_CREATE'.
bilal

Similar Messages

  • How to create Absence Quotas in infotype -- 2006.

    Hi Friends,
    Need some urgent help.
    How to create Absence Quotas in infotype -- 2006.(In standard method)
    Any standard programe, TCODE, BAPI FM.
    How to Use?
    Pls help me urgently.
    Bye
    RAHUL

    Find below the link with directions to create a Quota.
    [Absence Quota|http://doa.louisiana.gov/hrhelp/content/prmd-createabsencequotaforpersonalleaveforamanualleaveearningemployee/cc/html/index.htm]
    Hope this helps
    Vinodh Balakrishnan

  • Absence quota should not get generate in Time Evaluation

    Hi All,
    For some employees we lock the payroll. But whenever we run the time evaluation every month employees  who are under lock payroll their absence quota is getting generated every month. It should not happen..
    Please provide solution for this....
    Regards,
    Sita

    Hi,
    Due to some reasons  some employees payroll data was stopped for payment. for this they delimited in  infotype 0001 start date and payroll area to 90 ie. stop payment.
    So whenever they run time evaluation every month through payroll area wise the employees who are under stop ment their quota is also getting generated. How to stop generating quota?
    Regards,
    Sita

  • How to Update Absence Quota with Time Evaluation

    Dear Friends,
    I would like to know how do we update absence quota within time evaluation. Currently i'm using UPDTQAXX, it works but when i search this forum everybody was using this simple code:
    HRS=something
    ADDDBxxxx
    and the quota is updated. I just dont get it, with adddb its only update the daily balance table, how does that enable us to updated the 2006 infotype? Many Thanks

    ADDDBxxxx adds the value of the number of hours field to the specified time type in the table of day balances (TES), it does not update the quota.
    You can use function QUOTA  to accrue absence entitlements periodically based on this customizing: Personnel Time Management>Time Data Recording and Administration>Managing Time
    Accounts Using Attendance/Absence Quotas>Calculating Absence Entitlements>Rules for
    Generating Absence Quotas>Define Generation Rules for Quota Selection.  
    You can use a time type to prorate that accrual

  • Absences not deducted from Absence Quota for One Employee

    Dear Friends,
    I am facing an issue for one employee, when I recorded an Annual Leave absence to him, it is not updated in his Absence quotas infotype. But this is working fine for all other employees in the same employee group/subgroup grouping.
    But for Sick Leave absence type, it is updating in his absence quota records...
    I have checked the counting rules, deduction rules, base entitlement rules and other configuration settings.......It is fine and for other employees belonging to the same grouping, it is working fine, except this employee...
    I couldn't understand what will be the reason? Can anyone shed light on this issue?
    Thanks in advance,
    Sai Narayana,
    SAP Functional Consultant.

    Hi JS,
    I am checking the absence is deducted or not from his entitlement in the infotype 2006 after running the payroll for that month......
    The employee has taken leave on last month and the payroll is also run for that month.......This Absence is not deducted from his quota......
    I have checked for another employee in this department, no error/issue with that employee.......Only with this employee I am facing problem.....
    I found -
    1. The Absence Quota balance which is present in Infotype 2006 is not the same which is displayed in Remuneration Statement ( leave balance is displayed in payslip for every employee)
    2. Annual leave is not deducted from the employee's entitlement where as sick leave is deducted. I have checked the deduction rule too for this grouping, it is right.No issues in that.
    3. Absence Quota generation also produced different results when run time evaluation thru PT60.....which is not according to the entitlement to this employee grouping that too for this employee only.
    Or Friend, can you tell me some other option, to overcome this issue.....instead of repairing this all the time.......
    Thanks,
    Sai

  • Absence Quota creation during Time evaluation - Orgnaisational Assg change

    Hello Experts,
    I have one emplyee for whom the Transfer action has been run - his personal subarea has been changed from 1633 to 1654
    obviously the ps grouping for time quota type changed form 35 to 40.
    so function QUOTA is creating different quota for this employee than what there exist right now for infotype 2006.
    so during time evaluation below error is comming.
        Error entry no. 83 Error when creating absence quota
        A complex application error has occurred
    Kindly let me know how to overcome this error.
    Thanks Jay

    The reason 'error no. 83' occurs in RPTIME00 is because function QUOTA
    is trying to generate a quota type which does not exist for the employee
    on a specific day. It must have existed some time before.  Normally,
    the function QUOTA displays an error message concerning the
    non-existing quota types. In this case, the 'error no. 83' can only
    occur in the following scenarios:
    1. If you deleted a quota type that was to be generated
    2. If an employee has an organizational reassignment to a personnel
       subarea or employee subgroup which have different groupings for quota
       types and for these groupings the 'old' quota type does not exist.
    Function QUOTA checks to determine if the quota types to be generated
    are valid.  If the quota type is not valid anymore (see reason 2) then
    you will get a warning message.
    "the problem in these situations was the following:
    RPTIME00 is trying to generate a quota for a validity interval
    (defined in table T559D) during which the employee belongs to two
    different groupings, due to the transfer.
    In your case the quota type should be generated with a validity interval
    that begins before the employee's organizational change.
    Unfortunately, for the time between the validity begin up to the
    transfer of the employee there is no entry in table T556A for this quota
    type.
    or check the config of this quota running Rptquota_check in se38
    Therefore, it is possible to solve the problem by defining a dummy
    quota type for the 'old' groupings of the employee (table T556A).

  • Absence quota addition after Time Evaluation

    Hi Experts,
    This is regarding Time Evaluation.
    Time Evaluation Configuration is fine. Absence quota is getting generated in days.
    But while adding to the previous balance it's treated as hours and the net balance is coming as hours.
    Example, Absence quota from previous year = 15 hrs
                    Quota generated = 0.77 days
                   After generation the total is 15 + 0.77 = 15.77 hours.
    Please advise what could be the problem . Thanks

    Hi ,
    Thanks for your reply.
    Cause :
    Actually the employee had moved from one Personnel area to another but due to the settings same Absence quota was applicable to the employees in both cases.
    Now i am not able to delimit the record in 2006 from transfer date.
    Edited by: Tomesh Sahu on Jul 21, 2009 10:17 AM

  • Absence quota prorate by monthly basis

    Hi Experts,
    I have an issue regarding the absence quota for the new joiner or leaver. My client wants the leave earned to be given upon completion of the month. My current configuration is base on calendar days.
    For example, when a new joiner join the company at 2nd or mid of the month then the leave entitlement will be given for the following month. That mean when an employee join at 3rd or any other days in January 2010, the leave will be prorated starting from February. This same to the leaver, if the employee is leaving the company at 3rd or any other days in April, then the leave will be prorate till March. The entire April will not be take into account.
    My question is how can I configure this scenario?
    Appreciate the input.
    Thanks

    Hi,
    If you are not using TE then you will can always write an ABAP program which will run and load data on the first of every month.
    For Hire:
    The program can check the hire date from IT 0041. If the hire date is less than the first of previous month then you can add the monthly entitlement to the absense quote in IT 2006. If it is in the middle of the previous month then you can prorate according to the formula and then add to the monthly entitlement to the absense quota in IT 2006.
    For Termination:
    You can base the above logic with the termination date in the IT 0041
    If you maintain IT 0041 well and good or else you will have to base it on IT 0000 Actions infotype.
    Hope this helps.
    Ajay

  • Issue in Absence Quota generation wrt to actions (IT0000);using schema TQTA

    Hi
    I wanted some clarification on Absence Quota generation through schema-u201CTQTAu201D
    The client Scenario is that they want Earned leaves (absence Quota type 0002 and 0003) and Half-Pay leave (Absence Quota 0004) semi-annually.
    Whenever an action is run (whether with employee status active or inactive) the absence quota is generated twice:
    1.     Last day of previous action
    2.     Last day of evaluation period.
    Main issue is that when it is reflected in IT-2006 it is summing up the quota generated on both the above said dates.
    Also the quota that is generated on the last day of the evaluation period is not prorated but for the entire accrual period.
    When the employment status of an action is inactive; the quota is generated upto the last date of previous active action, but if any other action is executed with employee status as u201Cactiveu201D in the same accrual period and time evaluation is run; the quota gets generated again on the last date of accrual period for the entire accrual period i.e. the inactive period is also taken into consideration. Moreover, both the quota generated are added up and displayed in IT-2006.
    Kindly advice me the solution for the same.
    Thanks and Regards
    Parul Jain

    Hi
    I wanted some clarification on Absence Quota generation through schema-u201CTQTAu201D
    The client Scenario is that they want Earned leaves (absence Quota type 0002 and 0003) and Half-Pay leave (Absence Quota 0004) semi-annually.
    Whenever an action is run (whether with employee status active or inactive) the absence quota is generated twice:
    1.     Last day of previous action
    2.     Last day of evaluation period.
    Main issue is that when it is reflected in IT-2006 it is summing up the quota generated on both the above said dates.
    Also the quota that is generated on the last day of the evaluation period is not prorated but for the entire accrual period.
    When the employment status of an action is inactive; the quota is generated upto the last date of previous active action, but if any other action is executed with employee status as u201Cactiveu201D in the same accrual period and time evaluation is run; the quota gets generated again on the last date of accrual period for the entire accrual period i.e. the inactive period is also taken into consideration. Moreover, both the quota generated are added up and displayed in IT-2006.
    Kindly advice me the solution for the same.
    Thanks and Regards
    Parul Jain

  • Issue while creating Absence Quota for one employee

    Hi Friends,
    Our customer has a weird issue. When time evaluation is run, One Absence Quota type (Leave in Bank) is not getting generated for Only One Employee.
    This leave type has been updated with quota in IT 2006 after running PT60 for all other employees in the PA. The issue is only with one employee.
    This absence quota is assigned "Increase" in table V_556A_B (Permit Generation of Quotas in Time Evaluation)
    Can any one please suggest how to generate the missing quota for this employee. Thank you !!

    Hi
    Thanks for your replies !!
    Please find the screenshots attached.
    Leave in Bank Absence type which is valid for 2014 is missing in IT 2006 instead This absence quota valid upto 31.12.9999 is present.
    Current requirement is to remove the quota which is valid upto 31.12.9999 and replace the quota which is valid upto 31.12.2014.
    I have checked for some PERNRs with same EG/ESG/PA/PSA combination. They have the absence quota valid upto 31.12.2014 Only.

  • Absence quota changed to 0

    Hi,
    we generate  the absence quota through time evaluation. but after executing the time evaluation absence quota of EL lchanged to ZERO. How ever it has been corrected after executing the time evaluation once again.
    I just wanted to know, how it has changed to zero? is there any bug in the application or there some other reasons.
    Please let me know what could be reasons.
    Regards
    Sandeep

    Hi Dracula,
    Thanks for your response. No am not able to simulate the situation, it happen just once in PRD server.
    I do agree that some one might have chaned the value. But if the quota is generated by time evaluation then you cannot changed the record directly in infotype (2006). Time evaluation generated quota can be changed on through infotype 2013.
    I do request all the expert please share your thoughts.  Please do let me know what could be the problem here.
    Regards
    Sandeep

  • Not able to generate the absence quota WITHOUT Time Evaluation

    Hi ALL,
    When i try to generate the absences quota for employees without time evaluation using program RPTQTA00, I am not able to generate it.
    And i am getting "E You have not selected any generation rules".
    Kindly if any one come across this issue please throw some light and do a favour.
    thanks all

    Hi,
    Pls check the follwing tables if u have made correct assignments
    v_t559l
    v_554s
    v_556c
    Check Quoma Feature
    Check what status u selected in IT7
    Check if ur using correct Schema
    If ur Using RPTQTA00 then use No Generation,and if ur using PT60/RPTIME00 change it to Increase.
    Check if u have maintained correct quota groupings.
    Revert back if its not solved
    Regards

  • Absence quota 31 cant be accrued by time evaluation

    Hi
    while i run tim evaluation i get error like absence quota 31 cant be accrued by time evaluation,i configured generation rules & also written rule to update quota 31.Any suggestions where i went wrong??how to correct this error??
    Thanks&best regds
    Shaila

    Hi
    Actually i had written sub schema for this..bcoz this URL is eligible for those employees who are Cash processing officer & also based on personnel area we have to check wheter particular employee is Cash processing officer or nt if yes then only update 1day URL  to 2006 IT, if the employee is working on Public holiday..for updating i had written this PCR..ZMN1 Public holiday indicator(timetype), 31 is my quota group.
    HRS=1
    varstprsnt
    N
    Y
    HRS=DZMN1
    ADDDBZMN1
    UPDTQ31

  • Absence quota zero after Time Evaluation

    Dear friends,
    We are generating Absence quota automatically after Time evaluation. But CL/PL/SL leave quota generated is zero after TE.
    Even I am not able to edit Absence quota(IT2006) manually or through IT2013.
    Please guide me, what needs to be done.
    Regards,
    Nayak

    Hi Dracula,
    Thanks for your response. No am not able to simulate the situation, it happen just once in PRD server.
    I do agree that some one might have chaned the value. But if the quota is generated by time evaluation then you cannot changed the record directly in infotype (2006). Time evaluation generated quota can be changed on through infotype 2013.
    I do request all the expert please share your thoughts.  Please do let me know what could be the problem here.
    Regards
    Sandeep

  • Issue with PCR to restrict absence quota

    Hi Experts.
    i have a requirement where the absence quota should never be over 24 at any particular time.
    for this absence 24 leaves per annum with 2 leaves accumulate monthly.
    we are using -ve time mgt and written a PCR to restrict absence to 24 by using Time type
    VARSTLDYPP
    N
    Y
    HRS=FR55C
    HRS?24
    <
    HRS-24
    HRS*-1
    HRS?2
    HRS=2
    ADDDBXXXX
    <
    ADDDBXXXX
    now the issue is when i run the simulation of time evaluation it is generating 2 leaves per year instead of
    2 per month. can anybody help me solve the issue
    Thanks & Regards
    ramayya

    I need a PCR for the below scenario.  I created two types to store day balance and max entitlement to 25 days.   We are not processing payroll from SAP.   Any help writing PCR  with details would be appreciated.
    Schema we are copying TM04
    Time types - storing  daily balance one for below 60 days &  one for after 60 days planned working time.
    Vacation per calendar year 25 days not based on seniority.
    Scenario:
    2.       Prorated entitlement for employees who will work fewer than 60 work days for company in a given year are calculated as follows:
    a.     1/12 of annual vacation for every 21 days s/he performs work
    b.    For these purposes (60 days worked rule) the following is also considered as work performance: Planned working time from IT0007 and public holidays. 
    c.     e.g. if hired on Nov 11, 2011, there < 60 wd remaining. They get 1/12 (25/12 = 2.1d) for every 21 work days remaining - in this case 2 periods of 21 wd, since RIM days and holidays are included as work days, for a total of 4.5 days (round up to half-day).
    3.       Prorated entitlement for employees who will work 60 or more work days for RIM in a given year are calculated as follows:
    a.     1/12th of annual entitlement for every calendar month of completed work
    b.    E.g. If George is hired on July 15 2011, he gets 10.5 days of vacation entitlement.
    c.     The number of full months George will have worked by the end of the calendar year is five u2013 Aug to Dec incl. George gets no entitlement from the 16 days from July 15 to July 31st.
    5 / 12 * 25 days = 10.4 days, rounded up to 10.5 days.
    Thanks,
    Mani.
    Edited by: saphrtime on Apr 21, 2011 5:19 PM
    Edited by: saphrtime on Apr 21, 2011 5:21 PM

Maybe you are looking for

  • How can I apply a Brazilian University to iTunes U?

    Is there any way to apply an institution from Brazil to be included at iTunes U?

  • Variable Name Problem

    Hi all, By refering flash remoting variable declaration documents, it says we can have a variable with $ and _ as a part of the variable. i am using Flash Media server2, And PHP (version5.0.5); for remoting. when ever i used variable name with _ crea

  • Can't turn bluetooth off, unspecified network in my computer.

    Why can't I turn my computer bluetooth off? And why is there an unspecified network in my computer? And why do the bluetooth file exchange automatically opens at the same time when all the above happens? Why do I have to reformat my computer and impo

  • Asynchronous Call By Reference Examples

    The asynchronous Call By Reference feature was added to LabVIEW 2011 which introduced the Start Asynchronous Call node and the Wait On Asynchronous Call node. However, an oversight lead to the examples for this feature only being installed with the w

  • Palm GPS Bluetooth Problem

    Hello, I am trying to pair a Palm GPS unit with my mac. I go through all the steps using the Bluetooth Assistant ending with an apparently successful pairing. However, when i open bluetooth prefs the Palm GPS shows up as 'not connected'. Anyone know