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: 

role of rp-provide-from-last & rp-provide-from-frst macros

Former Member
0 Kudos

Hi,

I have the following code :

******************************************************************************

REPORT  ZPYRLL01

Tables: PERNR.
Infotypes: 0002.

GET PERNR.
*rp-provide-from-last p0002 space pn-begda pn-endda.
*rp-provide-from-frst p0002 space pn-begda pn-endda.

WRITE: / 'Pernr ' , PERNR-PERNR , sy-vline ,
              'Pernr-Ename ' , (15) PERNR-ENAME , sy-vline ,
              'First Name ' , (8) p0002-VORNA , sy-vline ,
              'p0002-begda ' , (10) p0002-begda , sy-vline ,
              'p0002-endda ' , (10) p0002-endda , sy-vline ,
              'pn-begda ' , (10) pn-begda , sy-vline ,
              'pn-endda ' , (10) pn-endda.


******************************************************************************


I have tested it without both macros, with only the first macro and with only the second one.

And in the three trials I got the same results ?

(List of Personnel ranked by ascending pernrs)


So,


Q1 : What is the role of these two macros ?

Their presence or abscence change nothing in the result when processing.


Another Q :


If the GET PERNR statement beside filling ITs with data, do a loop.

Q2 : Then what is the role of Loop & Provide loops ?

We can replace WHEN & BETWEEN statement with an IF.

3 REPLIES 3

Former Member
0 Kudos

A1:  Related to your question 1, please check whether there are multiple entries exist.


(A) The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record which is valid in the data selection period. The macro makes sure that the last entry for a specified period is placed in the table header entry of the report output list.

(B) The macro RP-PROVIDE-FROM-FRST retrieves the first (start)data record which is valid in the data selection period. The first entry for a specified period is placed in the table header entry from an internal infotype table.

Ans 2:  When GET PERNR event occurs, the infotype records are imported to internal table Pnnnn. These tables then be processed in a Loop..EndLoop loop. And infotype with time constraint 3 must be processed by this way.

Thanks

Shailesh



0 Kudos

Thanks for your reply,

I already read these descriptions.

But, the problem is that these macros -appears for me- didn't do anything while using them in my code.

Get a look at this screen shot, it is the same for the 3 trials as I said.

Normally, I would get the last record (by time) in the specified period in the first line when using for e.g. the 'rp-provide-from-last'.

But what I got is the same when I only use GET PERNR without that macro (wich is the List of Personnel ranked by ascending pernrs).


Hope you get what meant.


0 Kudos

The only explanation I had till now, is that the two macros do their time evaluation based on the 'ENDDA' field, wich is the same for all the records in my case.

But I am not sure.