1.Go PA40 and find program name via system - status
2.Double click on program - after that Go to menu object directory find package name
In SE84 - Go under enhancements
*&---------------------------------------------------------------------*
*& Include ZXPARAU02
*&---------------------------------------------------------------------*
DATA ls_008 TYPE pa0008.
SELECT SINGLE * FROM pa0008 INTO ls_008 WHERE pernr = personnel_number
AND begda LE salary_as_of_date
AND endda GE salary_as_of_date.
IF sy-subrc = 0.
it0008_salary = ls_008-ansal.
ENDIF.
*&---------------------------------------------------------------------*
*& Include ZXPADU01
*&---------------------------------------------------------------------*
IF innnn-infty = '0021'.
DATA : ls_0021 TYPE p0021.
FIELD-SYMBOLS : <fs_0021> TYPE p0021.
ASSIGN ls_0021 TO <fs_0021>.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = <fs_0021>.
IF <fs_0021> IS ASSIGNED.
IF <fs_0021>-subty = '11'.
<fs_0021>-fasex = 1.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = <fs_0021>
IMPORTING
prelp = innnn.
ENDIF.
ENDIF.
ELSEIF innnn-infty = '0016'.
DATA : ls_0016 TYPE p0016.
FIELD-SYMBOLS : <fs_0016> TYPE p0016.
ASSIGN ls_0016 TO <fs_0016>.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = <fs_0016>.
IF <fs_0016> IS ASSIGNED.
<fs_0016>-cttyp = '10'.
<fs_0016>-prbzt = 6.
<fs_0016>-prbeh = '012'.
<fs_0016>-kdgfr = space.
<fs_0016>-kdgf2 = space.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = <fs_0016>
IMPORTING
prelp = innnn.
ENDIF.
ENDIF.
*
**&---------------------------------------------------------------------*
**& Include ZXPADU02
**&---------------------------------------------------------------------*
******* Validation for External Employee
******** Added by chellam - 08.05.2015 Req by Sivasankar
*DATA : lv_vendor TYPE ekko-lifnr,
* lv_ebeln TYPE ekpo-ebeln,
* lv_ebelp TYPE ekpo-ebelp,
* lv_kostl TYPE p0315-kostl,
* lv_lstar TYPE p0315-lstar,
* lv_werks TYPE ekpo-werks.
*CLEAR : lv_vendor , lv_ebeln , lv_ebelp,lv_kostl,lv_lstar,lv_werks.
*
*FIELD-SYMBOLS: <f0008> TYPE any.
*
*DATA: p0008 TYPE p0008,
* gs_p0001 type pa0001,
* gs_pa0002 TYPE pa0002.
**IF INNNN-INFTY = '0008'.
** ASSIGN innnn to <f0008>.
***move innnn to p0008.
*
**endif.
**break testing.
*
**IF sy-uname = 'TESTABAP'.
*IF innnn-infty = '0315'.
** IF I503-PERSK = 'Z3'.
** IF INNNN-DATA1 IS NOT INITIAL.
** LV_VENDOR = INNNN-DATA1+26(10).
** LV_EBELN = INNNN-DATA1+36(10).
** LV_EBELP = INNNN-DATA1+46(5).
** IF LV_VENDOR IS INITIAL.
** SET CURSOR FIELD 'P0315-LIFNR'.
** MESSAGE 'Vendor Number Missing' TYPE 'E'.
** EXIT.
** ELSEIF LV_EBELN IS INITIAL.
** SET CURSOR FIELD 'P0315-EBELN'.
** MESSAGE 'Purchase Order Number Missing' TYPE 'E'.
** EXIT.
** ENDIF.
** ENDIF.
** ELSE
* IF i503-persk <> 'Z3'.
** BREAK TESTABAP.
* IF innnn-data1 IS NOT INITIAL.
* lv_kostl = innnn-data1+0(10).
* lv_lstar = innnn-data1+10(5).
* lv_werks = innnn-data1+22(4).
* IF lv_kostl IS INITIAL.
* SET CURSOR FIELD 'P0315-KOSTL'.
* MESSAGE 'Cost Center Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ELSEIF lv_lstar IS INITIAL.
* SET CURSOR FIELD 'P0315-LSTAR'.
* MESSAGE 'Activity Type Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ELSEIF lv_werks IS INITIAL.
* SET CURSOR FIELD 'P0315-WERKS'.
* MESSAGE 'Plant is Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.
**ENDIF.
*
*IF innnn-infty = '0008' .
*
* SELECT single * from pa0001 into gs_p0001 where pernr = innnn-pernr and begda le innnn-begda and endda le innnn-endda.
*
* if sy-subrc = 0.
*
* if gs_p0001-bukrs+0(2) ne 'IN'.
* EXIT.
*
* endif.
* endif.
*
****IF sy-ucomm = ' '.
* DATA :lv_tpa TYPE p DECIMALS 2,
* lv_1004 TYPE p DECIMALS 2, "added by raviteja
* lv_1008 TYPE p DECIMALS 2, "added by raviteja
* lv_1000 TYPE p DECIMALS 2, "added by raviteja
* lv_basic TYPE p DECIMALS 2,
* lv_sumbb TYPE p DECIMALS 0,
* cnt_wage TYPE i. "added by raviteja
* DATA: gs_basicpay TYPE zhr_basic_amount.
*
* DATA :gv_lgart TYPE p0008-lga01,
* gv_betrg TYPE p0008-bet01.
*
* FIELD-SYMBOLS: <fs_betrg> TYPE p0008-bet01,
* <fs_lgart> TYPE p0008-lga01.
*
* DATA: lv_tpa1 TYPE p DECIMALS 2,
* gv_tpa_change TYPE p DECIMALS 0,
* flag TYPE c. " FOR 1004 WAGE TYPE LGART NO INITIAL.
*
*
* CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
* EXPORTING
* prelp = innnn
* IMPORTING
* pnnnn = p0008.
*
* IF p0008-ansal IS NOT INITIAL.
********** addded by chellam - 02.06.2015
* DATA: it_dynpread TYPE STANDARD TABLE OF dynpread,
* wa_dynpread TYPE dynpread,
* lv_repid TYPE sy-repid,
* lv_dynnr TYPE sy-dynnr.
*
***********************************************************************************************
* CLEAR : it_dynpread[].
* lv_repid = 'MP000800'.
* lv_dynnr = '0300'.
* CALL FUNCTION 'DYNP_VALUES_READ'
* EXPORTING
* dyname = lv_repid
* dynumb = lv_dynnr
* request = 'A'
* TABLES
* dynpfields = it_dynpread.
*
* LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-BETRG' AND stepl = 2
* AND fieldvalue IS INITIAL.
* show_data_again = 'X'.
* ENDLOOP.
*
* CLEAR: lv_tpa. "added by raviteja
*
* DO 10 TIMES VARYING gv_lgart FROM p0008-lga01 NEXT p0008-lga02
* VARYING gv_betrg FROM p0008-bet01 NEXT p0008-bet02.
* IF ( gv_lgart = '/TPA' ) AND ( p0008-ansal IS NOT INITIAL ).
*
* IF p0008-trfgr+0(1) = 'A'.
* lv_tpa = p0008-ansal * 25 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'B'.
* lv_tpa = p0008-ansal * 20 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'C'.
* lv_tpa = p0008-ansal * 15 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'D'.
* lv_tpa = p0008-ansal * 10 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'E'.
* lv_tpa = p0008-ansal * 5 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'F' or p0008-trfgr+0(3) = 'CEO' or p0008-trfgr+0(3) = 'EVP'.
* lv_tpa = p0008-ansal. " No Variable pay
* ENDIF.
* ENDIF.
* ENDDO.
* ENDIF. " by raviteja
*
*
* IF lv_tpa IS NOT INITIAL. " by raviteja
*
* IF p0008-trfgr+0(1) = 'F' or p0008-trfgr+0(3) = 'CEO' or p0008-trfgr+0(3) = 'EVP'.
* lv_tpa = 0. " No variable pay " by raviteja
* ENDIF.
* lv_tpa1 = ( p0008-ansal - lv_tpa ) / 12.
*
***** CLEAR: gv_tpa_change.
***** LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-BETRG' AND stepl = 1.
***** " AND fieldvalue IS INITIAL.
*****
***** REPLACE ALL OCCURRENCES OF ',' IN wa_dynpread-fieldvalue WITH space.
***** CONDENSE wa_dynpread-fieldvalue NO-GAPS.
*****
***** MOVE wa_dynpread-fieldvalue TO gv_tpa_change.
*****
***** IF lv_tpa1 <> gv_tpa_change.
*****
***** show_data_again = 'X'.
*****
***** ENDIF.
*
**** show again action based on total value-Q0008-SUMBB
* LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-SUMBB' AND stepl = 0
* AND fieldvalue IS NOT INITIAL.
*
* REPLACE ALL OCCURRENCES OF ',' IN wa_dynpread-fieldvalue WITH space.
* CONDENSE wa_dynpread-fieldvalue NO-GAPS.
* MOVE wa_dynpread-fieldvalue TO gv_tpa_change.
* lv_sumbb = p0008-ansal / 12.
* IF lv_sumbb <> gv_tpa_change.
* show_data_again = 'X'.
* ENDIF.
* ENDLOOP.
*
* lv_1008 = ( lv_tpa / 12 ). "added by raviteja
*
* lv_basic = ( lv_tpa1 * 30 ) / 100.
*
* IF lv_basic < 3100.
* lv_1004 = 620.
*
**** Fetching basic pay
* SELECT SINGLE * FROM zhr_basic_amount INTO gs_basicpay WHERE lgart = '1000' AND endda = '99991231'.
* IF sy-subrc = 0.
* lv_1000 = gs_basicpay-betrg.
* ENDIF.
*
* ELSEIF lv_basic >= 3100 AND lv_basic <= 3500.
* lv_1004 = ( lv_basic * 20 ) / 100.
* ELSEIF lv_basic > lv_1004 AND lv_basic < 10000.
* lv_1004 = 700.
* ELSEIF lv_basic >= 10000.
* lv_1004 = ' '.
*** p0008-lga06 = ' '.
* ENDIF.
*
* p0008-bet01 = lv_tpa1. "added by raviteja
*
***** fOR VARIABLE PAY
* CLEAR cnt_wage.
* DO 10 TIMES VARYING gv_lgart FROM p0008-lga01 NEXT p0008-lga02
* VARYING gv_betrg FROM p0008-bet01 NEXT p0008-bet02.
***** cnt_wage = cnt_wage + 1.
*
* ASSIGN gv_lgart TO <fs_lgart>.
* ASSIGN gv_betrg TO <fs_betrg>.
* IF gv_lgart = '1008'.
* IF lv_1008 IS NOT INITIAL.
* <fs_betrg> = lv_1008. "added by raviteja
* ELSE.
* <fs_lgart> = ' '.
* <fs_betrg> = lv_1008.
* ENDIF.
***** EXIT.
* ENDIF.
* IF gv_lgart = '1004'.
* IF lv_1004 IS NOT INITIAL.
* <fs_betrg> = lv_1004. "added by raviteja
* flag = 'X'.
***** EXIT.
* ELSE.
* <fs_lgart> = ' '.
* ENDIF.
* ENDIF.
*
* IF gv_lgart = '1000'.
* IF lv_1000 IS NOT INITIAL.
* <fs_betrg> = lv_1000. "added by raviteja
***** EXIT.
* ELSE.
* <fs_betrg> = ' '.
* ENDIF.
* ENDIF.
*
* IF lv_1004 IS NOT INITIAL.
* IF gv_lgart IS INITIAL AND flag = ' '.
* <fs_lgart> = '1004'.
* <fs_betrg> = lv_1004.
* EXIT.
* ENDIF.
* ENDIF.
*
* ENDDO.
****endif.
****** Variable Compensation distribution **************************************
* IF sy-ucomm = 'UPD'.
*
* SUBMIT zhrcss_variable_compensation WITH pnppernr = p0008-pernr
* WITH pnpbegda = p0008-begda
* WITH pnpendda = p0008-endda
* WITH p_ansal = p0008-ansal
* WITH p_trfgr = p0008-trfgr
* WITH p_trfst = p0008-trfst
* WITH p_vrsal = lv_tpa
* AND RETURN.
**********************************************************************************
* ENDIF.
* cl_hr_pnnnn_type_cast=>pnnnn_to_prelp(
* EXPORTING
* pnnnn = p0008
* IMPORTING
* prelp = innnn ).
*
* ENDIF.
**** ENDIF.
*ENDIF.
*
*
********************,,BEGIN OF PRAMODH CHANGES FOR INFOTYPE 80 AND 2001 ************************************************************
*******FOR VALIDATING THE MATERNITY LEAVE MORE THAN 2 CHILDRENS
*
*
*IF innnn-infty = '0080' .
** BREAK-POINT.
*
** if sy-ucomm = 'INS'.
*
* SELECT SINGLE * FROM pa0002 INTO gs_pa0002 WHERE pernr = innnn-pernr
* AND begda LE sy-datum
* AND endda GE sy-datum.
*
* IF ( sy-subrc = 0 ) AND ( gs_pa0002-anzkd GE 2 ).
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
*
** ENDIF.
*
* ENDIF.
*
** BREAK-POINT.
*
*ENDIF.
*
*
*IF innnn-infty = '2001' .
** BREAK-POINT.
*
** if sy-ucomm = 'INS'.
*
* RANGES r_awart FOR p2001-awart. "for ladies
* RANGES: m_awart FOR p2001-awart, "for GENTS
* n_awart FOR p2001-awart,
* w_awart FOR p2001-awart,
* wF_awart FOR p2001-awart .
* .
*
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4040'.
* APPEND r_awart.
*
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4060'.
* APPEND r_awart.
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4070'.
* APPEND r_awart.
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4080'.
* APPEND r_awart.
*
*
* m_awart-sign = 'I'.
* m_awart-option = 'EQ'.
* m_awart-low = '4050'.
* APPEND m_awart.
*
* n_awart-sign = 'I'.
* n_awart-option = 'EQ'.
* n_awart-low = '4030'.
* APPEND n_awart.
*
**** range added by wilson
****FOR MALE***
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '4630'.
* APPEND w_awart.
*
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '4820'.
* APPEND w_awart.
*
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '2830'.
* APPEND w_awart.
*
****FOR FEMALE***
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4825'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4830'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4835'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '2825'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '2835'.
* APPEND wF_awart.
*
**************************** END OF CODE ADDED
*************begin of more than 2 childrens*************
* SELECT SINGLE * FROM pa0002 INTO gs_pa0002 WHERE pernr = innnn-pernr
* AND begda LE sy-datum
* AND endda GE sy-datum.
*
* IF ( sy-subrc = 0 ) AND ( innnn-subty IN r_awart ).
*
* IF gs_pa0002-gesch NE 2.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
*
*
* ELSEIF ( gs_pa0002-anzkd GE 2 ) .
*
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
* EXIT.
*
* ENDIF.
*
* ELSEIF ( sy-subrc = 0 ) AND ( innnn-subty IN m_awart ).
*
* IF gs_pa0002-gesch NE 1.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
*
* ELSEIF ( gs_pa0002-anzkd GE 2 ) .
*
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
* EXIT.
*
* ENDIF.
*
*
* ELSEIF ( sy-subrc = 0 ) AND ( INNNN-SUBTY IN W_AWART ).
*
* IF gs_pa0002-gesch NE 1.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
* ENDIF .
*
* ELSEIF ( sy-subrc = 0 ) AND ( INNNN-SUBTY IN WF_AWART ).
*
* IF gs_pa0002-gesch NE 2.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
* ENDIF .
*
*
* ELSEIF ( innnn-subty IN n_awart ).
* IF ( gs_pa0002-gbdat+4(4) NE innnn-begda+4(4) ) .
*
* IF ( ( gs_pa0002-famdt+4(4) NE innnn-begda+4(4) ) ) .
* MESSAGE: 'Please check your date of birth or marriage Date' TYPE 'E'.
* EXIT.
*
* ENDIF.
* ENDIF.
*
* ENDIF.
*
*ENDIF.
*
*
************************************END OF PRAMODH CHANGES*******************************************************
IF innnn-infty = '0008'.
DATA : ls_0008 TYPE p0008,
gv_ansal TYPE ansal_15,
gt_lgart TYPE STANDARD TABLE OF zlgart.
FIELD-SYMBOLS : <fs_0008> TYPE p0008.
ASSIGN ls_0008 TO <fs_0008>.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = <fs_0008>.
IF sy-subrc = 0 AND i001p-molga = '10'.
SELECT * FROM zlgart INTO TABLE gt_lgart.
READ TABLE gt_lgart TRANSPORTING NO FIELDS WITH KEY lgart = <fs_0008>-lga01.
IF sy-subrc = 0.
gv_ansal = ( ( <fs_0008>-bet01 * 8 ) * 10 ) * 26.
IF <fs_0008>-ansal NE gv_ansal.
<fs_0008>-ansal = gv_ansal.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = <fs_0008>
IMPORTING
prelp = innnn.
show_data_again = 'X'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
*
**&---------------------------------------------------------------------*
**& Include ZXPADU02
**&---------------------------------------------------------------------*
******* Validation for External Employee
******** Added by chellam - 08.05.2015 Req by Sivasankar
*DATA : lv_vendor TYPE ekko-lifnr,
* lv_ebeln TYPE ekpo-ebeln,
* lv_ebelp TYPE ekpo-ebelp,
* lv_kostl TYPE p0315-kostl,
* lv_lstar TYPE p0315-lstar,
* lv_werks TYPE ekpo-werks.
*CLEAR : lv_vendor , lv_ebeln , lv_ebelp,lv_kostl,lv_lstar,lv_werks.
*
*FIELD-SYMBOLS: <f0008> TYPE any.
*
*DATA: p0008 TYPE p0008,
* gs_p0001 type pa0001,
* gs_pa0002 TYPE pa0002.
**IF INNNN-INFTY = '0008'.
** ASSIGN innnn to <f0008>.
***move innnn to p0008.
*
**endif.
**break testing.
*
**IF sy-uname = 'TESTABAP'.
*IF innnn-infty = '0315'.
** IF I503-PERSK = 'Z3'.
** IF INNNN-DATA1 IS NOT INITIAL.
** LV_VENDOR = INNNN-DATA1+26(10).
** LV_EBELN = INNNN-DATA1+36(10).
** LV_EBELP = INNNN-DATA1+46(5).
** IF LV_VENDOR IS INITIAL.
** SET CURSOR FIELD 'P0315-LIFNR'.
** MESSAGE 'Vendor Number Missing' TYPE 'E'.
** EXIT.
** ELSEIF LV_EBELN IS INITIAL.
** SET CURSOR FIELD 'P0315-EBELN'.
** MESSAGE 'Purchase Order Number Missing' TYPE 'E'.
** EXIT.
** ENDIF.
** ENDIF.
** ELSE
* IF i503-persk <> 'Z3'.
** BREAK TESTABAP.
* IF innnn-data1 IS NOT INITIAL.
* lv_kostl = innnn-data1+0(10).
* lv_lstar = innnn-data1+10(5).
* lv_werks = innnn-data1+22(4).
* IF lv_kostl IS INITIAL.
* SET CURSOR FIELD 'P0315-KOSTL'.
* MESSAGE 'Cost Center Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ELSEIF lv_lstar IS INITIAL.
* SET CURSOR FIELD 'P0315-LSTAR'.
* MESSAGE 'Activity Type Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ELSEIF lv_werks IS INITIAL.
* SET CURSOR FIELD 'P0315-WERKS'.
* MESSAGE 'Plant is Missing in Infotype 315' TYPE 'E'.
* EXIT.
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.
**ENDIF.
*
*IF innnn-infty = '0008' .
*
* SELECT single * from pa0001 into gs_p0001 where pernr = innnn-pernr and begda le innnn-begda and endda le innnn-endda.
*
* if sy-subrc = 0.
*
* if gs_p0001-bukrs+0(2) ne 'IN'.
* EXIT.
*
* endif.
* endif.
*
****IF sy-ucomm = ' '.
* DATA :lv_tpa TYPE p DECIMALS 2,
* lv_1004 TYPE p DECIMALS 2, "added by raviteja
* lv_1008 TYPE p DECIMALS 2, "added by raviteja
* lv_1000 TYPE p DECIMALS 2, "added by raviteja
* lv_basic TYPE p DECIMALS 2,
* lv_sumbb TYPE p DECIMALS 0,
* cnt_wage TYPE i. "added by raviteja
* DATA: gs_basicpay TYPE zhr_basic_amount.
*
* DATA :gv_lgart TYPE p0008-lga01,
* gv_betrg TYPE p0008-bet01.
*
* FIELD-SYMBOLS: <fs_betrg> TYPE p0008-bet01,
* <fs_lgart> TYPE p0008-lga01.
*
* DATA: lv_tpa1 TYPE p DECIMALS 2,
* gv_tpa_change TYPE p DECIMALS 0,
* flag TYPE c. " FOR 1004 WAGE TYPE LGART NO INITIAL.
*
*
* CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
* EXPORTING
* prelp = innnn
* IMPORTING
* pnnnn = p0008.
*
* IF p0008-ansal IS NOT INITIAL.
********** addded by chellam - 02.06.2015
* DATA: it_dynpread TYPE STANDARD TABLE OF dynpread,
* wa_dynpread TYPE dynpread,
* lv_repid TYPE sy-repid,
* lv_dynnr TYPE sy-dynnr.
*
***********************************************************************************************
* CLEAR : it_dynpread[].
* lv_repid = 'MP000800'.
* lv_dynnr = '0300'.
* CALL FUNCTION 'DYNP_VALUES_READ'
* EXPORTING
* dyname = lv_repid
* dynumb = lv_dynnr
* request = 'A'
* TABLES
* dynpfields = it_dynpread.
*
* LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-BETRG' AND stepl = 2
* AND fieldvalue IS INITIAL.
* show_data_again = 'X'.
* ENDLOOP.
*
* CLEAR: lv_tpa. "added by raviteja
*
* DO 10 TIMES VARYING gv_lgart FROM p0008-lga01 NEXT p0008-lga02
* VARYING gv_betrg FROM p0008-bet01 NEXT p0008-bet02.
* IF ( gv_lgart = '/TPA' ) AND ( p0008-ansal IS NOT INITIAL ).
*
* IF p0008-trfgr+0(1) = 'A'.
* lv_tpa = p0008-ansal * 25 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'B'.
* lv_tpa = p0008-ansal * 20 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'C'.
* lv_tpa = p0008-ansal * 15 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'D'.
* lv_tpa = p0008-ansal * 10 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'E'.
* lv_tpa = p0008-ansal * 5 / 100.
* EXIT.
* ELSEIF p0008-trfgr+0(1) = 'F' or p0008-trfgr+0(3) = 'CEO' or p0008-trfgr+0(3) = 'EVP'.
* lv_tpa = p0008-ansal. " No Variable pay
* ENDIF.
* ENDIF.
* ENDDO.
* ENDIF. " by raviteja
*
*
* IF lv_tpa IS NOT INITIAL. " by raviteja
*
* IF p0008-trfgr+0(1) = 'F' or p0008-trfgr+0(3) = 'CEO' or p0008-trfgr+0(3) = 'EVP'.
* lv_tpa = 0. " No variable pay " by raviteja
* ENDIF.
* lv_tpa1 = ( p0008-ansal - lv_tpa ) / 12.
*
***** CLEAR: gv_tpa_change.
***** LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-BETRG' AND stepl = 1.
***** " AND fieldvalue IS INITIAL.
*****
***** REPLACE ALL OCCURRENCES OF ',' IN wa_dynpread-fieldvalue WITH space.
***** CONDENSE wa_dynpread-fieldvalue NO-GAPS.
*****
***** MOVE wa_dynpread-fieldvalue TO gv_tpa_change.
*****
***** IF lv_tpa1 <> gv_tpa_change.
*****
***** show_data_again = 'X'.
*****
***** ENDIF.
*
**** show again action based on total value-Q0008-SUMBB
* LOOP AT it_dynpread INTO wa_dynpread WHERE fieldname = 'Q0008-SUMBB' AND stepl = 0
* AND fieldvalue IS NOT INITIAL.
*
* REPLACE ALL OCCURRENCES OF ',' IN wa_dynpread-fieldvalue WITH space.
* CONDENSE wa_dynpread-fieldvalue NO-GAPS.
* MOVE wa_dynpread-fieldvalue TO gv_tpa_change.
* lv_sumbb = p0008-ansal / 12.
* IF lv_sumbb <> gv_tpa_change.
* show_data_again = 'X'.
* ENDIF.
* ENDLOOP.
*
* lv_1008 = ( lv_tpa / 12 ). "added by raviteja
*
* lv_basic = ( lv_tpa1 * 30 ) / 100.
*
* IF lv_basic < 3100.
* lv_1004 = 620.
*
**** Fetching basic pay
* SELECT SINGLE * FROM zhr_basic_amount INTO gs_basicpay WHERE lgart = '1000' AND endda = '99991231'.
* IF sy-subrc = 0.
* lv_1000 = gs_basicpay-betrg.
* ENDIF.
*
* ELSEIF lv_basic >= 3100 AND lv_basic <= 3500.
* lv_1004 = ( lv_basic * 20 ) / 100.
* ELSEIF lv_basic > lv_1004 AND lv_basic < 10000.
* lv_1004 = 700.
* ELSEIF lv_basic >= 10000.
* lv_1004 = ' '.
*** p0008-lga06 = ' '.
* ENDIF.
*
* p0008-bet01 = lv_tpa1. "added by raviteja
*
***** fOR VARIABLE PAY
* CLEAR cnt_wage.
* DO 10 TIMES VARYING gv_lgart FROM p0008-lga01 NEXT p0008-lga02
* VARYING gv_betrg FROM p0008-bet01 NEXT p0008-bet02.
***** cnt_wage = cnt_wage + 1.
*
* ASSIGN gv_lgart TO <fs_lgart>.
* ASSIGN gv_betrg TO <fs_betrg>.
* IF gv_lgart = '1008'.
* IF lv_1008 IS NOT INITIAL.
* <fs_betrg> = lv_1008. "added by raviteja
* ELSE.
* <fs_lgart> = ' '.
* <fs_betrg> = lv_1008.
* ENDIF.
***** EXIT.
* ENDIF.
* IF gv_lgart = '1004'.
* IF lv_1004 IS NOT INITIAL.
* <fs_betrg> = lv_1004. "added by raviteja
* flag = 'X'.
***** EXIT.
* ELSE.
* <fs_lgart> = ' '.
* ENDIF.
* ENDIF.
*
* IF gv_lgart = '1000'.
* IF lv_1000 IS NOT INITIAL.
* <fs_betrg> = lv_1000. "added by raviteja
***** EXIT.
* ELSE.
* <fs_betrg> = ' '.
* ENDIF.
* ENDIF.
*
* IF lv_1004 IS NOT INITIAL.
* IF gv_lgart IS INITIAL AND flag = ' '.
* <fs_lgart> = '1004'.
* <fs_betrg> = lv_1004.
* EXIT.
* ENDIF.
* ENDIF.
*
* ENDDO.
****endif.
****** Variable Compensation distribution **************************************
* IF sy-ucomm = 'UPD'.
*
* SUBMIT zhrcss_variable_compensation WITH pnppernr = p0008-pernr
* WITH pnpbegda = p0008-begda
* WITH pnpendda = p0008-endda
* WITH p_ansal = p0008-ansal
* WITH p_trfgr = p0008-trfgr
* WITH p_trfst = p0008-trfst
* WITH p_vrsal = lv_tpa
* AND RETURN.
**********************************************************************************
* ENDIF.
* cl_hr_pnnnn_type_cast=>pnnnn_to_prelp(
* EXPORTING
* pnnnn = p0008
* IMPORTING
* prelp = innnn ).
*
* ENDIF.
**** ENDIF.
*ENDIF.
*
*
********************,,BEGIN OF PRAMODH CHANGES FOR INFOTYPE 80 AND 2001 ************************************************************
*******FOR VALIDATING THE MATERNITY LEAVE MORE THAN 2 CHILDRENS
*
*
*IF innnn-infty = '0080' .
** BREAK-POINT.
*
** if sy-ucomm = 'INS'.
*
* SELECT SINGLE * FROM pa0002 INTO gs_pa0002 WHERE pernr = innnn-pernr
* AND begda LE sy-datum
* AND endda GE sy-datum.
*
* IF ( sy-subrc = 0 ) AND ( gs_pa0002-anzkd GE 2 ).
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
*
** ENDIF.
*
* ENDIF.
*
** BREAK-POINT.
*
*ENDIF.
*
*
*IF innnn-infty = '2001' .
** BREAK-POINT.
*
** if sy-ucomm = 'INS'.
*
* RANGES r_awart FOR p2001-awart. "for ladies
* RANGES: m_awart FOR p2001-awart, "for GENTS
* n_awart FOR p2001-awart,
* w_awart FOR p2001-awart,
* wF_awart FOR p2001-awart .
* .
*
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4040'.
* APPEND r_awart.
*
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4060'.
* APPEND r_awart.
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4070'.
* APPEND r_awart.
* r_awart-sign = 'I'.
* r_awart-option = 'EQ'.
* r_awart-low = '4080'.
* APPEND r_awart.
*
*
* m_awart-sign = 'I'.
* m_awart-option = 'EQ'.
* m_awart-low = '4050'.
* APPEND m_awart.
*
* n_awart-sign = 'I'.
* n_awart-option = 'EQ'.
* n_awart-low = '4030'.
* APPEND n_awart.
*
**** range added by wilson
****FOR MALE***
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '4630'.
* APPEND w_awart.
*
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '4820'.
* APPEND w_awart.
*
* w_awart-sign = 'I'.
* w_awart-option = 'EQ'.
* w_awart-low = '2830'.
* APPEND w_awart.
*
****FOR FEMALE***
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4825'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4830'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '4835'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '2825'.
* APPEND wF_awart.
*
* wF_awart-sign = 'I'.
* wF_awart-option = 'EQ'.
* wF_awart-low = '2835'.
* APPEND wF_awart.
*
**************************** END OF CODE ADDED
*************begin of more than 2 childrens*************
* SELECT SINGLE * FROM pa0002 INTO gs_pa0002 WHERE pernr = innnn-pernr
* AND begda LE sy-datum
* AND endda GE sy-datum.
*
* IF ( sy-subrc = 0 ) AND ( innnn-subty IN r_awart ).
*
* IF gs_pa0002-gesch NE 2.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
*
*
* ELSEIF ( gs_pa0002-anzkd GE 2 ) .
*
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
* EXIT.
*
* ENDIF.
*
* ELSEIF ( sy-subrc = 0 ) AND ( innnn-subty IN m_awart ).
*
* IF gs_pa0002-gesch NE 1.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
*
* ELSEIF ( gs_pa0002-anzkd GE 2 ) .
*
*
* MESSAGE 'You are not allowdd to Apply this Leave type ' TYPE 'E'.
* EXIT.
*
* ENDIF.
*
*
* ELSEIF ( sy-subrc = 0 ) AND ( INNNN-SUBTY IN W_AWART ).
*
* IF gs_pa0002-gesch NE 1.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
* ENDIF .
*
* ELSEIF ( sy-subrc = 0 ) AND ( INNNN-SUBTY IN WF_AWART ).
*
* IF gs_pa0002-gesch NE 2.
*
* MESSAGE 'Leave type not Allowed wrong Gender' TYPE 'E'.
* EXIT.
* ENDIF .
*
*
* ELSEIF ( innnn-subty IN n_awart ).
* IF ( gs_pa0002-gbdat+4(4) NE innnn-begda+4(4) ) .
*
* IF ( ( gs_pa0002-famdt+4(4) NE innnn-begda+4(4) ) ) .
* MESSAGE: 'Please check your date of birth or marriage Date' TYPE 'E'.
* EXIT.
*
* ENDIF.
* ENDIF.
*
* ENDIF.
*
*ENDIF.
*
*
************************************END OF PRAMODH CHANGES*******************************************************
IF innnn-infty = '0008'.
DATA : ls_0008 TYPE p0008,
gv_ansal TYPE ansal_15,
gt_lgart TYPE STANDARD TABLE OF zlgart.
FIELD-SYMBOLS : <fs_0008> TYPE p0008.
ASSIGN ls_0008 TO <fs_0008>.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = <fs_0008>.
IF sy-subrc = 0 AND i001p-molga = '10'.
SELECT * FROM zlgart INTO TABLE gt_lgart.
READ TABLE gt_lgart TRANSPORTING NO FIELDS WITH KEY lgart = <fs_0008>-lga01.
IF sy-subrc = 0.
gv_ansal = ( ( <fs_0008>-bet01 * 8 ) * 10 ) * 26.
IF <fs_0008>-ansal NE gv_ansal.
<fs_0008>-ansal = gv_ansal.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = <fs_0008>
IMPORTING
prelp = innnn.
show_data_again = 'X'.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
No comments:
Post a Comment