Skip to Content
0

When fetching ppoix table

May 22, 2017 at 01:20 PM

122

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Volker Binder May 22, 2017 at 01:41 PM
-1

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

Show 4 Share
10 |10000 characters needed characters left characters exceeded

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

Regards,

Sagar

0

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

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

0

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.

1