Here you go

Wednesday, February 17, 2016

Update / Create Employee Proposed Salary



Table :




You can upload employee salary by using following procedure:



DECLARE

LB_INV_NEXT_SAL_DATE_WARNING    BOOLEAN;
LB_PROPOSED_SALARY_WARNING      BOOLEAN;
LB_APPROVED_WARNING             BOOLEAN;
LB_PAYROLL_WARNING              BOOLEAN;
LN_PAY_PROPOSAL_ID              NUMBER;
LN_OBJECT_VERSION_NUMBER        NUMBER;

LV_ERROR_DESC                   VARCHAR2(500);

CURSOR C_EMP IS

    SELECT
        *
    FROM
        MJ_EMPLOYEE_SALARY_LOAD_TEMP
    WHERE
        PROCESS_FLAG    =   'N'
        AND ASSIGNMENT_ID = 8106;
   
    
   
BEGIN

    FOR I IN C_EMP LOOP

        DBMS_OUTPUT.PUT_LINE(' Processing Assignment Id : ' || I.ASSIGNMENT_ID);

        BEGIN

            HR_MAINTAIN_PROPOSAL_API.CRE_OR_UPD_SALARY_PROPOSAL
            (   
                -- INPUT DATA ELEMENTS

                 P_BUSINESS_GROUP_ID            =>  81, --FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID'),
                 P_ASSIGNMENT_ID                =>  I.ASSIGNMENT_ID,
                 P_CHANGE_DATE                  =>  I.EFFECTIVE_DATE,
                 P_PROPOSED_SALARY_N            =>  I.ACTUAL_SALARY,
                 P_APPROVED                     =>  'Y',
                 -- OUTPUT DATA ELEMENTS
                 -- --------------------------------
                 P_PAY_PROPOSAL_ID              => LN_PAY_PROPOSAL_ID,
                 P_OBJECT_VERSION_NUMBER        => LN_OBJECT_VERSION_NUMBER,  
                 P_INV_NEXT_SAL_DATE_WARNING    => LB_INV_NEXT_SAL_DATE_WARNING,
                 P_PROPOSED_SALARY_WARNING      => LB_PROPOSED_SALARY_WARNING,
                 P_APPROVED_WARNING             => LB_APPROVED_WARNING,
                 P_PAYROLL_WARNING              => LB_PAYROLL_WARNING
            );
            
           
            UPDATE
                MJ_EMPLOYEE_SALARY_LOAD_TEMP
            SET
                PROCESS_FLAG    =   'Y',
                STATUS          =   'S',
                REMARKS         =   'Uploaded'
            WHERE
                ASSIGNMENT_ID = I.ASSIGNMENT_ID;      
           
            COMMIT;
           
        EXCEPTION WHEN OTHERS THEN


            LV_ERROR_DESC   :=  SUBSTR(SQLERRM,1,480);
           

            UPDATE
                MJ_EMPLOYEE_SALARY_LOAD_TEMP
            SET
                PROCESS_FLAG    =   'N',
                STATUS          =   'E',
                REMARKS         =   'Error Occurred : '
            WHERE
                ASSIGNMENT_ID   = I.ASSIGNMENT_ID;      
           
            COMMIT;

      
         DBMS_OUTPUT.PUT_LINE ('Error occurred :' ||  SQLERRM);

        END ;




    END LOOP;
 

EXCEPTION
       WHEN OTHERS THEN

DBMS_OUTPUT.PUT_LINE ('Error occurred : ' || SQLERRM);
   
END;





No comments:

Post a Comment

Thanks for making a comment.