Skip to Content
avatar image
Former Member

PROVIDE....ENDPROVIDE HR Data

How Do Everyone,

I have inherited a piece of code below which brings

back certain infotype information. Can anyone tell me

why the p0015 is bringing back everything regardless

of the selection dates. When specifying:

BETWEEN pc-begda AND pc-endda

I thought this would apply to all the infotypes in the PROVIDE statements.

Any ideas? Would be grateful for any suggestions.

Andy

PROVIDE vorna nachn pernr gesch gbdat FROM p0002

persk begda kostl werks btrtl FROM p0001

wostd empct FROM p0007

dat01 FROM p0041

subty FROM p0442

lgart FROM p0015

cttyp FROM p0016

disab racky FROM p0077

BETWEEN pc-begda AND pc-endda.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 12, 2006 at 09:59 AM

    Hi Andy,

    Provide and End provide , gives you all the records

    in the date range, thats why you are getting multiple

    records.

    If you want to get the latest record int he date range

    use the below statement.

    rp-provide-from-last p0015 space pn-begda pn-endda.

    Hope this will hlpe you.

    thanks&Regards,

    Siri.

    kindly award points if it is helpful.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Suresh Datti

      declare it in ur program as infotype section:

      infotyepes: pa0015 and use it as

      loop at p0015

      where endda ge pc-begda and begda le pc-

      endda

      .....

      endloop.

      reward points if it helps

      thx

      gunjan

  • avatar image
    Former Member
    May 12, 2006 at 09:56 AM

    HI Use this code example..

    plz reward poins if it helps you..

    &----


    & Report ZSAPHR_PNP

    *& *

    &----


    *& *

    *& *

    &----


    Report ZSAPHR_PNP.

    TABLES : PERNR.

    *Infotype Declaration

    INFOTYPES: 0002, "PERSONAL DATA

    0006, "ADDRESS

    0008, "

    0000, "

    0001. "ACTIONS

    DATA : BEGIN OF ITAB OCCURS 10, "INTERNAL TABLE DECLARATION

    NACHN LIKE P0002-NACHN,

    VORNA LIKE P0002-VORNA,

    GESCH LIKE P0002-GESCH,

    GBDAT LIKE P0002-GBDAT,

    FAMST LIKE P0002-FAMST,

    HSNMR LIKE P0006-HSNMR,

    STRAS LIKE P0006-STRAS,

    LOCAT LIKE P0006-LOCAT,

    PSTLZ LIKE P0006-PSTLZ,

    LAND1 LIKE P0006-LAND1,

    PLANS LIKE P0001-PLANS,

    ORGEH LIKE P0001-ORGEH,

    BET01 LIKE P0008-BET01,

    WAERS LIKE P0008-WAERS,

    PERNR LIKE P0000-PERNR,

    END OF ITAB.

    DATA: G_REPID LIKE SY-REPID."Report name

    INITIALIZATION.

    G_REPID = SY-REPID.

    PNPTIMED = 'D'.

    **********************************************START OF

    SELECTION*****************************************

    START-OF-SELECTION.

    GET PERNR.

    PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.

    ITAB-PERNR = P0000-PERNR.

    ITAB-NACHN = P0002-NACHN.

    ITAB-VORNA = P0002-VORNA.

    IF P0002-FAMST = '0'.

    ITAB-FAMST = 'S'.

    ELSE.

    ITAB-FAMST = 'M'.

    ENDIF.

    ITAB-FAMST = P0002-FAMST.

    IF P0002-GESCH = '1'.

    ITAB-GESCH = 'M'.

    ELSE.

    ITAB-GESCH = 'F'.

    ENDIF.

    ITAB-GBDAT = P0002-GBDAT.

    ITAB-HSNMR = P0006-HSNMR.

    ITAB-STRAS = P0006-STRAS.

    ITAB-LOCAT = P0006-LOCAT.

    ITAB-PSTLZ = P0006-PSTLZ.

    ITAB-LAND1 = P0006-LAND1.

    ITAB-ORGEH = P0001-ORGEH.

    ITAB-PLANS = P0001-PLANS.

    ITAB-BET01 = P0008-BET01.

    ITAB-WAERS = P0008-WAERS.

    APPEND ITAB.

    ENDPROVIDE.

    END-OF-SELECTION.

    Add comment
    10|10000 characters needed characters exceeded