Posted: Thu Feb 19, 2009 3:14 pm Post subject: Get payroll result
Code:
FUNCTION ZHRCM_PAYROLL_RESULTS_GET.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(PERNR) TYPE PERNR_D
*" REFERENCE(PAYDT) TYPE DATUM OPTIONAL
*" REFERENCE(BEGDA) TYPE BEGDA OPTIONAL
*" REFERENCE(ENDDA) TYPE ENDDA OPTIONAL
*" REFERENCE(PAYRO) TYPE CHAR1 OPTIONAL
*" REFERENCE(INCEN) TYPE CHAR1 OPTIONAL
*" REFERENCE(RETRO) TYPE CHAR1 OPTIONAL
*" REFERENCE(SRTZA) TYPE SRTZA
*" REFERENCE(OCRSN) TYPE PAY_OCRSN OPTIONAL
*" REFERENCE(PAYID) TYPE PAYID OPTIONAL
*" EXPORTING
*" REFERENCE(SUBRC) TYPE SYSUBRC
*" REFERENCE(MOLGA) TYPE MOLGA
*" REFERENCE(PAYROLL_RESULT_TAB) TYPE HRPAY99_TAB_OF_RESULTS
*"----------------------------------------------------------------------
DATA: RGDIR_TAB TYPE STANDARD TABLE OF PC261
WITH NON-UNIQUE DEFAULT KEY,
RGDIR_FILTERED_TAB TYPE STANDARD TABLE OF PC261
WITH NON-UNIQUE DEFAULT KEY,
RGDIR_WA TYPE PC261,
T500L_WA TYPE T500L,
PAYROLL_RESULT_WA TYPE PAY99_RESULT.
IF SY-SUBRC = 0.
PAYROLL_RESULT_WA-EVP = RGDIR_WA.
APPEND PAYROLL_RESULT_WA TO PAYROLL_RESULT_TAB.
ELSE.
* error handling
ENDIF.
ENDLOOP.
ELSEIF INCEN = 'X'. "상여일경우
* 퇴직충당금을 구하기 위해서 지급일과 같을경우만 가져온다.
IF OCRSN <> ''. "급여사유가 있는 경우.
* 급여 ID 추가 - 비정기상여가 같은 날에 지급될 수 있음. - 2005.09.06 PJI
LOOP AT RGDIR_TAB INTO RGDIR_WA
WHERE SRTZA = SRTZA
AND PAYDT = LW_PAYDT
AND OCRSN = OCRSN
AND PAYID = PAYID.
IF SY-SUBRC = 0.
PAYROLL_RESULT_WA-EVP = RGDIR_WA.
APPEND PAYROLL_RESULT_WA TO PAYROLL_RESULT_TAB.
ELSE.
* error handling
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
* 소급계산일 경우에는 정기급여와 비정기급여를 일괄처리한다.
ELSEIF RETRO = 'X'. "소급결과
LOOP AT RGDIR_TAB INTO RGDIR_WA
WHERE SRTZA = SRTZA.
* 정기급여일 경우는 급여일자로 읽고, 비정기급여일 경우는 급여기간으로
* 가져온다.
IF ( RGDIR_WA-OCRSN = '' AND RGDIR_WA-PAYDT = LW_PAYDT )
OR ( RGDIR_WA-OCRSN <> ''
AND RGDIR_WA-PAYDT >= BEGDA AND RGDIR_WA-PAYDT <= ENDDA ).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.