Rp_provide_from_last p2001 space pn-begda pn-endda

Hi Guru's,
I  am  using  PNP as LDB and after ,
My  requirement  is to  fetch  the records from p2001 for a specific time period mentioned in the selection screen.
Code :
Get  Perner.
rp_provide_from_last p2001 space pn-begda pn-endda.
the output   of the above is  giving  all  the data from  P2001 irrespective of the dates (Pn-begda & pn-endda.)
But  i want  the data with in the dates (Pn-begda & pn-endda.).
Plz suggest.
Thanks.

Hi,
  PROVIDE * FROM P2001
  BETWEEN Pnpbegda AND Pnpendda.
   write: p2001-pernr,p2001-begda.
  ENDPROVIDE.
use this code..........
Regards,
vamshidhar .
Edited by: vamshi naini on Apr 23, 2008 2:06 PM

Similar Messages

  • Rp_provide_from_last infotype subtype pn-begda pn-endda.

    Hi All,
    Is there a way to find out if a subtype exists before using this macro. If a subtype does not exist then it crashes.
    rp_provide_from_last infotype subtype pn-begda pn-endda.
    Thanks,
    ~Mark

    Mark,
    Check the View  V_T591A  - Subtype Characteristics.
    It will have all Subtypes maintained in your sytem  for infotype.
    Additionally if you want to Use the Macro for an Infotype without Subtype, Pass SPACE instead of Subtype.
    RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
    Hope this helps.
    Vinodh Balakrishnan
    Edited by: Vinodh Balakrishnan on Jan 15, 2008 3:19 PM

  • Rp-provide-from-last p0002 space pn-begda pn-endda.

    Hello Gurus,
    I need to know what is the sintax to get a particular person from PNP using
    rp-provide-from-last p0002 space pn-begda pn-endda.
    Thanks

    Hello Enrique,
    Check this code, if the sy-subrc as equal 2, employee is inactive:
    *&      Form  check_pernr_exists
    *       Check if employee exists
    *      -->P_PERNR    Personnel Number
    *      <--P_SUBRC    Return code
    FORM check_pernr_exists USING p_pernr TYPE any
                            CHANGING p_subrc TYPE sysubrc.
      CLEAR p_subrc.
      CALL FUNCTION 'RP_CHECK_PERNR'
        EXPORTING
          beg                     = sy-datum
          pnr                     = p_pernr
    *   IMPORTING
    *     NAME                    =
    *     PERSA                   =
    *     BUKRS                   =
    *     KOSTL                   =
    *     MOLGA                   =
    *     PERSONNEL_SUBAREA       =
        EXCEPTIONS
          data_fault              = 1
          person_not_active       = 2
          person_unknown          = 3
          exit_fault              = 4
          pernr_missing           = 5
          date_missing            = 6
          OTHERS                  = 7
      IF sy-subrc <> 0.
        p_subrc = sy-subrc.
      ENDIF.
    ENDFORM.                    "check_pernr_exists

  • HR - PNPbegda/PNPendda ......PN-begda/PN-endda

    Hi,
    I am going through some of the sample codes on internet. While querying on any infotype table I find that  begin date/ end date on selection screen is referred as PNPbegda/PNPendda some times and PN-begda/PN-endda some times. Is there any some reason for this? what is the difference between use of these in two different ways?
    Thanks
      SDN POWERED

    Hi,
    pnpbegda and pnpendda refer to the date fields on the selection screen.
    when you use macros like RP_PROVIDE_FROM_FRST and
    RP_PROVIDE_FROM_LAST you can see the pn-begda and pn-endda.
    That means during the program pnpbegda and pnpendda are
    assigned to pn-begda and pn-endda.
    Ex: RP_PROVIDE_FROM_FRST p0001 space pn-begda pn-endda.
    you can change pn- begda and pn-endda values.
    Ex: pn-begda = '20080101'.
          pn-endda = '20081231'.
    Ex: RP_PROVIDE_FROM_LAST p0001 space pn-begda pn-endda.
    you can directly use the dates even.
    EX:RP_PROVIDE_FROM_LAST p0001 space '20080101' '20081231'.
    For better understanding go through the programs
    SAPDBPNP and SAPDBPNPCE.

  • Rp_set_data_interval 'P0014' pn-begda pn-endda.

    Hi,
    Could you please tell me the diffrence of data retrival of infotype p0014 by get prenr and by using the macro:rp_set_data_interval 'P0014' pn-begda pn-endda..
    Thanks,
    Suresh

    >
    suresh kumar wrote:
    > Hi,
    >
    > Could you please tell me the diffrence of data retrival of infotype p0014 by get prenr and by using the macro:rp_set_data_interval 'P0014' pn-begda pn-endda..
    >
    >
    >
    > Thanks,
    > Suresh
    Hi Suresh,
      If you use this macro rp_set_data_interval 'P0014' pn-begda pn-endda'P0014' pn-begda pn-endda then the GET PERNR event only retrives the valid IT0014 records in the period pn-begda, pn-endda.
    If you don't use the macro rp_set_data_interval 'P0014' pn-begda pn-endda then the GET PERNR event retrieves all the available IT0014 records even if they are not valid in the interval pn-begda and pn-endda.
    Note: The macro rp_set_data_interval should be included in the START-OF-SELECTION event

  • Updating HRP infotype's begda and endda fields using RH_PNNNN_MAINTAIN.

    hi all,
            I want to change the begda and endda fields in hrpXXXX infotype tables, but use the functiom module RH_PNNNN_MAINTAIN in dialog mode, the begda and endda fields can not be edited.
    can we change these things using this FM?
    or are there any other FMs can make this?
    thanks,
    Huai Zhi

    Hello,
    Use in this way
      CALL FUNCTION 'RH_PNNNN_MAINTAIN'
           EXPORTING
                ACT_FCODE          = ACT_FCODE
                ACT_PLVAR          = IPLOG-PLVAR
                ACT_OTYPE          = IPLOG-OTYPE
                ACT_OBJID          = IPLOG-OBJID
                ACT_INFTY          = IPLOG-INFTY
                ACT_SUBTY          = IPLOG-SUBTY
                ACT_ISTAT          = IPLOG-ISTAT
                ACT_BEGDA          = IPLOG-BEGDA
                ACT_ENDDA          = IPLOG-ENDDA
                ACT_PNNNN          = IPLOG
                SUPPRESS_DIALOG    = '1'
           IMPORTING
                ACT_OK_CODE        = OUT_FCODE
                ACT_PNNNN_OUT      = IPLOG
           EXCEPTIONS
                INFTY_NOT_VALID    = 01
                NO_PLVAR           = 02
                OBJECT_NOT_DEFINED = 03
                OTYPE_NOT_VALID    = 04.

  • Begda and endda missing

    Dear experts,
    I'm making HR reports and noticed that i could only retrieve data from the current month and year. I did some problemsearching and discovered that my begda and endda infotypes aren't present in my HeadCount and Personnel Actions cube in BW.
    My question to you:
    Is there a way i can still access these infotypes for my query?
    or do i need to remake my cube?(if so, how?)

    Hi,
    Thanks Atish...
    I'm creating a custom infotype which has to be populated from more than one infotype..
    So in that dynamic action i've to check the values of begda and endda in a module... for that i don't want to include the structures of all the infotypes from which the custom infotype is going to be populated.
    I want to fetch the values of begda and endda from some other table..
    Got it my friend?

  • Using Provide statement in HR programming

    Hi,
    Im using the code below;
    PROVIDE FROM p2001 BETWEEN pn-begda AND pn-endda
       WHERE p2001-subty = '0101'.
    ENDPROVIDE.
    But the subty = 0101 doesnt seem to be working. When i look at the p2001 table after i execute the code, it does limit within the date range but not the subtype.
    Thanks

    hi,
    DATA  i_2001 TYPE p2001 OCCURS 0 WITH HEADER LINE.
    TYPES: BEGIN OF i_output,
           v_AWART  TYPE p2001-AWART,
       END OF i_output.
    DATA : it_out TYPE STANDARD TABLE OF i_output INITIAL SIZE 0,
           wa_output TYPE i_output.
    START-OF-SELECTION.
    GET pernr.
      rp_provide_from_last p2001 space pn-begda pn-endda.
      CHECK p2001-SUBTY = '0101'.
      LOOP AT p2001 WHERE  begda  GE pn-begda
                                        AND begda LE pn-endda.
        MOVE-CORRESPONDING p2001 TO i_2001.
        APPEND i_2001.
        DELETE p2001.
      ENDLOOP.
      wa_output-v_AWART   = i_0000-AWART.
      IF  p2001-begda  GE pn-begda AND p2001-begda LE pn-endda.
              APPEND wa_output TO it_out.
          ENDIF.
    REFRESH i_20001[].
      CLEAR i_2001.
    REGARDS,
    sreelakshmi
    Edited by: Sreelakshmi p on Jun 23, 2008 3:02 PM

  • Write code in ad hoc query

    hello All,
    I have a reqmnt, My client has an existing ad hoc query and I need to add two fields to it, both of the fields are not direct and needs some coding, cud anyone please explain how can i go bout it?
    thanks,
    RS

    Its quite straight forward, so just have a play around, but the steps are something like:
    1.     SQ01/environment/info sets/query areas/standard
    2.     Choose the info set you wish to change
    3.     Choose the filed group you wish to add a field to
    4.     Right click the infoset you want to add a field to
    5.     Add the new field to the field group for that infoset
    6.     Then use the extras button to add code to that field
    I tend to use the initialization, and record processing event blocks for adding my code.  USe the eblow link for the SAP documentation.
    http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm
    And here is some sample code i've used for one particaulr field, just to give you an idea of how easy it is.
    rp_provide_from_last p0000 space pn-begda pn-endda.
    * Get last Ity2001 record
    IF p0000-massn = '16'.
      SELECT SINGLE pernr max( endda )
             FROM pa2001
             INTO (p2001-pernr, p2001-endda)
                  WHERE pernr = pernr-pernr
                  GROUP BY pernr.
    ELSE.
      rp_provide_from_last p2001 space pn-begda pn-endda.
    ENDIF.
    SELECT SINGLE UMSKD
           INTO WA_UMSKD
           FROM Y0PT_AMMSUBS
                WHERE PERNR = p2001-pernr
                AND   ENDDA = p2001-endda.
    wa_OCCHC  = wa_UMSKD(2).
    occhealth = wa_OCCHC.
    <a href="http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm">http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm</a>

  • Rp_provide_from_last dynamic table

    Hi,
    I have a report which uses logical database PNPCE to fetch employee data and macros like rp_provide_from_last to read infotypes.
    INFOTYPES: 0001 name gtab1,
    002 name gtab2.
    rp_provide_from_last gtab1 space pn-begda pn-endda
    rp_provide_from_last gtab2 space pn-begda pn-endda.
    I want to use a dynamic fieldname instead of gtab1 / gtab2. Basically i want to use this above macro statement to check if the infotype exists for a employee. So if there are 50 infotypes to be checked, i donot want to write this macro 50 times with 50 tables, is there a way to use a dynamic table name in the macro statement ?
    Thanks
    Subha

    Your requirement can be met by modelling the program based on the below source code. This program will list all infotypes that have been maintained for a PERNR. This proram excludes certain infotypes like PD infotypes. The source code can be changed to include all desired infotypes.
    *& Report  ZTEST_CHECK_INFY
    REPORT  ZTEST_CHECK_INFY.
    tables: t777d.
    DATA SUBRC LIKE SY-SUBRC.
    DATA PAR1 LIKE SY-MSGV1.
    DATA: BEGIN OF SELTAB OCCURS 5.
            INCLUDE STRUCTURE PRELP AS prelp.                   "UC
    DATA:   OPERA(1).
    DATA: END OF SELTAB.
    data: it_777d like t777d occurs 0.
    data: wa_777d type t777d.
    data: ls_index(4) type n.
    select-options: so_infty for t777d-infty.
    select-options: so_inft1 for t777d-infty no intervals.
    Initialization.
      so_infty-sign = 'I'.
      so_infty-option = 'BT'.
      so_infty-low = '0000'.
      so_infty-high = '9999'.
      append so_infty.
      select * from t777d into corresponding fields of table it_777d where infty in so_infty.
      loop at it_777d into wa_777d.
        so_inft1-sign = 'I'.
        so_inft1-option = 'EQ'.
        so_inft1-low = wa_777d-infty.
        append so_inft1.
      endloop.
    start-of-selection.
      CALL FUNCTION 'HR_INITIALIZE_BUFFER'
        EXPORTING
          TCLAS  = 'A'
          PERNR  = '40101017'
        EXCEPTIONS
          OTHERS = 1.
      Loop at so_inft1 where not low between '1000' and '8999'.
        REFRESH SELTAB.
        CLEAR   SELTAB.
        CALL FUNCTION 'HR_READ_INFOTYPE'
          EXPORTING
            TCLAS           = 'A'
            PERNR           = '40101017'
            INFTY           = so_INFT1-low
            BEGDA           = '19000101'
            ENDDA           = '99991231'
          IMPORTING
            SUBRC           = SUBRC
          TABLES
            INFTY_TAB       = SELTAB
          EXCEPTIONS
            INFTY_NOT_FOUND = 1
            OTHERS          = 2.
        if subrc eq 0.
          write:/ so_inft1-low, 'has been maintained for employee: ', '40101017'.
        endif.
      endloop.

  • What is rp_provide_from_last

    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.

    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.

  • Proper use of rp_provide_from_last

    Hello Experts,
    I've used the macro rp_provide_from_last p0000 space pn-begda pn-endda
    pn-begda = 05.07.2010
    pn-endda = 05.07.2010
    I can't retrieve the last record with
    p0000-begda = 07.07.2010
    p0000-endda = 31.12.9999
    Instead I keep retrieving the second to the last record with
    p0000-begda = 01.09.2009
    p0000-endda = 06.07.2010
    What is the reason why I keep retrieving the second to the last record? Hope you can answer my query.
    Thanks in advance

    give
    pn-begda = 01.01.1800
    pn-endda = 31.12.9999
    With this specification you will always retrieve the latest record.
    In short the macro will give you the last record in the given dates i.e. last record between pn-begda and pn-endda.
    cheers
    AJ
    Edited by: Ajay  Hosur on Jul 16, 2010 7:02 AM

  • Use of RP_PROVIDE_FROM_LAST

    Hi experts ,
    I need to fatch the record base on PERNR  in RFC . as well i need fatch data from othere info type . but my requirement is i need last record .
    there is some thread to use RP_PROVIDE_FROM_LAST  , but i am not confident to how can use this .
    Please if any body have sample program please send me . so i can refeer the same .
    Regards
    Ajay Pandey

    GET PERNR.
      RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
        LOOP AT P0002.
        MOVE: P0002-VORNA TO GW_0002-VORNA,
              P0002-NACHN TO GW_0002-NACHN.
        MODIFY GT_0002 FROM GW_0002
        TRANSPORTING BEGDA WHERE PERNR = P0002-PERNR.
      ENDLOOP.
    I used this code but i not know how i will make this with my import parameters . and i am getting two records

  • Macro rp_provide_from_last is not working for ...

    Hi all,
          MAcro rp_provide_from_last in include DBPNPMAC is no working for the records
       PERNR     ENDDA       BEGDA             BSSAL
    00033987   12/30/2004 01/01/2004           60,000
    00033987   12/31/2004 01/01/2004           61,000
    00033987   12/31/2005 01/01/2005           64,000
    00033987   12/31/2005 01/01/2005           67,000
    Am using .
    rp_provide_from_last p9380 space pn-begda pn-endda .
    PN-BEGDA    01/01/2004         PN-ENDDA 12/16/2004
    I have to get bssal as 61,000 but am getting 60,000
    DEFINE rp_provide_from_last.
    $PNNNN$ = &1.
    $SUBTY$ = &2.
    $BEGDA$ = &3.
    $ENDDA$ = &4.
      pnp-sw-found = '0'.
      clear pnp-sy-tabix.
      loop at &1.
        if &2 <> space.
          check &1-subty = &2.
        endif.
        if &1-begda <= &4 and &1-endda >= &4.
          pnp-sw-found = '1'.
          exit.
        endif.
        if &1-begda <= &4 and &1-endda >= &3.
          pnp-sy-tabix = sy-tabix.
        endif.
      endloop.
      if pnp-sw-found = '0'.
        if pnp-sy-tabix <> 0.
          pnp-sw-found = '1'.
          read table &1 index pnp-sy-tabix.
        else.
          clear &1.
        endif.
      endif.
    END-OF-DEFINITION.
    cheers
    senthil
    Message was edited by: senthil bala

    You need to sort P9380 descending on ENDDA before doing RP-PROVIDE-FROM-LAST.
    SORT P9380 by ENDDA DESCENDING.

  • RP_PROVIDE_FROM_FRST & RP_PROVIDE_FROM_LAST

    Dear friends
    Coul any1 of u tel me th exact diff bet th macros RP_PROVIDE_FROM_FRST & RP_PROVIDE_FROM_LAST which r used for HR application.
    regards
    sakthi

    Hi Sakthi vel,
    Check the program.
    REPORT ztest1.
    TABLES: pernr.
    INFOTYPES: 0001.
    GET pernr.
      rp_provide_from_frst p0001 space pn-begda pn-endda.
      IF pnp-sw-found EQ '1'.
        WRITE: / pernr-pernr, p0001-stell, pn-begda, pn-endda.
      ELSE.
        REJECT.
      ENDIF.
    "After GET PERNR event p0001 internal table is filled up with 
    "data for one employee. If you have multiple records in the
    "internal table, If use rp_provide_from_frst macro along with
    "parameters dates , It gets the first record from the body of
    "the internal table and puts on the header of the internal table
    "in the given period pn-begda and pn-endda. It does not get
    "from database table.
    REPORT ztest1.
    TABLES: pernr.
    INFOTYPES: 0001.
    GET pernr.
      rp_provide_from_last p0001 space pn-begda pn-endda.
      IF pnp-sw-found EQ '1'.
        WRITE: / pernr-pernr, p0001-stell, pn-begda, pn-endda.
      ELSE.
        REJECT.
      ENDIF.
    "After GET PERNR event p0001 internal table is filled up with 
    "data for one employee. If you have multiple records in the
    "internal table, If use rp_provide_from_last macro along with
    "parameters dates , It gets the last record from the body of
    "the internal table and puts on the header of the internal table
    "in the given period pn-begda and pn-endda. It does not get
    "from database table.
    I hope that it helps u .
    Regards,
    Venkat.O

