Page 1 of 1

Read data from table PENS in a PCR?

Posted: Thu May 08, 2008 10:47 am
by Sleepyjoe
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.

Re: Read data from table PENS in a PCR?

Posted: Thu May 08, 2008 11:15 am
by T911168
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.

Re: Read data from table PENS in a PCR?

Posted: Thu May 08, 2008 2:11 pm
by muhnkee_2
do the minutes you are on sap fans looking for answers count as paid minutes or unpaid minutes?

Re: Read data from table PENS in a PCR?

Posted: Fri May 09, 2008 12:42 am
by bigchief
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

Re: Read data from table PENS in a PCR?

Posted: Fri May 09, 2008 9:14 am
by T911168
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! :)

Re: Read data from table PENS in a PCR?

Posted: Fri May 09, 2008 11:27 am
by muhnkee_2
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)!!!

Re: Read data from table PENS in a PCR?

Posted: Fri May 09, 2008 6:58 pm
by bigchief
BigChief smoke pipe. Receive enlightenment and wisdom from SAP HR gods. :D
:wink:

Image

Re: Read data from table PENS in a PCR?

Posted: Wed Jul 16, 2008 8:35 am
by Sleepyjoe
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

Re: Read data from table PENS in a PCR?

Posted: Thu Jul 17, 2008 7:26 am
by bigchief
Invoice is in the mail :wink:

I accept PayPal