Está en la página 1de 5

2/13/12 Acceing Cle Table

1/5 flle.mi.ed/h/cle_able.hml
Accessing Cluster Tables in SAP
Paroll Custer Tables
http://www.planetsap.com/HRABAPpayroll.htm
Cluster tables combine the data Irom several tables with identical (or almost identical) keys into one physical record on the database.
Data is written to a database in compressed Iorm.
Retrieval oI data is very Iast iI the primary key is known.
Cluster tables are deIined in the data dictionary as transparent tables.
External programs can NOT interpret the data in a cluster table.
Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE FROM DATABASE are used to
process data in the cluster tables.
PCL1 - Database Ior HR work area; (long text, etc)
PCL2 - Accounting Results (time, travel expense and payroll); (paroll results)
PCL3 - Applicant tracking data;
PCL4 - Documents, Payroll year-end Tax data (change logs, etc)
Database Tables PCLn
PCLn database tables are divided into subareas known as data clusters.
Data Clusters are identiIied by a two-character code. e.g RU Ior US payroll result, B2 Ior
time evaluation result, TX Ior long text, LA Ior change logs.
Each HR subarea has its own cluster.
Each subarea has its own key.
Database Table PCL1
The database table PCL1 contains the Iollowing data areas:
B1 time events/PDC
G1 group incentive wages
L1 individual incentive wages
PC personal calendar
TE travel expenses/payroll results
TS travel expenses/master data
TX inIotype texts
ZI PDC interIace -~ cost account
SRTFD (PSKEY) pernr (8) inIo type (4) subtype (4) obj id (2) lock (1) endda (8) begda (8) seqnr (3)
Database Table PCL2
The database table PCL2 contains the Iollowing data areas:
B2 time accounting results
CD cluster directory oI the CD manager
PS generated schemas
PT texts Ior generated schemas
2/13/12 Acceing Cle Table
2/5 flle.mi.ed/h/cle_able.hml
RX a accig e/ieaia
R a accig e/c-ecific ( = HR c idica RU f US a e)
ZL ea chede
SRTFD (PC200) = e (8) eece (5)
Database Table PCL3
The daabae abe PCL3 cai he fig daa aea:
AP aci g / ie chede
TY e f aica daa ife
Database Table PCL4
The daabae abe PCL4 cai he fig daa aea:
LA chage g (g e dce)
SA Sh-Te Dce f HR Mae Daa
SB Sh-Te Dce f Aica Mae
SRTFD (PC400) = a ca aa A f ae daa (1) e (8) if e (4) dified dae (8) dified ie (8) e (4)
Data Management of PCLn
The ABAP cad IMPORT ad EXPORT ae ed f aagee f ead/ie daabae abe PCL.
A ie e ha be ed he eadig daa f iig daa he PCL.
MANDT(3) cie
RELID (2) ce ID (RU,TX, LA..)
SRTFD (40) Work Area Ke
SRTF2 (4) S e f d. e
Cluster Definition
Naig cei f INCLUDES he defiig ce. Thee INCLUDES i defie he ork area ke abe ad he ce daa ha i
eed f a IMPORT:
RPCn0
n = 1, 2, 3 4 (f PCL1, PCL2, PCL3, PCL4)
= ce ID
= c gig (0 f ieaia heie c idica T500L)
Decii f Ce Daa ig Ce RX a a Eae
The daa decii i ed i he icde RPC2RX00 i accdace ih he abe aig cei.
2/13/12 Acceing Cle Table
3/5 flle.mi.ed/h/cle_able.hml
RPC1TX00 - Long e cle ID in able PCL1
RPC2RUU0 - Paoll el fo he US cle ID in able PCL2
RPC4LA00 - Change log cle ID in able PCL4
Importing Data (I)
The IMPORT command cae daa objec ih he pecified ke ale o be ead fom PCLn.
If he impo i ccefl, SY-SUBRC i 0; if no, i i 4.
REPORT ZRPIMPORT.
TABLES: PCLn.
INCLUDE RPCn0. "Cle definiion
* Fill cle Ke
* Impo ecod
IMPORT TABLE1 FROM DATABASE PCLn() ID -KEY.
IF SY-SUBRC EQ 0.
* Dipla daa objec
ENDIF.
See ample pogam fo long e.
Importing data (II)
Impo daa ing maco RP-IMP-Cn-.
Check en code SY-SUBRC. If 0, i i ccefl. If 4, eo.
Need inclde bffe managemen oine RPPPXM00
REPORT ZRPIMPORT.
*Bffe definiion
INCLUDE RPPPXD00.
DATA: BEGIN OF COMMON PART 'BUFFER'.
INCLUDE RPPPXD10.
DATA: END OF COMMON PART 'BUFFER'.
*impo daa o bffe
RP-IMP-Cn-.
....
*Bffe managemen oine
INCLUDE RPPPXM00.
Cluster Authoriation
Simple EXPORT/IMPORT aemen doe no check fo cle ahoiaion.
Ue EXPORT/IMPORT ia bffe, he bffe managemen oine check fo cle ahoiaion.
rpcbdt00 - include needed for importing from database PCL4(la) (Change log cluster ID)
When e pgaded o ERP2005, e enconeed a poblem becae a cople of o pogam eed he eion (VERNR) nmbe o
deemine hich ce he deail ed. The SAP inclde pogam, RPCBDT00, indicae ha VERNR 01 & 02 e he ame ce hich
i PC404. Theefoe, e made o pogam mach SAP.
Paroll Results (I)
US Paoll el ae oed in cle RU of PCL2 a field ing and inenal able.
Sandad epo ead he el fom cle RU.
Repo RPCLSTRU li all US paoll el;
2/13/12 Acceing Cle Table
4/5 flle.mi.ed/h/cle_able.hml
Report RPCEDTU0 lists the US results on a paroll form.
Paroll Results (II)
The cluster definition of paroll results is stored in two INLCUDE reports:
include: RPC2RX09. "Definition Cluster Ru (I)
include: RPC2RUU0. "Definition Cluster Ru (II)
The first INCLUDE defines the countr-independent part; The second INCLUDE defines the countr-specific part (US).
The cluster ke is stored in the field string RX-KEY.
RX-KEY = (PC200) = pernr (8) sequence (5)
Paroll Results (III)
All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionar. This allows ou to use the same structures in
different definitions and nonetheless maintain data consistenc.
The structures for cluster definition compl with the name convention PCnnn. Unfortunatel, 'nnn' can be an set of alphanumeric
characters.
To read paroll results, ou need two kes: pernr and seqno
You can get SEQNO b importing the cluster director (CD) for a pernr first. (see cluster director)
*Ke definition
DATA: BEGIN OF RX-KEY.
INCLUDE STRUCTURE PC200.
DATA: END OF RX-KEY.
*Paroll director
DATA: BEGIN OF RGDIR OCCURS 100.
INCLUDE STRUCTURE PC261.
DATA: END OF RGDIR. Paroll Cluster Director
REPORT ZHRIMPRT.
TABLES: PERNR, PCL1, PCL2.
INLCUDE: RPC2CD09. "definition cluster CD
PARAMETERS: PERSON LIKE PERNR-PERNR.
...
RP-INIT-BUFFER. " maco o ge one peon a a ime baed on ingle paamee fo pen
*Import cluster Director
CD-KEY-PERNR = PERNR-PERNR.
RP-IMP-C2-CU. " defined in inclde file
CHECK SY-SUBRC = 0.
LOOP AT RGDIR.
RX-KEY-PERNR = PERSON.
UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO. " converts rgdir-seqnr (numc 5) to packed and moves to char 5
*Import data from PCL2
RP-IMP-C2-RU.
2/13/12 Acceing Cle Table
5/5 flle.mi.ed/h/cle_able.hml
INLCUDE: RPPPXM00. "PCL1/PCL2 BUFFER HANDLING
Function Module (I)
CD_EVALUATION_PERIODS
AIter importing the payroll directory, which record to read is up to the programmer.
Each payroll result has a status.
'P' - previous result
'A' - current (actual) result
'O' - old result
Function module CDEVALUATIONPERIODS will restore the payroll result status Ior a period when that payroll is initially run. It also
will select all the relevant periods to be evaluated.
Function Module (II)
CD_EVALUATION_PERIODS
call Iunction 'CDEVALUATIONPERIODS'
exporting
bonusdate reIperiods-bondt " Ke Date for Check (optional)
inpermodiI pn-permo " Period parameters
inper reIperiods-inper " Paroll Period
paytype reIperiods-payty " Paroll categor (optional)
payident reIperiods-payid " Paroll identifier (optional)
tables
rgdir rgdir " Cluster Director
evpdir evp " Periods to be Evaluated
iabkrs pnpabkrs " Paroll Areas (optional)
exceptions
norecordIound 1.
Authoriation Check
Authoriation for Persons
In the authorization check Ior persons, the system determines whether the user has the authorizations required Ior the organizational
Ieatures oI the employees selected with GET PERNR.
Employees Ior which the user has no authorization are skipped and appear in a list at the end oI the report.
Authorization object: 'HR: Master data'
Authoriation for Data
In the authorization check Ior data, the system determines whether the user is authorized to read the inIotypes speciIied in the report.
II the authorization Ior a particular inIotype is missing, the evaluation is terminated and an error message is displayed.
Deactivating the Authoriation Check
In certain reports, it may be useIul to deactivate the authorization check in order to improve perIormance. (e.g. when running payroll)
You can store this inIormation in the object 'HR: Reporting'.

También podría gustarte