‎2007 Mar 01 4:28 PM
Hi All,
Please anyone can explain me about these three MACROs of functions i mean to say what these macros into , and how it will work , for what we will use this macros.
these things i wanted to know
rp_set_data_interval 'P0014' pn-begda pn-endda.
rp_provide_from_last p0001 space pn-begda pn-endda.
rp-read-t001p p0001-werks p0001-btrtl space.
Thanks in Advance
Sheethal.
‎2007 Mar 01 4:36 PM
Hi,
Are these macros are defined locally or in the table TRMAC??
Check in the program for DEFINE rp_set_data_interval..where rp_set_data_interval is the macro defined in the program...'P0014' pn-begda pn-endda should be the parameters to the macro..You can check the code inside DEFINE..END-OF-DEFINITION..
Thanks,
Naren
‎2007 Mar 01 4:33 PM
Hi,
Macros can only be used in the program they are defined in and only after the definition are expanded at compilation/generation. A macro is more or less an abbreviation for some lines of code that are used more than once or twice. Since debugging a macro is not really possible, prevent the use of them.
Please check this link for more information on macro.
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db972835c111d1829f0000e829fbfe/frameset.htm
Regards,
Ferry Lianto
‎2007 Mar 01 4:34 PM
<b>rp_set_data_interval 'P0014' pn-begda pn-endda.</b>It set the date period for the Infotype 0014 selection in the report to the dates mentioned in the macro.
<b>rp_provide_from_last p0001 space pn-begda pn-endda.</b>
It retreives the latest record of Infotype 0001 between the date range pn-begda & pn-endda.
<b>rp-read-t001p p0001-werks p0001-btrtl space.</b>
It reads the database table t001p for the values Werks = p0001-werks & btrtl = p0001-btrtl.
~Suresh
‎2007 Mar 01 4:36 PM
Hi,
Are these macros are defined locally or in the table TRMAC??
Check in the program for DEFINE rp_set_data_interval..where rp_set_data_interval is the macro defined in the program...'P0014' pn-begda pn-endda should be the parameters to the macro..You can check the code inside DEFINE..END-OF-DEFINITION..
Thanks,
Naren
‎2007 Mar 01 5:28 PM
Some more info on Macros...
Macro contains some part of source code which will be useful for no.of applications. You can get the list of macros in the table TRMAC.
Whenever you are using the macros ,check whether you have included the relevant logical database in program attributes.
Macros can also be defined as TRMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. This code is grouped under a specific name in the table key. According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
Customer-specific macro modules should begin with a special character. The macros defined in the control table TRMAC can be used by all reports.