‎2005 Nov 24 6:39 AM
I need to get more information on RP-PROVIDE-FROM-LAST .
‎2005 Nov 24 6:44 AM
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.
‎2005 Nov 24 6:47 AM
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.
‎2005 Nov 24 6:49 AM
Hi Jayasree,
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.
Hope you r cleared with the Provide Statement.
Regards,
Sudhakar.