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: 

When fetching ppoix table

0 Kudos

Please need expert suggestions : Best way to write a program to fetch all wage types(lgart) and all amounts(betrg) PCP0 based on pernr and summarize the amount based on PERNR.

Our Program is fetching data from

PPDIT , PPOIX

SELECT
SINGLE
runid FROM ppdhd INTO gv_runid
WHERE docnum = p_doc
AND budat = p_dodate.

IF gv_runid IS NOT INITIAL.

SELECT pa0105~usrid
ppoix~lgart
* t512t~lgtxt
SUM( betrg ) AS betrg
INTO TABLE gt_ppoix
FROM ppoix
INNER JOIN pa0105 ON ( ppoix~pernr = pa0105~pernr )
WHERE runid = gv_runid
AND PPOIX~TSLIN ne 0
AND pa0105~usrty = 'PAYB'
AND pa0105~endda = '99991231'
AND actsign = 'A'
GROUP BY pa0105~usrid ppoix~lgart.

IF gt_ppoix IS NOT INITIAL.

SELECT pa0105~usrid
COUNT( DISTINCT ppoix~pernr ) AS pcount
INTO TABLE gt_bilno FROM ppoix
INNER JOIN pa0105 ON ( ppoix~pernr = pa0105~pernr )
WHERE runid = gv_runid
AND pa0105~usrty = 'PAYB'
AND pa0105~endda = '99991231'
AND actsign = 'A'
GROUP BY pa0105~usrid.

IF gt_bilno IS NOT INITIAL.

"Wage Type Texts
SELECT sprsl
lgart
lgtxt FROM t512t INTO TABLE gt_t512t
FOR ALL ENTRIES IN gt_ppoix
WHERE sprsl = 'EN'
AND molga = '40'
AND lgart = gt_ppoix-lgart.

ENDIF.
ENDIF.
ENDIF.
ENDIF.

1 ACCEPTED SOLUTION

former_member226519
Active Contributor
0 Kudos

I know it is tricky ...

Why do you use infotype 0105? I would collect all pernr's using log. database PNPCE.

If you have access to Accenture's Clone&Test tool (report /BKC/SOL21_KLON) look how they select PPOIX per PERNR.

the tables involved are:

PEVAT, PEVST, PEVSH, PPDHD, PPDIT, PPDIX, PPOIX, PPOPX, PCALAC, PPDSH, PPDST and PPDMSG

5 REPLIES 5

former_member226519
Active Contributor
0 Kudos

I know it is tricky ...

Why do you use infotype 0105? I would collect all pernr's using log. database PNPCE.

If you have access to Accenture's Clone&Test tool (report /BKC/SOL21_KLON) look how they select PPOIX per PERNR.

the tables involved are:

PEVAT, PEVST, PEVSH, PPDHD, PPDIT, PPDIX, PPOIX, PPOPX, PCALAC, PPDSH, PPDST and PPDMSG

0 Kudos

Thanks for your quick reply mate, will check the results and get back to you.

Regards,

Sagar

0 Kudos

My actual requirement is get all data from HR payroll postings (pernr, gl's,credit,debit amount)

Which table could fetch the best results to display exact results.

0 Kudos

Hi Volker, hope you are doing good,

Actually infotype 0105 is for salary bill number, I am linking with pernr of pa0105 and pernr of ppoix and based on bill I am collecting all the employee for that specific bill and adding their sum based of their wages, here I am getting all the wages and amount but in some bills are fine and in some bills the amount(betrg) is having issue because of retro calculation. I could find the values in pcp0 in credit and debit amount field(ppdit-wrbtr) but the same values are not getting displayed in ppoix so that is where I am lagging to retrieve those values, can you please suggest me whether to pass the pernr to CD_READ_RGDIR and call funcntion module PYXX_READ_PAYROLL_RESULT to get the accurate amount, appreciate your valuable comments.

Regards,

Sagar

maybe you can find some hints in report RPCIP_DOCUMENT_ANALYSE.

Reading payroll results is not that easy. You will have to loop at RGDIR (structure PC261) and consider at least fields INPER, FPPER and SRTZA.

You can run RPCLSTRX to get an impression how RGDIR looks like.