Read data from table PENS in a PCR?

Human Resources (PM, OM, PA, TM ,PD)

Moderators: Snowy, thx4allthefish, muhnkee_2

Post Reply
Sleepyjoe
Posts: 61
Joined: Tue Jul 25, 2006 10:43 am
Location: UK

Read data from table PENS in a PCR?

Post by Sleepyjoe » Thu May 08, 2008 10:47 am

Hi,

Is it possible to read values from table PENS in a PCR? I want to copy the PCTEE value into either the amount or rate field of a wage type but every combination I've tried using TABLE and PENS or GPEN either gives me an Old log error telling me I've got the syntax wrong or doesn't copy any values. I've seen a post where RPCBURZ0 is mentioned as a way of reading table fields but as I'm not an ABAPer and they charge me by the minute, I'd need to be able to convince them to investigate this if it's a viable option.

Any help much appreciated.

T911168
Posts: 617
Joined: Tue Aug 03, 2004 4:54 am

Re: Read data from table PENS in a PCR?

Post by T911168 » Thu May 08, 2008 11:15 am

paid by the minute! thatws brilliant! Im sure therefore that SAPFans is directly involved in your invoicing?

I know of no way to read PENS thru a standard PCR operation - Ive always written a custom function (ABAP) to do it.

S.

muhnkee_2
Posts: 3548
Joined: Thu Nov 06, 2003 5:51 am
Location: where the sun is shining, drinks are cold and the food is good

Re: Read data from table PENS in a PCR?

Post by muhnkee_2 » Thu May 08, 2008 2:11 pm

do the minutes you are on sap fans looking for answers count as paid minutes or unpaid minutes?
Author of Discover SAP ERP HCM
A high level introduction to the capabilities and functionality of SAP HR
Available now from SAP Press
http://sap-press.com/product.cfm?account=&product=H2989

bigchief
Posts: 1336
Joined: Fri Sep 19, 2003 6:41 pm
Location: Sydney, Australia

Re: Read data from table PENS in a PCR?

Post by bigchief » Fri May 09, 2008 12:42 am

Fear not - Chief is here. You CAN indeed read table PENS in a PCR

Many moons ago, when I was an ankle-biter, working in the good ol' UK, I wrote the following rule for a customer:

(extract of the rule)
YPM1*****1 > > TABLEPENS ELIMI * AMT= /111AMT*-1 ADDWT /111NEXTR
YPM1*****1 > > 1 AMT=O /111ADDWT /111ADDWT&TEMPNEXTR
YPM1*****1 > > 2 FILLF A ELIMI * ZERO= A NEXTR
YPM1*****1 > > 3 AMT=& TEMPAMT%BPCTERRESET * ADDWT *

You will notice in the last line I take a percentage of whatever is in field 'PCTER'
Works like a charm.

Another one I wrote:
YYYY*99AA DTABLEPENS VALEN 3 VARGBSUBTY
YYYY*99AA*** ADDWT *
YYYY*99AA9V4 DAMT=BPCTEEAMT?0 FILLF A
YYYY*99AA9V4 * AMT%BPCTEEADDWT 99BBFILLF A AMT%BPCTERAMT%50 NEXTR
YYYY*99AA9V4 * 1 ADDWT 99CCFILLF A
YYYY*99AA9V4 = AMT%BPCTERAMT%50 ADDWT 99CC

The operation TABLE is very fiddly...sometimes you need a space between the operation and the table and sometimes not.

Chief
Happiness is like peeing in your pants. Everyone else can see it but only you can feel the warmth!

T911168
Posts: 617
Joined: Tue Aug 03, 2004 4:54 am

Re: Read data from table PENS in a PCR?

Post by T911168 » Fri May 09, 2008 9:14 am

Well! You learn something new everyday.

Ive always done what the poster did - kept to the syntax in the help (!!) and had PENS fail.
However it does work when you dont put a space in - and I think it would work for any payroll result table.

I created a simple rule to check this out which had in it:

TABLEPENS NUM=BPCTEEADDWTI9900

I debugged it to see how this works and found that , as Ive always known, the table command of itself does nothing in regards to PENS - the code in the table command is just a case statement - PENS isnt in it and it jumps pretty much straight out.

The funkiness happens in the NUM=B part of the deal. At this point it remembers the table used in the preceeding table command - and then goes to the payroll result.

My hat off to you BC! :)

muhnkee_2
Posts: 3548
Joined: Thu Nov 06, 2003 5:51 am
Location: where the sun is shining, drinks are cold and the food is good

Re: Read data from table PENS in a PCR?

Post by muhnkee_2 » Fri May 09, 2008 11:27 am

lesson learned

whats impossible for mere mortals, is less than a minutes work for BC

(original poster, i think you now owe big chief at least a minute at your per the minute rate)!!!
Author of Discover SAP ERP HCM
A high level introduction to the capabilities and functionality of SAP HR
Available now from SAP Press
http://sap-press.com/product.cfm?account=&product=H2989

bigchief
Posts: 1336
Joined: Fri Sep 19, 2003 6:41 pm
Location: Sydney, Australia

Re: Read data from table PENS in a PCR?

Post by bigchief » Fri May 09, 2008 6:58 pm

BigChief smoke pipe. Receive enlightenment and wisdom from SAP HR gods. :D
:wink:

Image
Happiness is like peeing in your pants. Everyone else can see it but only you can feel the warmth!

Sleepyjoe
Posts: 61
Joined: Tue Jul 25, 2006 10:43 am
Location: UK

Re: Read data from table PENS in a PCR?

Post by Sleepyjoe » Wed Jul 16, 2008 8:35 am

Hi Guys,

A very belated 'Thank you' for your help, especially Big Chief; the second example you quoted gave me valuable clues as to how to extract the specific data I was after; we have 21 pension schemes availabe but I only needed the data for 2 of them in a PCR. I had to put my work on this area on hold to do other things but have finally had a chance to come back to it and get it working which is why the late thanks.

All your help and comments much appreciated.

Sleepyjoe

bigchief
Posts: 1336
Joined: Fri Sep 19, 2003 6:41 pm
Location: Sydney, Australia

Re: Read data from table PENS in a PCR?

Post by bigchief » Thu Jul 17, 2008 7:26 am

Invoice is in the mail :wink:

I accept PayPal
Happiness is like peeing in your pants. Everyone else can see it but only you can feel the warmth!

Post Reply