Skip to Content
avatar image
Former Member

When fetching ppoix table

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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

    Add comment
    10|10000 characters needed characters exceeded

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