Get pernr and provide
Hi,
In HR ABAP, can you tell me what exactly "Get pernr" and "provide...end provide" does ? (with an example if possible)
I appreciate your input.
Thanks in advance.
hi
good
get pernr->
TABLES: PERNR,
PCL2.
INCLUDE ZHR_PCL2_CU_DATA - Payroll results. *
Data declarations for the IMPORT of database PCL2 for cluster RU. *
DATA: CD_NEXT_SEQ TYPE I, "Next available seq number
CD_LAST_PAY TYPE D. "Last payroll run date
DATA: BEGIN OF OCD_VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
*DATA: molga LIKE t001p-molga. "country identifier
DATA: END OF OCD_VERSION.
DATA: BEGIN OF RGDIR OCCURS 100.
INCLUDE STRUCTURE PC261. "(For Export and Import of Payroll Res
DATA: END OF RGDIR.
Key for database PCL2 cluster RU
DATA BEGIN OF RX_KEY.
INCLUDE STRUCTURE PC200. "Payroll Results Key
DATA: END OF RX_KEY.
country dependent
DATA: BEGIN OF RU-VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
DATA: END OF RU-VERSION.
DATA: BEGIN OF ORU_VERSION.
INCLUDE STRUCTURE PC201. "Technical Version
DATA: END OF ORU_VERSION.
Cumulated-result table
DATA: BEGIN OF CRT OCCURS 30.
INCLUDE STRUCTURE PC22Y. "Cumulated result table (USA)
DATA: END OF CRT.
GET PERNR.
IMPORT CD_VERSION TO OCD_VERSION
CD_LAST_PAY
CD_NEXT_SEQ
RGDIR
FROM DATABASE PCL2(CU) ID PERNR-PERNR.
CHECK SY-SUBRC EQ 0.
This is where you select the particular period you are searching for. The
selection will change based on what dates you are looking for.
LOOP AT RGDIR WHERE FPPER EQ P_PERIOD
AND INPER EQ P_PERIOD
AND ( RUNDT GT Z_RUNDT
OR ( RUNDT EQ Z_RUNDT
AND RUNTM GT Z_RUNTI ) )
AND SRTZA = 'A'
AND PAYTY = ' '
AND VOID NE 'V'.
CHECK SY-SUBRC = 0.
MOVE PERNR-PERNR TO RX_KEY-PERNR.
MOVE RGDIR-SEQNR TO RX_KEY-SEQNO.
IMPORT RU-VERSION TO ORU-VERSION
CRT
FROM DATABASE PCL2(RU) ID RX_KEY.
CHECK SY_SUBRC = 0.
LOOP AT CRT.
Process crt data.
ENDLOOP.
ENDLOOP.
thanks
mrutyun
Similar Messages
-
Regarding GET PERNR and GET OBJECT
Hi,
I want to know the purpose and working of these 2 events. can any body give me the explanation r any document on these 2 events.
Thanks & Regards,
SureshHi
This 2 events are used in HR programming. On PA if you use logical database PNP or PNPCE ,the internal tables of infotypes specified will be populated with data for that particular employee number.
Check the sample code below and see how it works.
report z_test .
tables:pernr .
infotypes:0001,
0002,
0006.
start-of-selection.
get pernr.
end-of-selection. -
Regarding GET and PROVIDE coding
HI GURUS,
cud u plz explain the given statement:::::HOW does it work.
GET pernr.
PROVIDE * FROM p0001
BETWEEN pybegda AND pyendda.
ENDPROVIDE.Hi ravi,
HRABAP
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
you can see some Standard Program examples in this one..
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
These are the FAQ's that might helps you
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
Common link:
http://www.easymarketplace.de/online-pdfs.php
go thruthe links which r very helpful -
Hi all,
can u explain the get event functionality ?
Can u tell me the difference between
get pernr and get late pernr.
when should i use these type of statements ?
Regards
charanHi Ravi,
GET PERNR event initiates the data extraction for a pernr.
GTE PERNR LATE event is triggered after all the other events are triggered and right before the end-of-selection.
PL take a look at the following <a href="http://help.sap.com/saphelp_47x200/helpdata/en/ac/764da4496f11d3967200a0c9306433/frameset.htm">SAP Help</a> where it is explained very clearly.
Regards,
Suresh Datti -
hi frriends,
i am doing the hr programming for the first time & have a doubt.
when we extract the data using
get pernr & provide * from pxxxx
& then we move the data into corresponding itab
after that when we write the result with loop at itab,
it gives strange output.
actually, after the endloop again it goes to 'get pernr' & again it executes the same whole sequence.
can anybody help me understanding this concept
thanks
abhayhi bharat,
thanks for the reply.
the code is something like this
DATA: BEGIN OF i_tab1 OCCURS 0,
pernr like p0000-pernr,
stat2 like p0000-stat2,
abkrs like p0001-abkrs,
plans like p0001-plans,
END OF i_tab1.
GET pernr.
PROVIDE pernr stat2 FROM P0000
abkrs plans FROM P0001
BETWEEN sy-datum AND sy-datum.
ENDPROVIDE.
MOVE p0000-pernr TO i_tab1-pernr.
MOVE p0000-stat2 TO i_tab1-stat2.
MOVE p0001-abkrs TO i_tab1-abkrs.
MOVE p0001-plans TO i_tab1-plans.
APPEND i_tab1.
LOOP AT i_tab1.
write:/ i_tab1-pernr, 15 i_tab1-stat2, 35 i_tab1-abkrs,
50 i_tab1-plans.
ENDLOOP.
It gives me output like:
12340001 1 v1 99999999
12340001 1 v1 99999999
12340002 1 v1 99999999
12340001 1 v1 99999999
12340002 1 v1 99999999
12340003 1 v1 99999999
12340001 1 v1 99999999
and so on
if i dont use loop....endloop, it gives me proper results.
Also i am trying few things like deleting duplicates, sorting etc. on itab but not working.
can you please tell me why is it so?
thanx in advance
abhay -
GET PERNR thows to end Of Selection
Hi
i am new to the HR-ABAP
I am writing one custoized Payslip Z program. i have used Get Prnr macro. However, it does not populate the PERNR structure and the related infotypes.
Can someone help me where i am missing.
I used appropriate LDB in Program attriutes.
regards,
venkat- [GET|http://help.sap.com/abapdocu_70/en/ABAPGET-.htm] PERNR is not a macro but an Abap statement (actually an event) used in logical database (check nodes via SE36 on ldb like PNP), RP_READ_INFOTYPE is a macro as example.
- Did you define PERNR as [TABLES|http://help.sap.com/abapdocu_70/en/ABAPTABLES.htm] or [NODES|http://help.sap.com/abapdocu_70/en/ABAPNODES.htm] in your report
Sample
REPORT RPABAP05.
TABLES: PERNR.
INFOTYPES: 2001 MODE N.
GET PERNR.
RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
LOOP AT P2001.
WRITE: / P2001-ABWTG.
ENDLOOP.
other sample
REPORT RPABAP01.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE: / P0001-PERNR,
P0001-STELL,
P0001-BEGDA,
P0001-ENDDA.
ENDPROVIDE.
(look at help.sap.com or sdn.sap.com with correct keywords, you will find many samples)
Regards,
Raymond -
How to extract current record using get pernr (logical database)
Hi all,
I am using logical database in the program and using <b>get pernr</b> method. But there are multiple entries in the infotype for a perticular employee. i want to extract employees current record whose end date is greater than sy-datum.
how to do this using <b>get pernr</b>?
Thanks in advance.Hi Priti,
Get Pernr statement will get all the records for each employee spcicified for the Begin and End dates on the selection screen and store in an internal table for the infotypes declared in the infotypes statement.
You need to read this table and copy only the records that meet the date criteria in an internal table for further use.
For Ex:
infotypes : 0001.
tables : pernr.
TYPES : BEGIN OF ty_kostl,
pernr TYPE pernr-pernr,
kostl TYPE p0001-kostl,
ename TYPE p0001-ename,
END OF ty_kostl.
Work Areas
DATA : g_kostl_wa TYPE ty_kostl.
Internal Tables
DATA : i_kostl TYPE TABLE OF ty_kostl.
start-of-selection.
get pernr.
PROVIDE * FROM p0001 BETWEEN pn-begda AND pn-endda.
if p0001-endda GT sy-datum.
g_kostl_wa-pernr = p0001-pernr.
g_kostl_wa-kostl = p0001-kostl.
g_kostl_wa-ename = p0001-ename.
APPEND g_kostl_wa TO i_kostl.
CLEAR g_kostl_wa.
endif.
ENDPROVIDE. -
Hi all,
when I using GET PERNR, this is a loop , right ?
currently, I have no idea about where the value comes from to get into this 'PERNR' structure, pa0000 or pa0001 or any other place?
Thanks!Hi,
GET PERNR event fills the data structures of declared infotypes with all records that exists for a personnel number.
Data selection does not delimit the records that retrieved from the database.
Whenever GET PERNR statement is included in your program check the following two .
1.Have you included PNP for the logical database screen field in the program attributes.
2.Have you included PERNR structure in the tables declaration.
Below is a sample code, may help you understand the logic behing GET PERNR
tables: pernr.
infotypes: 0000,
0001,
0002,
0019,
0041,
0396,
9009.
start-of-selection.
get pernr.
provide * from p0396 between pn-begda and pn-endda.
perform refresh_tables.
call function 'HR_READ_INFOTYPE'
exporting
pernr = p0396-pernr
infty = '0396'
begda = pn-begda
endda = pn-endda
tables
infty_tab = i_p0396.
sort i_p0396 by begda descending.
read table i_p0396 index 1.
endprovide.
end-of-selection.
Check this as well:
[http://sapabap.iespana.es/sap/info/hr_overview.htm|http://sapabap.iespana.es/sap/info/hr_overview.htm]
Hope this help you.
Edited by: Lokesh Tarey on Jul 15, 2010 6:06 AM -
How to read personal no's on selection in LDB without using GET PERNR
Hi to all
I am using Logical data base PNP and selection screen 900.
Now my requirement is to retrieve personal no's which are entered at selection seperately without using GET PERNR.
Ineed all the pernrwhich are entered in selection.
How to do that.
Please guide.
Regards
AnubhavHi,
You can do as SUJIT said or use GET PERNR and assign PERN-PERNR to Workarea and then append that to internal table.
DATA:
ITAB_PERNR like standard table of PA0000-pernr,
wa_pernr like line of ITAB_PERNR.
GET PERNR.
wa_pernr-pernr = pernr-pernr.
append wa_pernr to ITAB_PERNR
Hope this would help you.
Regards
Narin Nandivada. -
in my requirement i take the perner from one program to ldb program and
i want the ldb to run for my pernr value from other program...its working in
dubbing mode .. now the prob is
i m not able to come out of the loop between get pernr and end of selection its
the excution is gng into ldb
in SAPLHRAC
IF HRAC_BADI IS INITIAL.
EXIT.
endif.
not coming out...
wen i run ldb(rptqta10) alone passing values directly its working fine..
can any one help me
points will be given....can any one give me solution
-
Hii All-
Whats the difference between GET PERNR and GET PERAS? when do we use each of these?
their usage??
TxHi Shakir,
Both 'Get pernr' and 'Get peras' is same in functionality.
Each of these will loop for all of the personnel numbers selected. It is concluded implicitly by the next event, for example, END-OF-SELECTION.
But, the main difference is we use GET PERNR in case of LDB PNP whereas
In case of LDB PNPCE, we use GET PERAS.
<b>
REWARD IF FOUND USEFUL.</b>
Thanks,
Radhika. -
Hi all,
I am using Adobe Pro 11 and on opening a pdf I am getting error 'Insufficient Data for an Image'. Please help and provide a workaround if the solution not there.
I have already set the preferences to for page view to low zoom settings, and page fit view settings, but it never opens the pdf. Please check and provide a solution asap.
Thanks in advance!Most of the documents have sensitive info on them. I will have to do some looking for some that i can share, but will get something to upload (dropbox) as soon as I can.
Thanks for you help. -
Function Module to get pernr number based on first name and last name
Hi All,
What is the Function Module to get pernr number based on first name and last name.
Could you please help me.
T@R.
Vidyahi Vidya,
you can get perner from PA0002 based on firs name and last name.
use select query and get perner. -
I am having problems uploading a photo book from my MacBook Pro!!! I almost complete uploading this 32 page iPhoto book when I get an error message stating "An error occurred uploading your order" This error message has occurred for each of my four attemps to upload. I have carried out a Disk Utility-Verify hard drive check and swapped from wireless to ethernet and still no joy. Can anyone suggest why this might be occurring and provide a solution please?
Boot into Safe Mode and try again.
-
Authorizations with PNP and Get Pernr.
We have just noticed an issue with how our custom reports are working in regards to authorizations. Our users have authorization to see Basic Pay infotype information up to the point where an associate becomes an executive. When running our reports the latest salary shows up instead of the last one they are allowed to see or just leaving that field blank. We are using the PNP logical database and Get Pernr. Isn't that supposed to pick up whatever authorization is assigned to the person?
Thanks,
MaryI do not know how you come to this statement. Of course LDB checks ALL HR Authorization defined. This incoporates the personnel administration part as well as the combination to structural authorizations.
However PNP will skip a PERNR if the user has only partial authorization by default. To get also only the restricted data what the user can see you must use the switch PNP_SW_SKIP_PERNR = 'N' at INITIALIZATION point.
Please see the documentation available here:
http://service.sap.com/erp-hcm
On the left side follow the links:
Services for mySAP ERP HCM
Special Documentation
Regards,
Michael
Maybe you are looking for
-
What is the best way to set up Facetime if using multiple computers with one apple ID?
I currently have FaceTime setup on my iPad 2 using my normal appleID, but have just recently upgraded our iMac from Leopard to Snow leopard, and have added FaceTime to that computer as well. So my question is this. If I want to avoid confusion with w
-
How do I disable the TTY option on my i phone (Version 5.1.1.)
How do I disable the TTY Option on my I phone 4 (Version 5.1.1.)
-
I would like to know if my laptop (Pavilion dv2108tx) is compatible with SSD because I'm using the stock Seagate 100 GB that ship with the laptop and it is dying.
-
Link wont open so i have to repost a question :(
my ipod isnt ,like, getting recognized by my computer...the frozen battery icon is up but its not comming up in itunes. my friend downloaded songs using itunes7 and i have itunes 6 and this has happened....help? what can/should i do?
-
Duplicate Messages created on target with Multimapping(No BPM)
Hi I am working on PI7.1 . My sceniro IDOC to JMS using message split Receiving IDOC with Header and Items, PI splitting IDOC and sending to Multiple JMS queues, Header segment data to header queue, Item segment data to Item queue PI Successfully Pos