PE02 - PCR Calculation

Hi,
I have the following requirement -
I want to extract the decimal part of the amount. To do this, I have to keep the amount in a  var and then use ROUND operation (rounding down), substract the var amount from the rounded amount and there extract it.
Could anyone tell me how to do this above operation. I need a sample PCR code for this above logic to code in PE02.
Thank you

Hi,
I have pasted my code below,
5000 Annual Leave Encashment
AMT=& ZHRY Set
AMT*KZLEAM Multiplication
AMT/KZLEAD Division
MULTI ANA Multipl.amt/no/rate
ROUNDG-100 Round AMT down
ADDWT&5000 VAR Variable table
FILLF A Fill amt/no/rate
AMT- &5000 Subtraction
AMT*-1 Multiplication
AMT?0.5 Comparison
<
=
>
BREAK Break for ABAP pref.
My amount is greater than 0.5, but it does not hit the break statement...
My objective is to find if the amount is greater than 0.5 for the decimal part
Please use PRINT operation after ROUNDG-100 Round AMT down after AMT- &5000 Subtraction and after AMT*-1 Multiplication so to output amount. We will review when you post results back.
Thanks

Similar Messages

  • Complex PCR calculation - Reg

    Hi Gurus,
    Please go through the following PCR with input & output tables and explain the calculation. What to do to get the proposed value.
    IT
    /092 -   Rate: 12.07
    WT X000 OT 1.5 rate- Number: 45.00
          Z015      3            AMT?0
          Z015      3   =        NUM?0
          Z015      3   = *      RTE?0
          Z015      3   = * =    VALBS?
          Z015      3   = * = X  GCY Z115*
          Z115      *           VAKEYALZNR
          Z115      *   N        VWTCL 18
          Z115      *   N *      GCY ZZ15
          ZZ15      *            WGTYP?
          ZZ15      *   ****     VALBS0
          ZZ15      *   ****     ADDNA *
          ZZ15      *   ****     FILLF N
          ZZ15      *   ****     WGTYP=*
          ZZ15      *   ****     VALBS1
          ZZ15      *   ****     NEXTR A
          ZZ15      *   ****     ADDNA *
          ZZ15      *   ****     FILLF N
          ZZ15      *   ****     WGTYP=*
          ZZ15      *   ****     VALBS2
          ZZ15      *   ****     ADDNA *
    OT
    WT X000   Rate: 18.11 Number: 45.00 Amt 814.95
    Supposed formula here is: 12.07 * 45.00 * 1.5 =  814.725 ( Proposed Value )
    Plese explain the above PCR calculation.

    Hi Remi,
    Thank you for your answer.
    Q. As for processing of your WT X000, what are it's Valuation Bases in V_512W_B ?
    - it is valuated in current wagetype and Valuation basis 092 and rate is 150%. 
    Q. Have you checked through pe04 what is operation VAKEYALZNR ? Isn't it related to Alternative Payment ?
      yes, it is alternative payment.
    P.S. : 12.07 x 1.5 = 18.105, which will give 18.11 once it is rounded up.
    A: we never used any round up function,
    Though we not used the roundup function why it is rounded up. How and where can we remove this roundup.
    Thank you for your help.
    Rgds
    -AADI

  • Notice days Calculation Error.....

    Dear Experts.....
    I am facing the problem that when i run the leaving action and give the notice period salary to employee system will generate wrong calculation. If i didnot run the leaving action then amount is rightly calculated. Plz find the below RX table entries...
    /101 Total gross                                                    23,885.00
    /110 Net payment                                                        23.00-
    /550 Statutory n                                                    23,885.00
    /557 Cash Paymen                                                    23,862.00
    /560 Payment Amo                                                    23,862.00
    /700 Wage/salary                                                    23,885.00
    /840 Diff. to av01                                   9.00
    /840 Diff. to av02                                   9.00
    3 /001 Valuation b01                                                   6,970.00
    3 /001 Valuation b02                                                   6,970.00
    3 0001 Basic Pay  01                                                   1,441.00
    3 0002 House Rent 01                                                     649.00
    3 0003 Utility    01                                                      72.00
    3 0004 Medical    01                                                      86.00
    3 1001 Attendance 01                                                      30.00
    3 6001 EOBI Eploye01                           10.00                      23.00-
    3 6002 EOBI Employ01                           10.00                     114.00
    3 7002 Notice Peri01                                  31.00           21,607.00
    Employee salary is 7000/-, and notice days are 31 mean one month salary but see the above calculation amount. I have tried PRCL 20 also, but no effect.
    Below check the PCR calculation in Payroll, here system is not calculating anything.
    3 /001 Valuation b01                                                   6,970.00
    3 /001 Valuation b02                                                   6,970.00
    3 0001 Basic Pay  01                                                   4,468.00
    3 0001 Basic Pay  02                                                   4,468.00
    3 0002 House Rent 01                                                   2,011.00
    3 0002 House Rent 02                                                   2,011.00
    3 0003 Utility    01                                                     223.00
    3 0003 Utility    02                                                     223.00
    3 0004 Medical    01                                                     268.00
    3 0004 Medical    02                                                     268.00
    3 1001 Attendance 01                                                      30.00
    3 6001 EOBI Eploye01                                                      23.00-
    3 6002 EOBI Employ01                                                     113.00
    3 7002 Notice Peri01                                  31.00
    Please help me, how to remove this error.

    Abhihash -
    Your suggestion worked good, thanks! Thank you too Naga.
    One more question please. I have grouped on {Asgnmnt.GroupName} for the different departments and have added this code to the details section and suppressed it to remove the duplicates...
    Here's the code....{CallLog.CallID} = Next( {CallLog.CallID})
    My question: Is this the best way/method to remove duplicates?
    I also going to add a Summary to count the days for each group - should I use 'Count' or 'Distinct Count' to get an accurate count of the days?
    Thx.
    G.

  • Please explain the PCR ZY03

    Hi,
    Can any one explain the below PCR calculation.
    This is the valuation basis for /092
    The amount = 950
    daily working hours = 7.5 hours
    TABLE 508A
    NUM=BTGSTDZ
    DIVIDE ANR
    ZERO = A
    ZERO = N
    ADDWT *
    Your immediate response is highly appreciable.
    Rgds
    AADI

    TABLE 508A
    Read table T508A  (use se16n to look at the table if you require)
    NUM=BTGSTDZ
    If I remember correctly, NUM= will set the number field, B is according to Table Values, and TGSTD should be the table field.  The Z seems out of place since the operation only has 10 characters.  Use t-code pe04 to learn more on operation NUM, concentrating on the 6 operands for table fields.
    DIVIDE ANR
    Divide the Amount by the Number, and write the result into the Rate field.
    ZERO = A
    Zero out the Amount field
    ZERO = N
    Zero out the Number field
    ADDWT *
    Write the WT into the Output Table (also called Input Table, or IT).

  • Help required in configuring counting rule

    I have limited experience in SAP-HR configuration. Kindly help me quota configuration. The client has only absence type u2013 Earned Leave. The leave rule is the same for all the employees. The leave rules are:
    1.     The employees are credited with earned Leave on Jan 1 every year, for the attendance days put in during the previous calendar year.
    2.     The employee is eligible for Earned Leave only if he has attendance for at least 240 days during the previous year. If the employee has joined the company during the middle of the previous year, then he should have attendance for at least 2/3 of the remaining working days during the year.
    3.     The employee should be credited with 1 day EL for every 20 working days. If the employee, for example, has worked for 268 days during the year then he should be credited with 13 days EL (268/20=13, with 8 days as remainder). The remainder days, if any, should be carried forward to the next year and considered at that point as added to the number of working days. E.g. employee has worked for 268 days in year 2010. He will be credited with 13 days EL on 1 Jan 2011. Assume he has worked for 256 days in year 2011. Then while creating the absence quota for EL on 1 Jan 2012, the system should consider working days as 256 (from year 2011) + 8 (remainder from year 2010) = 264. Hence the employee should be credited with 13 days of EL on 1 Jan 2012 (264/20 = 13 days; 4 days remainder).
    4.     Leave carry forward rules: The employee is allowed to carry forward the EL balance to the next year. However, after carry forward the total balance should not go beyond 30 days. Any thing in excess of 30 days will get lapsed, if it is not encashed.
    Kindly let me know how to configure the counting rule & the deduction rule for the above scenario.

    Hi
    Configuring of EL need PCR Calculation and Standard Configuration with time Types
    000010            D VARSTCURMO
    000020 **           COLOP*
    000030 04         D VARSTFDYPP
    000040 04 N
    000050 04 Y       D HRS=0     HRS=FR11C HRS?300
    000060 04 Y *
    000070 04 Y <     D HRS-300   HRS*-1    ADDDB9509 ADDDB9558 HRS?15
    000080 04 Y < *   Z HRS=0     HRS=M9500 GCY ZAC2
    000090 04 Y < <   Z GCY ZAC3
    this when u go for GCY ZAC2
               D HRS?10
             D HRS/10    ROUNDH<60HHRS?CELACR
    *        D HRS-CELACRHRS?0
    * *        HRS*-1    ADDDB9501
    * >        HRS=0     ADDDB9500ZADDMB9500ZADDDB9501ZADDMB9501Z
    >          HRS=0     ADDDB9500ZADDMB9500ZADDDB9501ZADDMB9501Z
    <            HRS=0     HRS=CELACRADDDB9501 HRS=0     ADDDB9500ZNEXTR A
    <        A   ADDMB9500Z
    This when u click ZAC3
    000010            D HRS=0     HRS=M9500 HRS?10
    000020 *            HRS/10    ROUNDH<60HADDDB9557 HRS-D9509 ADDDB9556 NEXTR A
    000030 *        A D HRS*-1    HRS?0
    000040 * *          COLOP*
    000050 * >          ADDDB9501 HRS=0     ADDDB9500ZADDMB9500ZADDDB9509ZNEXTR A
    000060 * >      A   ADDMB9509Z
    000070 <            HRS=0     HRS=M9509 ADDDB9501 HRS=0     ADDDB9500ZNEXTR A
    000080 <        A   ADDMB9500ZADDDB9509ZADDMB9509Z
    This PCR is for EL with 300 Limit
    Regards
    Raja Sekhar

  • Function/operation

    Hello,
    Can anyone assist me in writing a pcr to calculate two dates? That is, the difference between the hiring date and the current date. So that if employee has worked 1 year for instance, a pcr calculation is processed for him, and the employee has worked 2 years another pcr is processed instead.
    This calculation is similar to that of savings using number of years worked as a basis of calculation.
    Regards,
    The suggestion given should be good enough. Please put in your efforts to write the PCR yourself and then seek help, if you still need it.
    ~Suresh

    Hi,
    operations NUM/RTE/AMT all have the possibility to calculate the difference between two dates.
    Have a look at SAP - documentation for these operations under
    2nd Variant : Table fields --> Operand F (Date Specifications).
    Wilfred.

  • Facing problem in ABAP program "HINCALC0"

    hi all,
               i m facing problem in the  ABAP program "HINCALC0". when i m run this hr program we face problem in processing problem is " No entry in table T512W for key 40 /4OD for time 30.04.2009". plz suggest me hw can i rectify this problem.
    thanks

    Hi,
    As mohan said, you will need to create wage type /4OD. Some of the standand Function/PCR calculating amount and trying to push into /4OD which in not available in the system.
    Regards,
    Karunakar

  • Creation of a PCR for calculation of LTA

    Hi Experts,
    I have an India Payroll requirement where i need to write a PCR with the below conditions:
    1)      The Employees would be eligible for the LTA from the very first month of their Service as per below conditions:
    a)      All active employees in a given month are eligible for LTA for that given month.
    b)      All employees joining the Organization on or before 15th of the month are eligible for LTA of that particular month.
    c)      All employees leaving the Organization on or after 15th of a particular month are eligible for LTA of that particular month.
    2)      Calculation:
    Latest Basic Salary in the month of March *No of months worked in a particular financial year(step2)*LTA Percentage
    For this i would need a wage type which i can use as a counter for the entire financial year.So what model wage types i can use to create a counter wage type which would get stored in CRT and can be used as a factor at the end of the financial year to calculate LTA.
    Thanks & Regards,
    Punam Jha

    Hello Punam,
    Please go through the documentation of payroll function INLTA in your system and then create your schema.
    Best Regards,
    Deepak..

  • Problems!:  calculated fields in Adobe Forms using the ISR/PCR framework.

    Hi there,
    I have made an Adobe form in the ISR framework. Everybody who is familiar with these forms in the framework knows that the adobe form is embedded in a standard webdynpro which consist of a roadmap with three steps.
    Step 1: Fill out the form
    Step 2: Check and fill the form
    Step 3: Submit the form. After submit the form can be send to a manager or can be directly processed in SAP HR.
    Problem 1:
    When I test the adobe form and fill in a number in a field and click on next everything goes fine. But when I click on previous step the value which I filled in before is gone and put to 0,00.
    Problem 2:
    Also another problem is that calculated fields, do not show directly when clicking on next step. When you click on next step and then previous step, then you see the value of the calculated field.
    Problem 3:
    Also another problem is with the calendar function. When I fill in a date by hand and click on next the BADI behind the form sees 00-00-0000. When I use the calendar function everything goes well.
    Who can help me with these 3 problems.
    Greetings.
    Message was edited by: Sandhya Banwarie

    Hi Phil,
       Interesting - I have a similar issue.  We want to use the Request for Transfer scenario in ERP 2005, but it has not been developed in Adobe forms by SAP yet (it isn't available in 2004 either)!  So, we have decided to use the old JSP PCRs instead.
    Your issue is probably because you're using the same 2005 iviews to create your PCRs.  The 2005 PCR iviews are written in WebDynpro, and appear to assume that each one will be an Adobe form!  If you assign the old PCR iviews to your manager (give them the old MSS role under Migrated Content->EP5.0... in the pcd if you have it installed), you will be able to create a PCR with the JSP forms (regardless of the "Entry in Web" setting in QISRSCENARIO).
    The next issue is the approval.  In 2005, transaction SWFVISU has task TS50000075 configured as Java Webdynpro.  You'll need to change that to iView, and specify ID = com.sap.pct.hcm.isrdispatcher.default.  I'm following the UWL item type guide for this at:
    http://help.sap.com/saphelp_nw04s/helpdata/en/b1/cc1357eead454bb144face4a66be7d/content.htm
    Having said this, my approval is not working!  The item type has clearly changed, because the workitem name is no longer a hyperlink (rather annoying), but when I hit the "Launch Task Page" button (default name I think) I get the error:
    "Unable to perform action because the system returned an invalid URL"
    I can't see this "invalid url" anywhere in the logs, so I can't see where it is getting it from, or what path, etc I'm meant to put!  In your old system, what did you have as the "Server for ISR call" under "Additional Data for Scenario" in QISRSCENARIO?  Also, what did you have in the "URL" box that appears under the Additional Data for Scenario button when you change the Entry Type to JSP?
    Many thanks,
    Russell.

  • PCR for years of service calculation in time management

    Hi all,
    i need to write a PCR for calculating the years of service from a date type in time management.
    HRS=FYAD01 gives me the full years but i need the exact fraction.
    suppose years of service is 5 years 6 months i should get 5.5 years in HRS?
    can anyone please help me?

    Hi semvladigo,
    I have problem..I am very new to writing PCRs for time management.
    Could you refer some articles or to some pages where the PCR s have been explained.
    I  am in need to write a PCR for calculating the Leave Quotas.
    Conditions:
    The employee should have spent 1825 days in the organization, from his DOJ.For the excess day that he has worked,He would be recieving a leave quota of 2.3 days per a time evaluation period.(Monthly)
    Would you please guide me in writing a PCR for this & where do this PCr to be inserted in the Schema Exactly.
    Have a nice day !
    Best Regards,
    UV SAP

  • PCR"s for Bonus Calculations

    Dear Experts,
    Pls suggest me some solution regarding bonus calcultation for the specific mothe say for eg:apr to June .for the employee's depends on the grade say A1-D1.The bonus varies from 8% to 20% depends on the basic pay of the employee.Pls furnish some solution that will be appreciated.
    Regards
    Chandra

    create a constant in T511K table with value one for particular month for which you want to calculate the bonus, design the pcr so that it will check the value one, if one continue otherwise it will stop.
    using opetation OUTWP you can check the payscale group and level.
    maintain the percentage in T511K, retrieve the rates according to the payscale goup level and populate it to a particualar WT

  • Diff between PCR(Process Change Request) & PCR(Personel Calculation Rule).

    Hi,
    I need to work on  PCR's. Can you provide documentation on PCR's. What is the role of Technical people in PCR's.
    Thanks,
    Rama.

    Hi
    http://help.sap.com/printdocu/core/Print46c/EN/data/pdf/PAXX/PYINT_REGEL.pdf
    Regards
    Pavan

  • PCR Required for calculating absence

    Dear Experts,
    Can anyone please help me in writing a pcr for leave type:- Leave with permission for this leave type it should only calculate HRA,Air Ticket,All Vacation and End of Service Benefits should calculate when ever employee takes this type of leave and basic should not calculate for that type of leave.
    Thaks well in advance.
    With regards
    Shaikh

    As Okan says;
    Operation VARABTYP should be used. Replace the XXXX with the appropriate absence type number, and the rule will only get processed when that leave has been entered. 
    Depending on the function you use to call the PCR you can make it run in different ways, which will affect your results.
    i.e. using ACTIO or IF the system will just check the first absence entered on that day.  ACTIO YYYY AB (where YYYY is your PCR) will run once for every absence entered on that day.  PTIP will run for each line in the TIP table.
    Regards
    Simon

  • How to debug or test PCR?

    Hi guys,
    im an abaper that now configures in HR =), my first shock is that i don't know how to debug or test the pcr´s (the rules that u create on pe02)
    any ideas?

    Hi
    First it is better to understand the meaning of these PCR's and where and why they are used?
    A personnel calculation rule is an instruction to carry out certain tasks in time evaluation and payroll, or in the evaluation of payroll results.
    A personnel calculation rule can be used to check existing conditions, and carry out individual actions accordingly.
    Personnel calculation rules have the same structure as decision trees.
    You can ask the Fun ctional consultant and know the debug of them
    see the master tables for them:
    T52CE and T52C5
    Regards
    Anji

  • Regarding schemas and pcrs

    Hi gurus,
    Though i know about schemas and pcrs..i ahve a small confusion..can anybody clarify me these questions?
    1)why we use schema and functionality of the schema?
    2)why we use subschema and functionality of subschema?
    3)what are the parameters1,2,3,4.
       why do we use these paremters?
       and how it helps... where can we get the documentation for parameters?
    4) what an Function does for schema and subschema?
    5)what an operation does?
    //jack//
    Edited by: michael jack on May 22, 2008 8:47 AM
    Edited by: michael jack on May 22, 2008 8:57 AM

    In simple words schema guides Payroll driver that following path will follow for processing of info types in system. for example if u see the payroll log just think that why infotype 0001 read at start whey system creates bank payment after reading all data? this is all schema
    Second part is subschema help schema if you have little know how of programming you can take it as conditional loop sort of things. :).
    Technical detail is as under (From sapexpert.com)
    Each country payroll version supported by SAP has a program called the "payroll driver" that calculates payrolls. For example, in the U.S., the payroll driver is RPCALCU0, in Mexico it is HMXCALC0, in Canada RPCALCK0 and for international RPCALCX0. Each one is different, but they share a common core of functionality. The job of the payroll driver is to process payroll functions as specified in a payroll schema. These payroll functions each perform a specific job, for example - reading data from infotypes, calculating taxes, and processing wage types. Some functions process payroll rules. Rules are a collection of payroll operations. Each operation does a small unit of work, such as multiplying a wage typeu2019s number by a rate to get an amount.
    Schemas are edited with transaction PE01, and rules                                                                               
    with PE02. Functions and operations are maintained with transaction PE04. To view payroll results,
    use transaction pc_payresult (or in earlier R/3 releases go to Tools>Payroll result>Display in the Payroll menu). (See Figure 1.)The standard payroll schema for a country can be derived from table T500L (see the screen blow). If the country in table T500L has an X in the Old Naming Conv field, then the schema is HR Country Indicator plus 000. Otherwise, it is the ISO Code plus 00. So the U.S. has schema U000, for Mexico it is MX00 and for international its X000.
    Good Luck
    Syed

Maybe you are looking for

  • Lost iWeb domain

    Hi, My HD went bad and I lost the domain for my iWeb site. The site is posted to my .Mac (MobileMe) site. Is there any way to bring the files from there back to iWeb? Thanks, Ray

  • Selecting only columns from a table

    Could someone help me with a SQL query to select all the columns in a table as an array?

  • Missing dimension members in 7.1.3/SQL2000

    After shared members are added to dimension, original members disappear. The dimension has two branches, project and application. Each builds from two rules, one for the hierarchy and one for the leaves, called "requests". The project requests load f

  • SAP DMS configuration

    Hi all, Can we upload primavera files in SAP DMS? What settings are required for that from configuration side of DMS. Kindly help.

  • Update multiple rows with datas from the same table

    i have a table like name version value1 value2 2 A 4,31 3,5 3 A 3,45 10 2 B 6,97 12 4 B 12 16 so name + version is unique i have to update the datas value1 and value2 ( version A) with the datas from version B where the name ( VersionA) = name versio