Maybe you are looking for

  • Can no longer connect to Extreme remotely

    Also therefore cannot connect to my usb hard drive. I am on dsl. It worked just fine for about 10 days, then could no longer see the Extreme (or usb drive) from a remote location. Unplugging the Extreme and plugging back in fixed the problem for a fe

  • I moved to overseas and bought a new Mac. Can I still log into my Australian Apple ID?

    So, I have a Macbook Air (13 inch, Mid 2011, Version 10.10.1 Yosemite). It's running out of space and kinda getting old. So I want to get a new Mac Mini because I can get hold of a cheap good quality screen, keyboard, and a mouse. The problem is that

  • Page Viewer to have links open a different page

    I have a custom HTML page i have created that has links to site pages. I have a page viewer web part on my home page that points to this custom HTML page. I want it so when you click on a link on this html page, it doesn't just take you to the page w

  • (urgent) SQL*Loader Large file support in O734

    hi there, i have the following sqlloader error when trying to upload data file(s), each has size 10G - 20G to Oracle 734 DB on SunOS 5.6 . >> SQL*Loader-500: Unable to open file (..... /tstt.dat) SVR4 Error: 79: Value too large for defined data type

  • Musicians please ver

    I just wanted to run a couple of issues past any XFi users who record using studio packages like Cakewalk. I had a fair bit of grief geting my home studio set up working correctly with the beta Vista driver and wondered if I'm correct in regard to th