Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR Loan : how to get Loan Balance ?

Former Member
0 Kudos
1,094

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
297

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

4 REPLIES 4

Former Member
0 Kudos
298

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

0 Kudos
297

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

0 Kudos
297

I don;t think you have any tables to see loan balances .....

Naveen

Former Member
297

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...