Sunteți pe pagina 1din 14

HR ABAP Programming

Logical database
A logical database is a special ABAP/4 program which combines the contents of certain database
tables. Using logical databases facilitates the process of reading database tables.
HR Logical Database is PNP
ain !"nctions of the logical database PNP#
$tandard $election screen
Data Retrie%al
A"thori&ation chec'
(o "se logical database PNP in )o"r program* specif) in )o"r program attrib"tes.
$tandard $election $creen
Date selection
Date selection delimits the time period for which data is e%al"ated. +,( P,RNR retrie%es all
records of the rele%ant infot)pes from the database. -hen )o" enter a date selection
period* the PR./0D, loop retrie%es the infot)pe records whose %alidit) period o%erlaps with
at least one da) of this period.
Person selection
Person selection is the 1tr"e1 selection of choosing a gro"p of emplo)ees for whom the report
is to r"n.
$orting Data
2 (he standard sort se3"ence lists personnel n"mbers in ascending order.
2 $.R( f"nction allows )o" to sort the report data otherwise. All the sorting fields are from
infot)pe 4445.
Report 6lass
2 7o" can s"ppress inp"t fields which are not "sed on the selection screen b) assigning a
report class to )o"r program.
2 0f $AP standard deli%ered report classes do not satisf) )o"r re3"irements* )o" can create
)o"r own report class thro"gh the 0+.
Data Retrieval from LDB
5. 6reate data str"ct"res for infot)pes.
0N!.(7P,$# 4445* 8.R+ A$$0+N,N(
4449* 8P,R$.NAL DA(A
444:. 8BA$06 PA7
9. !ill data str"ct"res with the infot)pe records.
$tart;of;selection.
+,( P,RNR.
,nd;4f;selection.
Read aster Data
0nfot)pe str"ct"res <after +,( P,RNR= are internal tables loaded with data.
(he infot)pe records <selected within the period= are processed se3"entiall) b) the PR./0D,
; ,NDPR./0D, loop.
+,( P,RNR.
PROVIDE * FROM Pnnnn B,(-,,N PN/B,+DA AND PN/,NDDA
0f Pnnnn;>>>> ? 1 1. write#/ Pnnnn;>>>>. endif.
,NDPR./0D,.
Period;Related Data
All infot)pe records are time stamped.
0(444@ <Address infot)pe=
45/45/5AA4 59/B5/AAAA present
-hich record to be read depends on the date selection period specified on the
selection screen. PN/B,+DA PN/,NDDA.
6"rrent Data
0(444@ Address ; 45/45/5AA4 59/B5/AAAA present
RP-PROVIDE-FROM-LA! retrie%es the record which is %alid in the data selection period.
!or eCample* pn/begda ? 15AAA4AB51 pn/endda ? 1AAAA59B51
0(444@ s"bt)pe 5 is resident address
RP;PR./0D,;!R.;LA$( P444@ 5 PN/B,+DA PN/,NDDA.
Process Infot"#es
RMA$ Mod%les ; RA6 mod"le as referred to acro* is a special constr"ct of ABAP/4
codes. Normall)* the program code of these mod"les is stored in table 1(RA61. (he table
'e) combines the program code "nder a gi%en name. 0t can also be defined in programs.(he
RA6 defined in the (RA6 can be "sed in all Reports. -hen an RA6 is changed* the
report has to be regenerated man"all) to reflect the change.
Reading 0nfot)pes ; b) "sing RA6 <macro= RP;R,AD;0N!.(7P,
R,P.R( DHR44445.
0N!.(7P,# 4449.
PARA,(,R$# P,RNR L0E, P4449;P,RNR.
RP;R,AD;0N!.(7P, P,RNR 4449 P4449 FB,+0NG F,NDG.
PR./0D, H !R. P4449
if ... then ...endif.
,NDPR./0D,.
6hanging 0nfot)pes ; b) "sing RA6 <macro= RP;R,AD;0N!.(7P,.
2 (hree steps are in%ol%ed in changing infot)pes#
5. $elect the infot)pe records to be changedI
9. a'e the re3"ired changes and store the records in an alternati%e tableI
B. $a%e this table to the databaseI
(he RP-&PDA!E macro "pdates the database. (he parameters of this macro are the .LD internal
table containing the "nchanged records and the N,- internal table containing the changed records.
7o" cannot create or delete data. .nl) modification is possible.
0N!.(7P,$# Pnnnn NA, .LD*
Pnnnn NA, N,-.
+,( P,RNR.
PR./0D, H !R. .LD
-H,R, .... ? ... 86hange old record
H$a%e old record in alternate table
N,- ? .LD.
,NDPR./0D,.
RP;UPDA(, .LD N,-. 8Update changed record
Infot"#e 'it( re#eat str%ct%res
2 How to identif) repeat str"ct"res.
a. .n infot)pe entr) screen* data is entered in table form.
0(444J* 0(444:* 0(4445* etc.
b. 0n the infot)pe str"ct"re* fields are gro"ped b) the same name followed b) se3"ence n"mber.
P444J;UARnn P444J;UANnn P444J;UB,nn
P444J;U,Nnn P444J;UABnn
Repeat $tr"ct"res
2 Data is entered on the infot)pe screen in table format b"t stored on the database in a linear
str"ct"re.
2 ,ach row of the table is stored in the same record on the database.
2 -hen e%al"ating a repeat str"ct"re* )o" m"st define the starting point* the increment and the
wor' area which contains the complete field gro"p definition.
Repeat $tr"ct"res ,%al"ation <0=
2 (o e%al"ate the repeat str"ct"res
a. Define wor' area.
(he wor' area is a field string. 0ts str"ct"re is identical to that of the field gro"p.
b. Use a D. L..P to di%ide the repeat str"ct"re into segments and ma'e it a%ailable for
processing in the wor' area* one field gro"p <bloc'= at a time.
Repeat $tr"ct"res ,%al"ation<00=
H Define wor' area
DA(A# B,+0N .! /A6A(0.N*
UAR L0E, P444J;UAR45* 8Lea%e t)pe
UAN L0E, P444J;UAN45* 8Lea%e entitlement
UB, L0E, P444J;UB,45* 8$tart date
U,N L0E, P444J;U,N45* 8,nd date
UAB L0E, P444J;UAB45* 8Lea%e acco"nted
,ND .! /A6A(0.N.
+,( P,RNR.
RP;PR./0D,;!R.;LA$( P444J $PA6, PN/B,+DA PN/,NDDA.
D. @ (0,$ /AR70N+ /A6A(0.N
!R. P444J;UAR45 8$tarting point
N,>( P444J;UAR49. 80ncrement
0f p444J;C)& then ... endif.
,NDD..
Processing )!ime Data) .
2 Dependence of time data on %alidit) period
2 0mporting time data
2 Processing time data "sing internal tables
(ime Data and /alidit) Period
2 (ime data alwa)s applies to a specific %alidit) period.
2 (he %alidit) periods of different t)pes of time data are not alwa)s the same as the date selection
period specified in the selection screen.
Date selection period K;;;;;;;;;;;;;;;K
Lea%e K;;;;;;;;;;;;;K
2 PR./0D, in this case is therefore not "sed for time infot)pes.
0mporting (ime Data
2 +,( P,RNR reads all time infot)pes from the lowest to highest s)stem data* not onl) those within
the date selection period.
2 (o pre%ent memor) o%erload* add .D, N to the infot)pe declaration. (his pre%ents the logical
database from importing all data into infot)pe tables at +,( P,RNR.
2 Use macro RP;R,AD;ALL;(0,;0(7 to fill infot)pe table.
0N!.(7P,$# 9445 .D, N.
+,( P,RNR.
RP;R,AD;ALL;(0,;0(7 PN/B,+DA PN/,NDDA.
L..P A( P4495.
0f P4495;>7D ? 1 1. A?B. ,ndif.
,NDL..P.
Processing (ime Data
2 .nce data is imported into infot)pe tables* )o" can "se an internal table to process the interested
data.
DA(A# B,+0N .! 0(AB .66UR$ 4*
BUER$ L0E, P4445;BUER$* 86.PAN7
-,RE$ L0E, P4445;-,RE$* 8P,R$.NN,L AR,A
A-AR( L0E, P9445;A-AR(* 8AB$./A((,ND. (7P,
A$-(+ L0E, P9445;A$-(+* 8AB$./A((,ND. DA7$
,ND .! 0(AB.
+,( P,RNR.
RP;PR./0D,;!R.;LA$( P4445 $AP6, PN/B,+DA PN/,NDDA.
6L,AR 0(AB.
0(AB;BUER$ ? P4445;BURE$. 0(AB;-,RE$ ? P4445;-,RE$.
RP;R,AD;ALL;(0,;0(7 PN/B,+DA PN/,NDDA.
L..P A( P9445.
0(AB;A-AR( ? P9445;A-AR(. 0(AB;A$-(+ ? P9445;A$-(+.
6.LL,6( 0(AB. <.R# APP,ND 0(AB.=
,NDL..P.
Database !ables in *R
2 Personnel Administration <PA= ; master and time data infot)pe tables <transparent tables=.
PAnnnn# e.g. PA4445 for infot)pe 4445
2 Personnel De%elopment <PD= ; .rg Unit* Lob* Position* etc. <transparent tables=.
HRPnnnn# e.g. HRP5444 for infot)pe 5444
2 (ime/(ra%el eCpense/Pa)roll/Applicant (rac'ing data/HR wor' areas/Doc"ments <cl"ster
P6Ln# e.g. P6L9 for time/pa)roll res"lts.
$l%ster !able
2 6l"ster tables combine the data from se%eral tables with identical <or almost identical= 'e)s
into one ph)sical record on the database.
. Data is written to a database in compressed form.
2 Retrie%al of data is %er) fast if the primar) 'e) is 'nown.
2 6l"ster tables are defined in the data dictionar) as transparent tables.
2 ,Cternal programs can N.( interpret the data in a cl"ster table.
2 $pecial lang"age elements ,>P.R( (. DA(ABA$,* 0P.R( (. DA(ABA$, and D,L,(,
!R. DA(ABA$, are "sed to process data in the cl"ster tables.
P6L5 ; Database for HR wor' areaI
P6L9 ; Acco"nting Res"lts <time* tra%el eCpense and pa)roll=I
P6LB ; Applicant trac'ing dataI
P6L4 ; Doc"ments* Pa)roll )ear;end (aC data
Database !ables P$Ln
2 P6Ln database tables are di%ided into s"bareas 'nown as data cl"sters.
2 Data 6l"sters are identified b) a two;character code. e.g RU for U$ pa)roll res"lt* B9 for
time e%al"ation res"lt...
2 ,ach HR s"barea has its own cl"ster.
2 ,ach s"barea has its own 'e).
Database !able P$L+
2 (he database table P6L5 contains the following data areas#
B5 time e%ents/PD6
+5 gro"p incenti%e wages
L5 indi%id"al incenti%e wages
P6 personal calendar
(, tra%el eCpenses/pa)roll res"lts
($ tra%el eCpenses/master data
(> infot)pe teCts
D0 PD6 interface ;G cost acco"nt
Database !able P$L,
2 (he database table P6L9 contains the following data areas#
B9 time acco"nting res"lts
6D cl"ster director) of the 6D manager
P$ generated schemas
P( teCts for generated schemas
R> pa)roll acco"nting res"lts/international
Rn pa)roll acco"nting res"lts/co"ntr);specific < n ? HR co"ntr) indicator =
DL personal wor' sched"le
Database !able P$L-
2 (he database table P6LB contains the following data areas#
AP action log / time sched"le
(7 teCts for applicant data infot)pes
Data Management of P$Ln
2 (he ABAP commands 0P.R( and ,>P.R( are "sed for management of read/write to
database tables P6Ln.
2 A "ni3"e 'e) has to be "sed when reading data from or writing data to the P6Ln.
!ield Name E,7 Length (eCt
AND( > B 6lient
R,L0D > 9 Relation 0D <RU*B9..=
$R(!D > 44 -or' Area Ee)
$R(!9 > 4 $ort 'e) for d"p. 'e)
$l%ster Definition
2 (he data definition of a wor' area for P6Ln is specified in separate programs which compl)
with fiCed naming con%entions.
2 (he) are defined as 0N6LUD, programs <RP6nCC)4=. (he following naming con%ention applies#
n ? 5 or 9 <P6L5 or P6L9=
CC ? Relation 0D <e.g. R>=
) ? 4 for international cl"sters or co"ntr) indicator <(J44L= for different co"ntr) cl"ster
E.#orting Data /I0
2 (he ,>P.R( command ca"ses one or more 1C)1 E,7 data obMects to be written to cl"ster C).
2 (he cl"ster definition is integrated with the 0N6LUD, statement.
R,P.R( DHR,>PR(.
(ABL,$# P6Ln.
0N6LUD,# RP6nCC)4. 86l"ster definition
H !ill cl"ster E,7
C);'e);field ? F%al"eG.
H !ill data obMect
....
H ,Cport record
,>P.R( (ABL,5 (. DA(ABA$, P6Ln<C)= 0D C);E,7.
0! $7;$UBR6 ,N 4.
-R0(,# / 1Update s"ccessf"l1.
,ND0!.
,Cporting Data <00=
. ,Cport data "sing macro RP;,>P;6n;C).
2 -hen data records are eCported "sing macro* the) are not written to the database b"t to a
main memor) b"ffer.
2 (o sa%e data* "se the PR,PAR,OUPDA(, ro"tine with the U$0N+ parameter 1/1.
R,P.R( DHR,>PR(.
HB"ffer definition
0N6LUD, RPPP>D44. 0N6LUD, RPPP>44. 8B"ffer management
DA(A# B,+0N .! 6..N PAR( 1BU!!,R1.
0N6LUD, RPPP>D54.
DA(A# ,ND .! 6..N PAR( 1BU!!,R1.
...
RP;,>P;6n;C).
0! $7;$UBR6 ,N 4.
P,R!.R PR,PAR,OUPDA(, U$0N+ 1/1..
,ND0!.
0mporting Data <0=
2 (he 0P.R( command ca"ses data obMects with the specified 'e) %al"es to be read from
P6Ln.
2 0f the import is s"ccessf"l* $7;$UBR6 is 4I if not* it is 4.
R,P.R( RP0P.R(.
(ABL,$# P6Ln.
0N6LUD, RP6nCC)4. 86l"ster definition
H !ill cl"ster Ee)
H 0mport record
0P.R( (ABL,5 !R. DA(ABA$, P6Ln<C)= 0D C);E,7.
0! $7;$UBR6 ,N 4.
H Displa) data obMect
,ND0!.
0mporting data <00=
2 0mport data "sing macro RP;0P;6n;C).
2 6hec' ret"rn code $7;$UBR6. 0f 4* it is s"ccessf"l. 0f 4* error.
2 Need incl"de b"ffer management ro"tines RPPP>44
R,P.R( RP0P.R(.
HB"ffer definition
0N6LUD, RPPP>D44.
DA(A# B,+0N .! 6..N PAR( 1BU!!,R1.
0N6LUD, RPPP>D54.
DA(A# ,ND .! 6..N PAR( 1BU!!,R1.
Himport data to b"ffer
RP;0P;6n;C).
....
HB"ffer management ro"tines
0N6LUD, RPPP>44.
6l"ster A"thori&ation
2 $imple ,>P.R(/0P.R( statement does not chec' for cl"ster a"thori&ation.
2 Use ,>P.R(/0P.R( %ia b"ffer* the b"ffer management ro"tines chec' for cl"ster
a"thori&ation.
Pa)roll Res"lts <0=
2 Pa)roll res"lts are stored in cl"ster Rn of P6L9 as field string and internal tables.
n ; co"ntr) identifier.
2 $tandard reports read the res"lts from cl"ster Rn. Report RP6L$(Rn lists all pa)roll res"ltsI
report RP6,D(n4 lists the res"lts on a pa)roll form.
Pa)roll Res"lts <00=
2 (he cl"ster definition of pa)roll res"lts is stored in two 0NL6UD, reports#
incl"de# rpc9rC4A. 8Definition 6l"ster R" <0=
incl"de# rpc9r""4. 8Definition 6l"ster R" <00=
(he first 0N6LUD, defines the co"ntr);independent partI (he second 0N6LUD, defines the co"ntr);
specific part <U$=.
2 (he cl"ster 'e) is stored in the field string R>;E,7.
Pa)roll Res"lts <000=
2 All the field string and internal tables stored in P6L9 are defined in the ABAP/4 dictionar). (his
allows )o" to "se the same str"ct"res in different definitions and nonetheless maintain data
consistenc).
2 (he str"ct"res for cl"ster definition compl) with the name con%ention P6nnn. Unfort"natel)*
1nnn1 can be an) set of alphan"meric characters.
HEe) definition
DA(A# B,+0N .! R>;E,7.
0N6LUD, $(RU6(UR, P6944.
DA(A# ,ND .! R>;E,7.
HPa)roll director)
DA(A# B,+0N .! R+D0R .66UR$ 544.
0N6LUD, $(RU6(UR, P69@5.
DA(A# ,ND .! R+D0R.
Pa)roll 6l"ster Director)
2 (o read pa)roll res"lts* )o" need two 'e)s# pernr and se3no
. 7o" can get $,NN. b) importing the cl"ster director) <6D= first.
R,P.R( DHR0PR(.
(ABL,$# P,RNR* P6L5* P6L9.
0NL6UD,# rpc9cd4A. 8definition cl"ster 6D
PARA,(,R$# P,R$.N L0E, P,RNR;P,RNR.
...
RP;0N0(;BU!!,R.
H0mport cl"ster Director)
6D;E,7;P,RNR ? P,RNR;P,RNR.
RP;0P;69;6U.
6H,6E $7;$UBR6 ? 4.
L..P A( R+D0R.
R>;E,7;P,RNR ? P,R$.N.
UNPA6E R+D0R;$,NNR (. R>;E,7;$,NN..
H0mport data from P6L9
RP;0P;69;RU.
0NL6UD,# RPPP>44. 8P6L5/P6L9 BU!!,R HANDL0N+
!"nction od"le <0=
6DO,/ALUA(0.NOP,R0.D$
2 After importing the pa)roll director)* which record to read is "p to the programmer.
2 ,ach pa)roll res"lt has a stat"s.
1P1 ; pre%io"s res"lt
1A1 ; c"rrent <act"al= res"lt
1.1 ; old res"lt
2 !"nction mod"le 6DO,/ALUA(0.NOP,R0.D$ will restore the pa)roll res"lt stat"s for a period
when that pa)roll is initiall) r"n. 0t also will select all the rele%ant periods to be e%al"ated.
!"nction od"le <00=
6DO,/ALUA(0.NOP,R0.D$
call f"nction 16DO,/ALUA(0.NOP,R0.D$1
eCporting
bon"sOdate ? refOperiods;bondt
inperOmodif ? pn;permo
inper ? refOperiods;inper
pa)Ot)pe ? refOperiods;pa)t)
pa)Oident ? refOperiods;pa)id
tables
rgdir ? rgdir
e%pdir ? e%p
iab'rs ? pnpab'rs
eCceptions
noOrecordOfo"nd ? 5.
A"thori&ation 6hec'
A"thori&ation for Persons
2 0n the a"thori&ation chec' for persons* the s)stem determines whether the "ser has the
a"thori&ations re3"ired for the organi&ational feat"res of the emplo)ees selected with
+,( P,RNR.
2 ,mplo)ees for which the "ser has no a"thori&ation are s'ipped and appear in a list at the end
of the report.
2 A"thori&ation obMect# 1HR# aster data1
A"thori&ation for Data
2 0n the a"thori&ation chec' for data* the s)stem determines whether the "ser is a"thori&ed to
read the infot)pes specified in the report.
2 0f the a"thori&ation for a partic"lar infot)pe is missing* the e%al"ation is terminated and an error
message is displa)ed.
Deacti%ating the A"thori&ation 6hec'
2 0n certain reports* it ma) be "sef"l to deacti%ate the a"thori&ation chec' in order to impro%e
performance. <e.g. when r"nning pa)roll=
2 7o" can store this information in the obMect 1HR# Reporting1.
Database !ables in *R
2 Personnel Administration <PA= ; master and time data infot)pe tables <transparent tables=.
PAnnnn# e.g. PA4445 for infot)pe 4445
2 Personnel De%elopment <PD= ; .rg Unit* Lob* Position* etc. <transparent tables=.
HRPnnnn# e.g. HRP5444 for infot)pe 5444
2 (ime/(ra%el eCpense/Pa)roll/Applicant (rac'ing data/HR wor' areas/Doc"ments <cl"ster
P6Ln# e.g. P6L9 for time/pa)roll res"lts.
$l%ster !able
2 6l"ster tables combine the data from se%eral tables with identical <or almost identical= 'e)s
into one ph)sical record on the database.
. Data is written to a database in compressed form.
2 Retrie%al of data is %er) fast if the primar) 'e) is 'nown.
2 6l"ster tables are defined in the data dictionar) as transparent tables.
2 ,Cternal programs can N.( interpret the data in a cl"ster table.
2 $pecial lang"age elements ,>P.R( (. DA(ABA$,* 0P.R( (. DA(ABA$, and D,L,(,
!R. DA(ABA$, are "sed to process data in the cl"ster tables.
P6L5 ; Database for HR wor' areaI
P6L9 ; Acco"nting Res"lts <time* tra%el eCpense and pa)roll=I
P6LB ; Applicant trac'ing dataI
P6L4 ; Doc"ments* Pa)roll )ear;end (aC data
Database !ables P$Ln
2 P6Ln database tables are di%ided into s"bareas 'nown as data cl"sters.
2 Data 6l"sters are identified b) a two;character code. e.g RU for U$ pa)roll res"lt* B9 for
time e%al"ation res"lt...
2 ,ach HR s"barea has its own cl"ster.
2 ,ach s"barea has its own 'e).
Database !able P$L+
2 (he database table P6L5 contains the following data areas#
B5 time e%ents/PD6
+5 gro"p incenti%e wages
L5 indi%id"al incenti%e wages
P6 personal calendar
(, tra%el eCpenses/pa)roll res"lts
($ tra%el eCpenses/master data
(> infot)pe teCts
D0 PD6 interface ;G cost acco"nt
Database !able P$L,
2 (he database table P6L9 contains the following data areas#
B9 time acco"nting res"lts
6D cl"ster director) of the 6D manager
P$ generated schemas
P( teCts for generated schemas
R> pa)roll acco"nting res"lts/international
Rn pa)roll acco"nting res"lts/co"ntr);specific < n ? HR co"ntr) indicator =
DL personal wor' sched"le
Database !able P$L-
2 (he database table P6LB contains the following data areas#
AP action log / time sched"le
(7 teCts for applicant data infot)pes
Data Management of P$Ln
2 (he ABAP commands 0P.R( and ,>P.R( are "sed for management of read/write to
database tables P6Ln.
2 A "ni3"e 'e) has to be "sed when reading data from or writing data to the P6Ln.
!ield Name E,7 Length (eCt
AND( > B 6lient
R,L0D > 9 Relation 0D <RU*B9..=
$R(!D > 44 -or' Area Ee)
$R(!9 > 4 $ort 'e) for d"p. 'e)
$l%ster Definition
2 (he data definition of a wor' area for P6Ln is specified in separate programs which compl)
with fiCed naming con%entions.
2 (he) are defined as 0N6LUD, programs <RP6nCC)4=. (he following naming con%ention applies#
n ? 5 or 9 <P6L5 or P6L9=
CC ? Relation 0D <e.g. R>=
) ? 4 for international cl"sters or co"ntr) indicator <(J44L= for different co"ntr) cl"ster
E.#orting Data /I0
2 (he ,>P.R( command ca"ses one or more 1C)1 E,7 data obMects to be written to cl"ster C).
2 (he cl"ster definition is integrated with the 0N6LUD, statement.
R,P.R( DHR,>PR(.
(ABL,$# P6Ln.
0N6LUD,# RP6nCC)4. 86l"ster definition
H !ill cl"ster E,7
C);'e);field ? F%al"eG.
H !ill data obMect
....
H ,Cport record
,>P.R( (ABL,5 (. DA(ABA$, P6Ln<C)= 0D C);E,7.
0! $7;$UBR6 ,N 4.
-R0(,# / 1Update s"ccessf"l1.
,ND0!.
,Cporting Data <00=
. ,Cport data "sing macro RP;,>P;6n;C).
2 -hen data records are eCported "sing macro* the) are not written to the database b"t to a
main memor) b"ffer.
2 (o sa%e data* "se the PR,PAR,OUPDA(, ro"tine with the U$0N+ parameter 1/1.
R,P.R( DHR,>PR(.
HB"ffer definition
0N6LUD, RPPP>D44. 0N6LUD, RPPP>44. 8B"ffer management
DA(A# B,+0N .! 6..N PAR( 1BU!!,R1.
0N6LUD, RPPP>D54.
DA(A# ,ND .! 6..N PAR( 1BU!!,R1.
...
RP;,>P;6n;C).
0! $7;$UBR6 ,N 4.
P,R!.R PR,PAR,OUPDA(, U$0N+ 1/1..
,ND0!.
0mporting Data <0=
2 (he 0P.R( command ca"ses data obMects with the specified 'e) %al"es to be read from
P6Ln.
2 0f the import is s"ccessf"l* $7;$UBR6 is 4I if not* it is 4.
R,P.R( RP0P.R(.
(ABL,$# P6Ln.
0N6LUD, RP6nCC)4. 86l"ster definition
H !ill cl"ster Ee)
H 0mport record
0P.R( (ABL,5 !R. DA(ABA$, P6Ln<C)= 0D C);E,7.
0! $7;$UBR6 ,N 4.
H Displa) data obMect
,ND0!.
0mporting data <00=
2 0mport data "sing macro RP;0P;6n;C).
2 6hec' ret"rn code $7;$UBR6. 0f 4* it is s"ccessf"l. 0f 4* error.
2 Need incl"de b"ffer management ro"tines RPPP>44
R,P.R( RP0P.R(.
HB"ffer definition
0N6LUD, RPPP>D44.
DA(A# B,+0N .! 6..N PAR( 1BU!!,R1.
0N6LUD, RPPP>D54.
DA(A# ,ND .! 6..N PAR( 1BU!!,R1.
Himport data to b"ffer
RP;0P;6n;C).
....
HB"ffer management ro"tines
0N6LUD, RPPP>44.
6l"ster A"thori&ation
2 $imple ,>P.R(/0P.R( statement does not chec' for cl"ster a"thori&ation.
2 Use ,>P.R(/0P.R( %ia b"ffer* the b"ffer management ro"tines chec' for cl"ster
a"thori&ation.
Pa)roll Res"lts <0=
2 Pa)roll res"lts are stored in cl"ster Rn of P6L9 as field string and internal tables.
n ; co"ntr) identifier.
2 $tandard reports read the res"lts from cl"ster Rn. Report RP6L$(Rn lists all pa)roll res"ltsI
report RP6,D(n4 lists the res"lts on a pa)roll form.
Pa)roll Res"lts <00=
2 (he cl"ster definition of pa)roll res"lts is stored in two 0NL6UD, reports#
incl"de# rpc9rC4A. 8Definition 6l"ster R" <0=
incl"de# rpc9r""4. 8Definition 6l"ster R" <00=
(he first 0N6LUD, defines the co"ntr);independent partI (he second 0N6LUD, defines the co"ntr);
specific part <U$=.
2 (he cl"ster 'e) is stored in the field string R>;E,7.
Pa)roll Res"lts <000=
2 All the field string and internal tables stored in P6L9 are defined in the ABAP/4 dictionar). (his
allows )o" to "se the same str"ct"res in different definitions and nonetheless maintain data
consistenc).
2 (he str"ct"res for cl"ster definition compl) with the name con%ention P6nnn. Unfort"natel)*
1nnn1 can be an) set of alphan"meric characters.
HEe) definition
DA(A# B,+0N .! R>;E,7.
0N6LUD, $(RU6(UR, P6944.
DA(A# ,ND .! R>;E,7.
HPa)roll director)
DA(A# B,+0N .! R+D0R .66UR$ 544.
0N6LUD, $(RU6(UR, P69@5.
DA(A# ,ND .! R+D0R.
Pa)roll 6l"ster Director)
2 (o read pa)roll res"lts* )o" need two 'e)s# pernr and se3no
. 7o" can get $,NN. b) importing the cl"ster director) <6D= first.
R,P.R( DHR0PR(.
(ABL,$# P,RNR* P6L5* P6L9.
0NL6UD,# rpc9cd4A. 8definition cl"ster 6D
PARA,(,R$# P,R$.N L0E, P,RNR;P,RNR.
...
RP;0N0(;BU!!,R.
H0mport cl"ster Director)
6D;E,7;P,RNR ? P,RNR;P,RNR.
RP;0P;69;6U.
6H,6E $7;$UBR6 ? 4.
L..P A( R+D0R.
R>;E,7;P,RNR ? P,R$.N.
UNPA6E R+D0R;$,NNR (. R>;E,7;$,NN..
H0mport data from P6L9
RP;0P;69;RU.
0NL6UD,# RPPP>44. 8P6L5/P6L9 BU!!,R HANDL0N+
!"nction od"le <0=
6DO,/ALUA(0.NOP,R0.D$
2 After importing the pa)roll director)* which record to read is "p to the programmer.
2 ,ach pa)roll res"lt has a stat"s.
1P1 ; pre%io"s res"lt
1A1 ; c"rrent <act"al= res"lt
1.1 ; old res"lt
2 !"nction mod"le 6DO,/ALUA(0.NOP,R0.D$ will restore the pa)roll res"lt stat"s for a period
when that pa)roll is initiall) r"n. 0t also will select all the rele%ant periods to be e%al"ated.
!"nction od"le <00=
6DO,/ALUA(0.NOP,R0.D$
call f"nction 16DO,/ALUA(0.NOP,R0.D$1
eCporting
bon"sOdate ? refOperiods;bondt
inperOmodif ? pn;permo
inper ? refOperiods;inper
pa)Ot)pe ? refOperiods;pa)t)
pa)Oident ? refOperiods;pa)id
tables
rgdir ? rgdir
e%pdir ? e%p
iab'rs ? pnpab'rs
eCceptions
noOrecordOfo"nd ? 5.
A"thori&ation 6hec'
A"thori&ation for Persons
2 0n the a"thori&ation chec' for persons* the s)stem determines whether the "ser has the
a"thori&ations re3"ired for the organi&ational feat"res of the emplo)ees selected with
+,( P,RNR.
2 ,mplo)ees for which the "ser has no a"thori&ation are s'ipped and appear in a list at the end
of the report.
2 A"thori&ation obMect# 1HR# aster data1
A"thori&ation for Data
2 0n the a"thori&ation chec' for data* the s)stem determines whether the "ser is a"thori&ed to
read the infot)pes specified in the report.
2 0f the a"thori&ation for a partic"lar infot)pe is missing* the e%al"ation is terminated and an error
message is displa)ed.
Deacti%ating the A"thori&ation 6hec'
2 0n certain reports* it ma) be "sef"l to deacti%ate the a"thori&ation chec' in order to impro%e
performance. <e.g. when r"nning pa)roll=
2 7o" can store this information in the obMect 1HR# Reporting1.

S-ar putea să vă placă și