Calculate Net Salary

Hi all,
I neetd to calculate the net salary of around 2000 employees.i use function to get it from payrun tables
i.e..
CREATE OR REPLACE function xxri_total_net(p_date IN VARCHAR2,p_empno IN NUMBER)
return number
as
v_earn number;
v_ded number;
begin
select nvl(sum(result_value),0)
into
v_earn from xxgod_soe_test where employee_number=p_empno
and base_classification_name='Earnings' and
to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
select nvl(sum(result_value),0)
into v_ded from xxgod_soe_test where employee_number=p_empno
and base_classification_name like '%Deductions%' and
to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
return v_earn-v_ded;
end;
It works fine with 10 sec as execution time,
but when i add it to my reports query it goes slow..
i m adding it as column,
xri_total_net(TO_CHAR(pAaV.effective_date,'MON-YYYY'),papf.employee_number) Net_Salary,
i even tried xri_total_net(TO_CHAR(:p_start_date,'MON-YYYY'),papf.employee_number) Net_Salary,
Thanks N Regards,
Techie

Hi all,
I neetd to calculate the net salary of around 2000 employees.i use function to get it from payrun tables
i.e..
CREATE OR REPLACE function xxri_total_net(p_date IN VARCHAR2,p_empno IN NUMBER)
return number
as
v_earn number;
v_ded number;
begin
select nvl(sum(result_value),0)
into
v_earn from xxgod_soe_test where employee_number=p_empno
and base_classification_name='Earnings' and
to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
select nvl(sum(result_value),0)
into v_ded from xxgod_soe_test where employee_number=p_empno
and base_classification_name like '%Deductions%' and
to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
return v_earn-v_ded;
end;
It works fine with 10 sec as execution time,
but when i add it to my reports query it goes slow..
i m adding it as column,
xri_total_net(TO_CHAR(pAaV.effective_date,'MON-YYYY'),papf.employee_number) Net_Salary,
i even tried xri_total_net(TO_CHAR(:p_start_date,'MON-YYYY'),papf.employee_number) Net_Salary,
Thanks N Regards,
Techie

