Anda di halaman 1dari 1

Macro contains some part of source code which it will be useful for number of ap plications.

( Like function modules ) Generally we use two macros in ABAP-HR or SAP-HR RP-PROVIDE-FROM-LAST RP-PROVIDE-FROM-FRST Ex: RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA. IF PN-SW-FOUND = 1. WRITE YOUR CONDITION. ENDIF. The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is v alid in the data selection period. The macro RP-PROVIDE-FROM-FRST retrieves the first(start)data record which is va lid in the data selection period. For every macro, whether the operation was successful or not will be checked wit h PNP-SW-FOUND. If PNP-SW-FOUND = 1 , then the operation is successful. ( same as sy-subrc but t he value is in reverse case) The macro RP-READ-INFOTYPE retrieves all the data record(s) which is valid in th e data selection period. If SY-SUBRC = 0 , then the process is successful. All the Macros are stored in table TRMAC Whenever you are using the macros like RP-PROVIDE-FROM-LAST or RP-PROVIDE-FROM-FRST, check whether you have included logical database PNP in program attributes. It is not necessary to include logical database PNP/PNPCE in your program when y ou are using the macro like RP-READ-INFOTYPE A B C D E , where A corresponds to PERNR which describes for which personnel number you require re cords. B corresponds to INFOTYPE which describes from which infotype you require record s. C corresponds to data structure of the declared infotype (internal table like P0 000 for infotype 0000) where all the records of the particular personnel number will be stored. D corresponds to Start date. Macros will be stored in table TRMAC E corresponds to End date.

Anda mungkin juga menyukai