2007 Sep 11 6:11 AM
Dear all,
In HR Loans infotype 0045 in PA30 it is showing <b>Loan Balance</b> as field 'Q0045-OPELO'.
but as Q0045 is a structure it does not contain any data.
can someone guide me where can i get Loan Balance as on particular date for any employee's particular loan type?
Helpful answers will be rewarded with points.
Thanks in advance.
-Tejas
2007 Sep 11 6:26 AM
Hi Tejas,
Using macros all payroll result can be retrived.
use Macro RP-IMP-C2-CU or RP-IMP-C2-CX in your program,
when this macro is used data will be stored in RGDIR runtime table
then you can get all payroll data using FM 'PYXX_READ_PAYROLL_RESULT'
Here is Sample code for same
RP-IMP-C2-CU.
CHECK RP-IMP-CD-SUBRC EQ 0.
LOOP AT RGDIR WHERE FPBEG GE PN-BEGDA AND FPEND LE PN-ENDDA
AND PAYTY EQ ' ' .
IF RGDIR-FPPER = RGDIR-INPER.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
CLUSTERID = 'RX'
EMPLOYEENUMBER = PERNR-PERNR
SEQUENCENUMBER = RGDIR-SEQNR
READ_ONLY_INTERNATIONAL = 'X'
CHANGING
PAYROLL_RESULT = LS_RESULT
EXCEPTIONS
ILLEGAL_ISOCODE_OR_CLUSTERID = 1
ERROR_GENERATING_IMPORT = 2
IMPORT_MISMATCH_ERROR = 3
SUBPOOL_DIR_FULL = 4
NO_READ_AUTHORITY = 5
NO_RECORD_FOUND = 6
VERSIONS_DO_NOT_MATCH = 7
ERROR_READING_ARCHIVE = 8
ERROR_READING_RELID = 9
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
If u have any doubts let me know
Regards
Naveen
2007 Sep 11 6:26 AM
Hi Tejas,
Using macros all payroll result can be retrived.
use Macro RP-IMP-C2-CU or RP-IMP-C2-CX in your program,
when this macro is used data will be stored in RGDIR runtime table
then you can get all payroll data using FM 'PYXX_READ_PAYROLL_RESULT'
Here is Sample code for same
RP-IMP-C2-CU.
CHECK RP-IMP-CD-SUBRC EQ 0.
LOOP AT RGDIR WHERE FPBEG GE PN-BEGDA AND FPEND LE PN-ENDDA
AND PAYTY EQ ' ' .
IF RGDIR-FPPER = RGDIR-INPER.
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
CLUSTERID = 'RX'
EMPLOYEENUMBER = PERNR-PERNR
SEQUENCENUMBER = RGDIR-SEQNR
READ_ONLY_INTERNATIONAL = 'X'
CHANGING
PAYROLL_RESULT = LS_RESULT
EXCEPTIONS
ILLEGAL_ISOCODE_OR_CLUSTERID = 1
ERROR_GENERATING_IMPORT = 2
IMPORT_MISMATCH_ERROR = 3
SUBPOOL_DIR_FULL = 4
NO_READ_AUTHORITY = 5
NO_RECORD_FOUND = 6
VERSIONS_DO_NOT_MATCH = 7
ERROR_READING_ARCHIVE = 8
ERROR_READING_RELID = 9
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
If u have any doubts let me know
Regards
Naveen
2007 Sep 11 6:32 AM
Thanks for your reply Naveen,
but its fine to get loan balance wage types and their corresponding amount from cluster but as it shows directly Loan Balance in PA30 as on last payroll run.
Is there some table or infotype which stores directly the amount that is balance for that loan type?
That is what i want to know!
-Tejas
2007 Sep 11 6:39 AM
I don;t think you have any tables to see loan balances .....
Naveen
2012 Feb 15 9:12 PM
Friends,
I think your problem is already solved, but, a suggestion is to use the FM HR_GET_LOAN_BAL_PAID_AMT, where the return value BAL_AMT is the Loan balance...
Regards...