Similar Messages

  • How to calculate net price based on customized formula

    Hi  all expert,
    I have a requirement in a rental process:
    The price of a rental is defined as daily rate (e.g. 100/day) and monthly rate (e.g. 2500/month).
    when I create a rental contract, I'd like SAP to calculate net price based on contract duration with both rate and use the lower one.
    e.g. rental 5 days. use daily rate = 500; monthly rate = 2500; So use 500.
    e.g. rental >=26 days. use daily rate >= 2600; monthly rate = 2500; So use monthly rate 2500.
    I was think to use price condition scales to set:
    1 - 25 days: 100/day
    >=26 days: 2500/month
    But the problem is there are 30day a month and 31 days a month. When the contract has to calculate partial month, daily rate has to be calculated as monthly rate/actual days in the month.
    How to handle it?
    Thank you in advance!    

    There might be more than one method to resolve the requirement.
    You can develop a routine in t.code VOFM and add it in the column  AltCTy. The logic in the routine can be if the netvalue exceeds 2500, then the net value should be 2500.
    The second option is you can try with using standard. In VK12, after maintaining the pricing as 100/day, go to details. Then in upper limit add value as 2500. Then create a test sales order for 25 days and more than 25 days, then check the values. I think this can help with your scenario.
    Regards,

  • Coding to calculate net purchase order value against the contract?.

    Hi ,
    Please help.
    Can any one send me the coding to calculate net purchase order value against the contract?.
    Thanks

    I got the below coding and information from SDN, would you please help me to fix this coding
    infomation from SDN
    For the above requirment I have coded a program in Endroutine but it is not populating cummulative Order value against Contract.
    DATA:
    WA_ty_t_TG_1 TYPE tys_TG_1.
    data: netsum type char15.
    types:begin of ty_net,
    netsum type /BI0/OINET_PO_VAL,
    V_EBELN TYPE /BI0/OIOI_EBELN,
    end of ty_net.
    data:t_net type standard table of ty_net .
    data:wa_net type ty_net.
    SORT RESULT_PACKAGE BY CONTRACT.
    loop at RESULT_PACKAGE INTO WA_ty_t_TG_1.
    WA_NET-V_EBELN = <RESULT_FIELDS>-CONTRACT.
    AT END OF CONTRACT.
    netsum = WA_ty_t_TG_1-NET_PO_VAL + NETSUM.
    ENDAT.
    WA_NET-netsum = NETSUM.
    APPEND WA_NET TO T_NET.
    CLEAR:T_NET,NETSUM.
    ENDLOOP.
    loop at RESULT_PACKAGE assigning <RESULT_FIELDS> .
    READ TABLE T_NET INTO WA_NET WITH KEY
    V_EBELN = <RESULT_FIELDS>-CONTRACT
    <RESULT_FIELDS>-/BIC/YNET_VAL = NETSUM.
    CLEAR: WA_NET-NETSUM.
    endloop.
    <RESULT_FIELDS>-/BIC/YNET_VAL = netsum.
    CLEAR:NETSUM,<RESULT_FIELDS>-/BIC/YNET_VAL.
    ENDLOOP.
    I have coded above one..let me know what mistake I have done.in the bolded loop I have given INTO instead of Assigning, because I need all records which assigns to WorkArea, but while executing DTP its leading to shortdump.if I replace Assigning statement,its working fine. but zero values in output( I think wrong in logic part)
    Let me know the brief coding part if I am wrongly coded.

  • Create employee vendor to post net salary

    Hi Experts,
    We have a client requirement where they want to post employee salary net salary to employee vendor. Currently i have configured employee salary to go to balance sheet account.
    Can someone please tell me how to create employee vendor in HR and then post net salary to employee vendor account so the HR and finance can see employee wise ledger.
    Really appreciate any help.
    Regards,
    Jyoti

    Jyoti,
    If you will refer your message, it is cleared that vendor of this PERNR is not created, In FI end, for every pernr they create vendor, so you please coordiante with FI people to resolve the issue,
    This is a very simply issue, dont know why your FI people is treating like.
    1. No creditor with the search key 1000 LFB1 PERNR 00100005 has been found
    2. No vendor found for this selection
    3. Required field GL_ACCOUNT was not transferred in parameter ACCOUNTGL
    4. Error in document: HRPAY 0000000102 CLNTAVD510
    5. No data was transferred in parameter ACCOUNTPAYABLE
    Further read the doc. of Vendor accuount, you will get more clarity, Please go thru the same and discuss with your FI people
    There are two kinds of vendor accounts available:
    Fixed vendor accounts: Employee grouping for account determination offers the most precise means of control for posting to fixed vendor accounts.
    Employee vendor accounts: Posting to employee vendor accounts enables posting for a specific personnel number.
    In this step, you make entries in table T030 for the assignment of vendor accounts to symbolic accounts.
    Example
    Fixed vendor account
    You want to deduct dues to various unions from the employees in your enterprise. For each union, you have set up a specific wage type for dues and a specific symbolic account. In this step, you assign a fixed vendor account to each of these symbolic accounts.
    Employee vendor account
    You want to post dues to a different vendor account for each employee. To this effect, you have created a symbolic account for all employees. In this step, you specify how the corresponding employee vendor accounts are determined.
    Requirements
    You have created the required vendor accounts in Financial Accounting.
    You have carried out the step Define Symbolic Accounts. In that step, you created symbolic accounts with the relevant account assignment types (KF for fixed vendor accounts, K for personal vendor accounts). In that same step, you flagged the indicator EG-depend  for symbolic accounts to which you want to post in line with the Employee grouping for account determination.
    If you want to post to employee vendor accounts, you have entered the relevant personnel number in one of the following fields in the vendor master data of Financial Accounting. We recommend that you use the Personnel number field. If you use another field, you must enter the personnel number with leading zeros.
    Personnel number
    Search term
    Telephone 2
    Data line
    Teletext number
    Standard settings
    There are no standard settings for posting to vendor accounts. If, in the step Define Symbolic Accounts, you have not created any symbolic accounts with the account types KF or K, you do not have to carry out the step Assign Vendor Accounts.
    Activities
    1. Enter the required chart of accounts.
    2. To make settings for the posting procedure Personnel posting to vendors (HRK), choose Rules
    3. Choose Posting key. Enter the posting key for postings to vendor accounts or copy the default values (21 for debit posting and 31 for credit postings).
    4. Choose Accounts. Make the corresponding entries in the table T030.
    a) If you want to assign a fixed vendor account to a symbolic account, and if required, an employee grouping, enter the number of the vendor account in the Acco column.
    b) If you want to assign an employee vendor account to a symbolic account, and, if required a employee grouping, enter the relevant key (see table below) in the Acco column.
    Personnel number in field (Vendor master data) Entry in the Account column (T030)
    Personnel number    *0002
    Search term    *0001
    Telephone 2    *0003
    Data line    *0004
    Teletext number    *0005

  • Fbl5n - calculate net due date

    Hey All Gurus,
    I am writting a report and want to calculate the net due date which we see in FBL5N. This is a customer aging report, and I have tried using fm DETERMINE_DUE_DATE or J_1A_SD_CI_DATA_GET... is there any other formula that I can use from zfbdt/zfbd1t...
    Please help. Thanks a lot Nina.

    hai,
    my requirement is also to do the customer ageing report will u please help me on that how to calculate net due amount,
    regarda,
    karthik

  • Prepayment not equaling manual net salary

    Dear Gurus,
    Iam runninig prepayment for 1000 employees . But prepayment of 5 employees is not coming equal to net salary(All earnings - All deductions) when calculated manually.
    I dont know why iit is making error in only some employees. Please can anybody help me.
    Regards,
    Muhammad Noman Shafique

    Hi Muhammad,
    Which legislation are you working for ?
    There should be a balance with the name Net or Net Pay
    For these employees, what is the value you see in the table pay_pre_payments for the month.
    Do they have multiple Payment methods defined ? Say with 50% cash and 50% EFT.. or something similar ?
    If that is the case, you might only be checking a part of the payment.
    Its tough to debug such cases w/o seeing the complete details of the setup and employee data.
    Cheers,
    Vignesh

  • Calculate Monthly Salary Without Refresh

    hi,
    i have to calculate salary .i have two select list one for emp_id and second for month.
    when i select emp_id then Emp_name and Salary are coming into text field.
    i want to calculate Advance Salary of Employee ,which is he take in between month and also calculate per day salary .
    i have done this by using code
    i use That code for calculate per Day SALARY
    declare
      l_var   number := 0;
    BEGIN
    IF :P65_MONTH ='JAN' THEN
       l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='FEB' AND MOD(TO_CHAR(SYSDATE,'YYYY'),4)!=0 THEN
       l_var := :P65_SALARY1/28;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='FEB' AND MOD(TO_CHAR(SYSDATE,'YYYY'),4)=0 THEN
    l_var := :P65_SALARY1/29;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='MAR' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='APR' THEN
    l_var := :P65_SALARY1/30;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='MAY' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='JUN' THEN
    l_var := :P65_SALARY1/30;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='JUL' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='AUG' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='SEP' THEN
    l_var := :P65_SALARY1/30;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='OCT' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='NOV' THEN
    l_var := :P65_SALARY1/30;
    RETURN ROUND(l_var,2);
    ELSIF :P65_MONTH ='DEC' THEN
    l_var := :P65_SALARY1/31;
    RETURN ROUND(l_var,2);
    END IF;
    END;That code are used for Advance Payment to Employee in beetween month.
    select nvl(sum(RECEIPT_AMT),0) from EMP_SLRY_DTL where month=:P65_MONTH and emp_id=:P65_EMP_ID group by MONTH,to_char(sysdate,'yyyy'),emp_idHere Emp_name and Salary Comes without refresh into text field when i select Emp_id from select list.
    but when i select Month from select list then page is refresh because i have to select Select list with submit .When page is refresh then Advance amount and per dat salary comes in to text field.
    I want this without refresh ,when i select month then advance salary and Per Day salary shound Come in to text Field.
    How Can i do this,
    Thanks

    You can do this by using Ajax, and possibly even Dynamic actions.
    1. Onchange on the Select List calla JS function and pass the EMP_ID to the function
    2. Write an Application process that fecthed the name and salary. You can concat the two values with a ':', or use JSON , and return it using htp.p from the application process (On Demand)
    3. In the JS function in step 1 make an ajax call to the OnDemand process
    4. Use $s API to write the returned values into the Pafe Items.
    Regards,

  • Best Method to calculate Net requirement

    Hi Expers,
    can you suggest the best methods to calculate net requirement for FMCG products in APO Production and distribution planning.
    Best Regards,
    Anandharaj

    Hi Anandharaj,
    There are multiple threads, SAP Notes and documentation in the web about this.
    Please read this note that explains everything about Net Requirements:
    448960
    - Net requirements calculation (documentation)
    You can also check this article:
    Net Requirements Versus Pegging in SAP ERP and SAP APO - SAP Planning
    Hope this helps.
    Kind Regards,
    Mariano

  • How to calculate the salary of the employees when they are differentiated by monthly and hourly basis

    Hi all
    How to calculate the salary of the employees when they are differentiated by monthly and hourly basis
    How can we write the logic though sql
    Thanks in advance

    (case when pay_basis like 'HOURLY'
    then PROPOSED_SALARY_N*pay_annualization_factor
    when pay_basis like 'ANNUAL'
    then PROPOSED_SALARY_N*pay_annualization_factor
    end )
    I was actually trying to write the logic in this way but it was not calculating in correct format for hourly paid employees

  • How to Calculate Net weight, Gross Price, Surhcarges for  Confirmed Qty

    Hello,
    I have a requirement where I need to calculate the Net weight, Amount( gross price), Surhcarges etc.. for the Confirmed qty of
    a sales order item. In SAP standard the pricing procedure will run for the Order Qty and all the prices are related to Order qty, not for Confirmed Qty. Confirmed Qty will be sum of all scheudle lines qty.
    Is there any standard Function Module to get the prices and weights for Confirmed qty? Just  I need to display this data in a Report.
    Pelase advise me.
    Thanks.

    Hello,
    Instead of simulating the order I am using the User Exit so that that actaul values will appear in item conditions tab. I am using the Exit USEREXIT_PRICING_PREPARE_TKOMP  where I am doing the sum of the scheduled lines confirmed qty and passing the same to TKOMP-MGAME field and the pricing is calculation is done for the confirmed qty. But I am facing some problems when the order has credit block. When the order credit is released via VKM3, the pricing doesn't updated. When doing the credit release, the order cofirms the full order qty and the pricing(Gross price) is not getting updated.
    How can we run the pricing update in Order change mode with pricing procedure as 'C'.
    Did anyone has worked on this type of req? let me know your thoughts.
    Thanks.
    prabha

  • Calculate Net Book Value For Asset

    Hi Guru,
       how I Can Coding Program for calculate Asset Net Book Value ( Function Module or Formula)
    Regards,
    Supperkorn

    use :
    (1) logical database ADA and structure anlcv
    or
    (2) fm FI_AA_VALUES_CALCULATE
    field anlcv-lfd_bchwrt for current NBV
    hope  that helps
    Andreas

  • Not able to calculate net weight

    Hi
    After I create a Delivery, when I do 'Calculate Weight/Volume' the system does not give me any result. This happens for only some items only. When I checked up the physical attributes, some of the items have net weight in their physical attributes, but still the weight / volume calculation fails. However, I am able to ship confirm and process the order, but in the shipping reports I get net weight as zero.
    1. Where should I check up for this error?
    2. What tables should I query to get the physical attributes of the item? Say I want a list of all items whose net weight is null.
    Regards,

    I checked in the in the mtl_system_item_b, I see the value defined for the item
    Unit weight as : 1.05, Weight UOM code: KG
    But Volume UOM code and unit volume are null and do you think making these 2 columns populate will solve the issue?
    I checked the code and saw that query
    SELECT dd.delivery_detail_id,
    dd.requested_quantity,
    dd.shipped_quantity,
    dd.requested_quantity_uom,
    dd.net_weight,
    dd.weight_uom_code,
    dd.volume,
    dd.volume_uom_code
    FROM wsh_delivery_details dd,
    wsh_delivery_assignments da,
    wsh_new_deliveries nd,
    oe_order_lines_all ol
    WHERE dd.delivery_detail_id = da.delivery_detail_id AND
    da.delivery_id = nd.delivery_id AND
    da.delivery_id IS NOT NULL AND
    ol.line_id = dd.source_line_id AND
    dd.source_code = 'OE' and
    nd.delivery_id =224006
    AND dd.container_flag = 'N' AND
    dd.oe_interfaced_flag = 'N' and
    dd.released_status = 'C' and
    NVL(dd.shipped_quantity, 0) > 0;
    I see that net weight is populated but not the weight UOM code. Any help on this would be appreciated.
    Regards,

  • HOW TO CALCULATE NET SALES AND CONTRACT PRICE?

    Dear experts,
    I have the requirement of sales price report
    the report layout should be
    Prod descr    material Number   Contract type  contrcat name     rebate  net sales  contract price  units
    we have the master data information is reside already in multiprovider and transaction information how to calculate in frond end ?
    for sales  pricing report how to manipulate teh net sales and contract  price
    value?
    any standard formulaes is there?
    plz suggest  me
    regards

    Hi,
    For quick and best response unless someone answer's in this forum, post your question in SAP Community Network Forums » SAP Solutions » ERP - Sales and Distribution (SD) General   or something related to your question.
    Check this link if it helps -
    http://help.sap.com/saphelp_46c/helpdata/en/93/74353e546011d1a7020000e829fd11/frameset.htm
    Thanks,
    Shambhu.

  • User exit for pricing to calculate net sales value and tax at billing level

    Hi,
    Can anyone give the solution for below thing.
    I have written the code for to calculate the net sale a value and tax value based on condition types YTN1 & YTN2 and with pricing procedure "ZXTNIC"  under   user exit "userexit_field_modification"  in include program LV69AFZZ
    Calculation as per below
    FD:
    The user exit will run on the values of the line item and the header of the pricing conditions
    The user exit will subtract the current net value from the value of the conditions YTN1 & YTN2, also the Tax value will be added to the value of the conditions YTN1 & YTN2.
    Need the Net value = 8,032 and not 8,882  " here 8832 value is before calculation
    This value will be calculated as follows = Current Net u2013 YTN1 u2013 YTN2 = 8,882 u2013 0,773 u2013 0,077 = 8,032
    Need the Tax value = 2,395 and not 1,545  " here 1545 value is before calculation.
    This value will be calculated as follows = Current Tax + YTN1 + YTN2 =     1,545 + 0,773 + 0, 077 = 2,395
    When i will execute the VF01 transaction there in initial screen values are not updating automatically.Once we will select item line and  then clicking on " item pricing condition" icon i.e., item level , then only the values are updating both in item level and header level.
    But when we will execute the VF02 and VF03 the values are updating automatically as per condition.
    So please suggest me is there any exit for this requirement.
    Regards,
    Jayaram

    Hi,
    You should implement your logic in VOFM Copying routine for billing document.
    Regards
    Prasenjit

  • How to Calculate Basic Salary by Calculating 2 Wage Type

    Hi SAP Gurus
    I want to calculate basic pay = norm salary * RSP %.
    RSP% is just a wage type for an employee.
    If we configure RSP % as a wage type  and Norm salaray as a wage type, is it possible to set-up basic-pay = Norm salary * RSP %, Both these values will be entered in Infotype 0008. (RSP% is different for each employee. It will be entered in IT0008 directly).
    The SUMME and PRZNT modules use percentage stored in the summe and prznt table and not the number entered in wage type in 0008. Is it possible to use UNITS Module for that, IF yes then How let me know pls.
    Thanks in Advance
    Regards
    Rajiv Maheshwari

    The other way coming to mymind is - configure annual wage type or total salary wage type  - then you can define the % of basic and other WT you want to include in IT0008.
    hope this helps...
    Bas

Maybe you are looking for

  • Dont read this if you dont want to make money

    MAKE LOTS OF MONEY QUICKLY, GUARANTEED 100%, NO SCAM! Turn 6.00 into 42,000! This is true!!.... Read this carefully to find out how!!.... READING THIS WILL CHANGE YOUR LIFE! I found this on a bulletin board and decided to try it. A little while back,

  • Adding messages to the Variable entry screen in web report

    I need to add a message or note to the variable selection screen on a web report. I need this message or note to be displayed somewhere on the same screen with the variable list. I found something similar in BW Expert regarding pop-up messages, but t

  • Can OutputStream be overridable?

    Can OutputStream be overridable? Is there a pointer on OutputStream, that can be set? What methods? Thanks.

  • Problem with 'first play'

    My first play is set to the main menu. For some reason if I don't go back to main menu before ejecting, then when I put it back in it starts where I stopped rather than main menu. This only happens on computer, not in DVD player. Any ideas. I'm using

  • MSCRM Email Router not processing digitally signed emails

    In my production environment digitally signed incoming emails are not getting processed and stay there in inbox.  Does Email Router supports Digitally signed emails ? Thanks in Advance - Vijay