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: 

what is rp_provide_from_last

Former Member
0 Kudos

Hi all,

Can any one please explain me what his line would do?

rp_provide_from_last p0001 space pn-begda pn-endda.

I know p0001[] is itab and p0001 its wa but I cantunderstand what it does.?

Thanks in advance.

3 REPLIES 3

bpawanchand
Active Contributor

Former Member
0 Kudos

Please check the link below

http://help.sap.com/saphelp_47x200/helpdata/en/4f/d527e1575e11d189270000e8322f96/content.htm

the macro rp_provide_from_last fetches the last record in the date range(parameters 3 and 4) into the header of the internal table, please check the definition of this macro in the database table TRMAC.

shafiq_rehman3
Active Contributor
0 Kudos

in your example:

 rp_provide_from_last p0001 space pn-begda pn-endda.

rp_provide_from_last is a macro which will get you latest record from internal table p0001, it will place the fetched record in the header of P0001.

space is placeholder for subtype, there is no subtype in infotype 0001 so thats why we put 'space' here.

pn-begda and pn-endda are the date ranges in which the latest record will be fetched.

P0001 will be populated with all records of current pernr. so basically we are looking for latest record in the dates that user provides on the selection screen.

Hope it helps.

Thanks.