Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR-ABAP

Former Member
0 Kudos

Dear Friends,

Can anyone please explain me what does this statement do.

rp_provide_from_last p0001 space pn-begda pn-endda

Regards,

Gopi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

RP_PROVIDE_FROM_LAST can only be used to select 1 infotype (i.e.

table record) at a time. It uses the selection dates specified and

returns the correct record for those dates.

*********

The macro RP_PROVIDE_FROM_LAST is used to

retrieve the last entry of the current period in the table header entry from an internal

infotype table (here p0001 and p0002).

rp_provide_from_last p0032 space from-date to-date will return the last record of infty 32 valid between from-date and to-date, rp_provide_from_frst the first.

You might want to check whether reading was successful, to do so use pnp-sw-found (pnp-sw-found = '1' means reading was successful.)

Please note, that the macros will only provide data, that has been selected by the logical database pnp before, so if you make restrictions regarding validity date on the selection-screen of pnp.

***********

This is a predifined Macro, RP-PROVIDE-FROM-LAST is used to get required record into the header line of the internal table.

You need to pass the follwing Parameters to this Macro.

Subtype: If the Infotype has any subtypes, pass the required subtype. Else pass SPACE as the Subtype.

PN-BEGDA and PN-ENDDA are the dates selected on the selection screen.

Say you need to get the latest record from Infotype 0000

RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA.

If PNP-SW-F0UND = 1.

*--Atleast one record found

Move P0000 to your Final Internal table.

Endif.

4 REPLIES 4

Former Member
0 Kudos

RP_PROVIDE_FROM_LAST can only be used to select 1 infotype (i.e.

table record) at a time. It uses the selection dates specified and

returns the correct record for those dates.

*********

The macro RP_PROVIDE_FROM_LAST is used to

retrieve the last entry of the current period in the table header entry from an internal

infotype table (here p0001 and p0002).

rp_provide_from_last p0032 space from-date to-date will return the last record of infty 32 valid between from-date and to-date, rp_provide_from_frst the first.

You might want to check whether reading was successful, to do so use pnp-sw-found (pnp-sw-found = '1' means reading was successful.)

Please note, that the macros will only provide data, that has been selected by the logical database pnp before, so if you make restrictions regarding validity date on the selection-screen of pnp.

***********

This is a predifined Macro, RP-PROVIDE-FROM-LAST is used to get required record into the header line of the internal table.

You need to pass the follwing Parameters to this Macro.

Subtype: If the Infotype has any subtypes, pass the required subtype. Else pass SPACE as the Subtype.

PN-BEGDA and PN-ENDDA are the dates selected on the selection screen.

Say you need to get the latest record from Infotype 0000

RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA.

If PNP-SW-F0UND = 1.

*--Atleast one record found

Move P0000 to your Final Internal table.

Endif.

abdulazeez12
Active Contributor
0 Kudos

It provides the latest records..available in infotype 0001 and between the dates begda and endda.

SPACE here is for Subtypes..

if there is no subtype for a particular infotype, u enter space..otherwise the subtype number..

hope this helps..

Former Member
0 Kudos

Hi

HR:

HR deals with the INFOTYPES which are similar to Tables in General ABAP.

There are different ways of fetching data from these infotypes.

There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc

Infotypes for these areas are different from one another area.

storing of records data in each type of area is different

LDBS like PNP are used in HR programing.

Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc

and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.

On the whole Normal ABAP is different from HR abap.

For Personal Admn the Infotypes start with PA0000 to PA1999

Time Related Infotypes start with PA2000 to PA2999.

Orgn related Infotypes start with HRP1000 to HRP1999.

All custom developed infotypes stsrat with PA9000 onwards.

In payroll processing we use Clusters like PCL1,2,3 and 4.

Instead of Select query we use PROVIDE and ENDPROVIDE..

You have to assign a Logical Database in the attributes PNP.

GET PERNR

RP_PROVIDE_FROM_FIRST to fetch the first record of an employee

RP_PROVIDE_FROM_LAST to fetch the last record of an employee

Go through the SAp doc for HR programming and start doing.

http://www.sapdevelopment.co.uk/hr/hrhome.htm

See:

http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm

sites regarding hr-abap:

http://www.sapdevelopment.co.uk/hr/hrhome.htm

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#...

http://www.erpgenie.com/faq/hr.htm.

http://www.planetsap.com/hr_abap_main_page.htm

http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html

These are the FAQ's that might helps you as well.

http://www.sap-img.com/human/hr-faq.htm

http://www.sapgenie.com/faq/hr.htm

http://www.planetsap.com/hr_abap_main_page.htm

http://www.atomhr.com/library_full.htm

HR Long texts Upload

Look at the below link

Regards

Anji

0 Kudos

Dear Anji

I am novice to HR-ABAP. I want to use the following statements in a BAPI Function Module(Source Code).

Get Pernr.

rp_provide_from_last p0001 space pn-begda pn-endda.

how do i mention the PNP LDB in Attributes.

Regards,

Gopi.