PROVIDE...ENDPROVIDE

Hi everybody,
I am new to SAP-HR so kindly pardon me for asking such a simple question.
My code is as follows:
PROVIDE * FROM p0006
    BETWEEN pn-begda AND pn-endda
    WHERE p0006-subty = '1'.
ENDPROVIDE.
When I give the time period as up to today, I get the data starting from the oldest to the latest(I display inside the loop) which is obvious. However, is there a way that I can get the data from the most recent time to the oldest? Or will I just have to write a separate logic for sorting and then display?
Regards,
Alpana.

>
Alpana Savarna wrote:
Or will I just have to write a separate logic for sorting and then display?
> Alpana.
Yes.. P0006 is nothing but an itab.You can sort it descneding by begda & loop at it,just like do on any other itab. Get rid of the provide loop.
~Suresh

Similar Messages

  • PROVIDE - ENDPROVIDE in HR ABAP

    Hi All,
    I am trying to understand how the PROVIDE - ENDPROVIDE statement in HR ABAP works.
    I have gone through many of the links discussion on this but is not very clear.
    Can you please correct my understanding if it.
    I was under impression that the provide statement in the below report ZTEST gets exectuted like the following LOOP ENDLOOP statement which is not correct. Can you please help me understand how it processes the provide statement and how different is the PROVIDE statement from the LOOP ENDLOOP statement.
        loop at p0002 where begda <= pn-begda
                            and endda >= pn-endda.
          WRITE: / p0002-pernr.
        endloop.
    REPORT ZTEST.
    TABLES: pernr.
    INFOTYPES: 0002. "Personal Data
    SELECT-OPTIONS: language FOR p0002-sprsl.
    **-- Selection screen
    INITIALIZATION.
    pnptimed = 'D'.
    *-- Processing
    START-OF-SELECTION.
    GET pernr.
    PROVIDE * FROM p0002 BETWEEN pn-begda AND
    pn-endda.
    CHECK language.
    WRITE: / p0002-pernr,
    sy-vline,
    pernr-ename,
    sy-vline,
    p0002-sprsl,
    sy-vline,
    p0002-gbdat.
    ENDPROVIDE.
    Regards,
    Sanjay.

    Look at this documentation [Report Programming in HR|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PYINT_PROGRAMM.pdf]
    Processing All Infotype Records (PA-PAD)
    After the GET PERNR event, the internal tables of the infotypes contain records and are ready for processing.
    Internal tables are generally processed line-by-line using the LOOP statement.
    The internal tables of infotypes have features which allow special processing.
    These tables are defined for specific intervals. In HR, these are time intervals or validity periods.
    Processing of infotype records is time-dependent; by this we mean dependent on the data selection period entered on the selection screen. The data of several infotypes can be processed
    at the same time and made available for a specific partial period.
    Internal infotype tables are processed with the PROVIDE statement.
    The syntax is as follows:
    PROVIDE * FROM Pnnnn BETWEEN PN-BEGDA AND PN-ENDDA.
    WRITE: / Pnnnn-<field>.
    ENDPROVIDE.
    nnnn stands for the four-digit infotype number. The relationship between the infotype and the data selection period of the selection screen is established using the PN/BEGDA and PN/ENDDA variables.
    In the PROVIDE loop, the data of an infotype record is available for processing in the Pnnnn
    structure.
    Regards

  • Provide - Endprovide with SD n MM modules

    Hi experts can any one tell me im learning ABAP-HR, in this im working with LDB, i have a doubt that can't we use Provide - Endprovide of LDB with SD and MM Modules .

    Hi Madhu,
      Please find the below program which displays the available user exits for the specified transaction code. Just you need to specify the transaction code it will display all the user exits of the transaction.
    Use the following link for the above from ****************
    http://****************/Tutorials/ExitsBADIs/FindUserExitswithTCode.htm
    You can also find some scenarios in **************** for the user exits and Badis.
    Explore the **************** site.
    Thanks,
    Naveen Kumar.

  • Is PROVIDE-ENDPROVIDE statement obsolete ? Can I use it from now onwards?

    Hello Techies..
    I am working on HR ABAP, I have used PNP LDB extensively.
    I came to know from SAP help that Provide-Endprovide statement has been obsolete in newer version of
    SAP. I am aware that it is obsolete in ABAP OO context. But does that mean - we should not use provide - endprovide in our report(type 1 program).
    I would be glad if you can focus some light on this point.
    My second doubt:
    I am using PNP LDB, can I replace PNP by PNPCE (since PNP is replaced by PNPCE in newer version).
    If I do so my existing functionality will be affected.
    Can you give me a brief of added features of PNPCE?
    Points will be rewarded to satisfying answer !!
    Regards,
    Mihir.

    >
    Mihir Nagar wrote:
    > I came to know from SAP help that Provide-Endprovide statement has been obsolete in newer version of SAP. I am aware that it is obsolete in ABAP OO context.  
    > Mihir.
    Hello Mihir,
    That is not correct. The syntax for PROVIDE statement has changed in the newer version as a result the old syntax has been declared obsolete by SAP but that is not to say that the PROVIDE statement itself has become obsolete, if I understand you correctly.
    Here's the (old) syntax which has become obsolete:
    PROVIDE {*|{comp1 comp2 ...}} FROM itab1
            {*|{comp1 comp2 ...}} FROM itab2
            BETWEEN extliml AND extlimu.
    And here's the (new) syntax for the same PROVIDE statement which you should use in the newer SAP releases:
    PROVIDE FIELDS {*|{comp1 comp2 ...}}
                   FROM itab1 INTO wa1 VALID flag1
                   BOUNDS intliml1 AND intlimu1
                   [WHERE log_exp1]
            FIELDS {*|{comp1 comp2 ...}}
                   FROM itab2 INTO wa2 VALID flag2
                   BOUNDS intliml2 AND intlimu2
                   [WHERE log_exp2]
            BETWEEN extliml AND extlimu
            [INCLUDING GAPS].
    ENDPROVIDE.
    Note the changes in the syntax. The new syntax can be used to evaluate and process records in an internal table the same way you used to with the old syntax depending on the options you are using from the new syntax. In summary, the new syntax is able to do exactly the same processing as the old but only difference in the new syntax is that the introduction of additional keywords like FIELDS, VALID and BOUNDS. You'll also notice that the new syntax requires a single workarea to read the record in the provide-endprovide loop unlike the old syntax where it did not require an explicit workarea.
    >
    Mihir Nagar wrote:
    > My second doubt:
    > I am using PNP LDB, can I replace PNP by PNPCE (since PNP is replaced by PNPCE in newer version). If I do so my
    > existing functionality will be affected. Can you give me a brief
    > of added features of PNPCE?
    > Mihir.
    It only makes sense to use PNPCE if your comany uses the SAP functionality of Concurrent Employment (CE) in HR - i.e. this feature is turned on (active) via the IMG. If CE is not active there's no problem continuing to use PNP as this is not declared obsolete or anything like that but SAP recommends that all new developments should use LDB PNPCE - I understand existing developements should be fine (as long they don't have to handle CE scenarios).
    So let me know if CE is active and you need to replace all PNP reports with PNPCE and I'll be happy to send you an overview with code snippets etc.
    Hope this helps and please don't forget to reward points.
    Cheers,
    Sougata.

  • Difference between Provide - Endprovide.

    Hi experts can any one spot light on the significance of PROVIDE - ENDPROVIDE in LDB?  and what is the difference between LOOP - ENDLOOP and
    PROVIDE - ENDPROVIDE.
    Thanks in advance.
    vamsi.

    Hi
    You can go through help doc .
    PROVIDE - ENDPROVIDE is similar like Loop
    LOOP - ENDLOOP
    [<b>b]Reminder : Points should be given on answers.</b></b>

  • Significance of Provide - endprovide in LDB

    Hi experts can any one spot light on the significance of PROVIDE - ENDPROVIDE in LDB?  and what is the difference between LOOP - ENDLOOP and
    PROVIDE - ENDPROVIDE.
    Thanks in advance.
    vamsi.

    1) Provide :
    Its used to FETCH data from INTERNAL TABLE.
    Its also used in logical databases like pnp,
    where the actual data is retrived by
    the logical database itself,
    and our provide statement, JUST,
    fetches from the internal table in ldb program.
    2) Retrieves the contents of the specified fields from the internal tables and places them in the table header lines within the required range.
    Provide is similar to outer join of tables.
    3) Provide:
    PROVIDE f1 f2 ... FROM itab1
    g1 g2 ... FROM itab2
    FROM itabi
    BETWEEN f AND g.

  • Macros versus provide -endprovide

    Why do we use MACRO instead of provide- endprovide in HR sometimes ?
    Is it that we have to use macro when we are using logical database for reporting of PD under HR.

    I cannot tell in terms of HR but in a general sense, PROVIDE will work only with internal tables. It is a kind of outer join concept as it relates to database tables.
    MACRO is just a name given to an executable piece of code. So I can define a macro GET_ME_SUM_OF that adds two numbers and puts it into a variable as follows.
    DEFINE GET_ME_SUM_OF.
      &3 = &1 + &2.
    END-OF-DEFINITION.
    Now in my program I can simply write get_me_sum_of 1 2 v_sum, which will get me the sum of 1 and 2 and puts 3 into the variable v_sum.
    Srinivas

  • Regarding Provide endprovide

    Hi,
    I am using PNP ldb as we know that we will get a standard selection screen by using pnp and I have to add 4 extra fields to the existing selection screen then  I have created by using select-options in the program.
    Now my question is .. Can we skip the standard selection screen .
    I hope u got.
    Regards
    Anil

    Hi
    PROVIDE
    PROVIDE FIELDS {*|{comp1 comp2 ...}}
                   FROM itab1 INTO wa1 VALID flag1
                   BOUNDS intliml1 AND intlimu1
                   [WHERE log_exp1]
                 FIELDS {*|{comp1 comp2 ...}}
                   FROM itab2 INTO wa2 VALID flag2
                   BOUNDS intliml2 AND intlimu2
                   [WHERE log_exp2]
            BETWEEN extliml AND extlimu
            [INCLUDING GAPS].
    ENDPROVIDE.
    The statements PROVIDE and ENDPROVIDE define a loop through a statement block. In this loop, any number of internal tables itab1 itab2 ... are processed together. A single table can appear several times. For every table itab you must specify a FIELDS clause. After FIELDS you must specify the character * for all components or a list comp1 comp2 ... for specific components of the relevant table. The names of the components comp1 comp2 ... can only be specified directly.
    To be able to process internal tables using PROVIDE, all tables itab1 itab2 ... must be fully typed index tables and contain two special columns that have the same data type (d, i, n, or t) for all relevant tables. For every table you must specify the names intliml1 intliml2 ... and intlimu1 intlimu2 ... of these columns using the addition BOUNDS.
    The columns intliml1 intliml2 ... and intlimu1 intlimu2 ... in every row of the relevant internal tables must contain values that can be interpreted as limits of closed intervals. Within a table, the intervals specified in these columns must not overlap and must be sorted in ascending order. The intervals therefore make up a unique key for every row.
    For every table you must specify a work area wa1 wa2 ... compatible with the row type and a variable flag1 flag2 ..., for which a character-type data type with length 1 is expected. In the PROVIDE loop, the components specified after FIELDS are filled with values in the relevant work areas wa1 wa2 ... for every specified internal table. The variables flag1 flag2 ... are also filled. A work area wa1 wa2 ... or a variable flag1 flag2 ... cannot be specified more than once.
    With the BETWEEN addition you must specify an interval extliml, extlimu. It must be possible to convert the data objects extliml and extlimu into the data types of the respective columns intliml1 intliml2 ... and intlimu1 intlimu2 ... of the individual tables.
    The interval limits intliml1 intliml2 ... and intlimu1 intlim2 for every row of all relevant internal tables itab1 itab2 ... that are within the closed interval made up by extliml and extlimu divide the latter into new intervals and every interval limit closes one interval in the original direction. If, within a relevant table, a lower interval limit follows an upper interval limit with no space or gap between them and the components of the corresponding rows specified after FIELDS have the same content, the two intervals are combined and the corresponding interval limits intliml1 intliml2 ... and intlimu1 intlimu2 ... are ignored for the new intervals.
    For every interval that is created in such a way and overlaps with at least one of the intervals of a table involved, the PROVIDE loop is passed once. The components of every work area wa1 wa2 ... specified after FIELDS and the variables flag1 flag2 ... are filled with values as follows:
    The components intliml1 intliml2 ... and intlimu1 intlimu2 ... of every work area wa1 wa2 ... are filled with the interval limits of the current interval.
    If the current interval overlaps with one of the intervals of an involved table, the remaining components of the corresponding work area are assigned the contents of the relevant components of this table row and the variable flag1 flag2 ... is set to the value "X". Otherwise, the work area components and the variables flag1 flag2 ... are set to their Initial value.
    Except for intliml1 intliml2 ... and intlimu1 intlimu2 ..., the components not specified after FIELDS are always set to their initial value. The components intliml1 intliml2 ... and intlimu1 intlimu2 ... are always assigned.
    The ABAP runtime environment checks for every table involved, whether the condition of sorted and non-overlapping intervals is met within the interval made up by extliml and extlimu and, if necessary, triggers an exception that can be handled.
    If the INCLUDING GAPS addition is specified, the system passes the PROVIDE loop for every interval, that is also when the current interval does not overlap with at least one of the intervals of an involved table. In the latter case, the variable flag is of initial value for every relevant table.
    You can use the WHERE addition to specify a condition for every table itab1 itab2 ... involved. After WHERE, you can specify any logical expression log_exp1 log_exp2 ... ; the first operand of every comparison must be a component of the internal table. As such, all logical expressions except for IS ASSIGNED, IS REQUESTED, and IS SUPPLIED are possible. You can only specify components that are in the list after FIELDS. Here it is not possible to specify a component using character-type data objects in brackets. The table entries for which the condition is not met are ignored by the PROVIDE loop. You can leave the PROVIDE loop following the instructions in the section Leaving loops.
    <b>System fields</b>
    The system fields sy-subrc and sy-tabix are set to the value 0 before every loop pass and at ENDPROVIDE. Only if the loop is not passed once, is sy-subrc set to 4 at ENDPROVIDE.
    The relevant internal tables should not be modified in the PROVIDE loop.
    The WHERE condition can be used to remove overlaps between the tables involved or to ensure the sorting of the intervals.
    In two tables itab1 and itab2, the respective columns col1 and col2 are interval limits of type i. The filling of the internal tables results in the following intervals (rows two and three):
    The interval specified in the BETWEEN addition to the PROVIDE statement is shown in the fourth row. It serves as a basis for the five intervals in the fifth row represented by i1 to i5. These can be processed in the PROVIDE loop.
    Because each of the five intervals overlaps with one of the intervals from rows two and three, the PROVIDE loop is passed five times.
    Only the component col3 of wa1 is filled in the first pass, only the component col3 of wa2 in the third pass, and the components col3 of both work areas in the second and fourth passes. The fields valid1 and valid2 are set accordingly.
    DATA: BEGIN OF wa1,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa1.
    DATA: BEGIN OF wa2,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa2.
    DATA: itab1 LIKE STANDARD TABLE OF wa1,
          itab2 LIKE STANDARD TABLE OF wa2.
    DATA: flag1(1) TYPE c,
          flag2(1) TYPE c.
    wa1-col1 = 1.
    wa1-col2 = 6.
    wa1-col3 = 'Itab1 Int1'.
    APPEND wa1 TO itab1.
    wa1-col1 = 9.
    wa1-col2 = 12.
    wa1-col3 = 'Itab1 Int2'.
    APPEND wa1 TO itab1.
    wa2-col1 = 4.
    wa2-col2 = 11.
    wa2-col3 = 'Itab2 Int1'.
    PROVIDE FIELDS col3 FROM itab1 INTO wa1
                                   VALID flag1
                                   BOUNDS col1 AND col2
            FIELDS col3 FROM itab2 INTO wa2
                                   VALID flag2
                                   BOUNDS col1 AND col2
            BETWEEN 2 AND 14.
      WRITE: / wa1-col1, wa1-col2, wa1-col3, flag1.
      WRITE: / wa2-col1, wa2-col2, wa2-col3, flag2.
      SKIP.
    ENDPROVIDE.
    The list output is as follows:
       2           3  Itab1 Int1 X
       2           3
       4           6  Itab1 Int1 X
       4           6  Itab2 Int1 X
       7           8
       7           8  Itab2 Int1 X
       9          11  Itab1 Int2 X
       9          11  Itab2 Int1 X
      12          12  Itab1 Int2 X
      12          12
    <b>REWARD IF USEFULL</b>

  • Using Provide-endprovide copy internal table

    Hi,
    I have problem that is if i want to copy the data from infotype to internal table means
    Provide * from p9012 between  pn-begda  and  pn-endda.
    if p9012-zz_client_c EQ itemp-z_client_c.
    MOVE: p9012-begda TO it9012-begda,
               p9012-zz_dept_c TO it9012-z_dept_c,
               SORT IT9012 BY z_dept_c.
               append it9012.
    endif.
    endprovide.
    this one not copying data from infotype to internaltable.
    what i can do?
    Thanks,
    Regards,
    Nandha

    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.

  • Provide, endprovide and protect

    what is the difference between provide..endprovide and  protect...endprotect statements
    Title edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:51 AM

    Hi Sudheer,
    Processing All Infotype Records (PA-PAD)
    After the GET PERNR event, the internal tables of the infotypes contain records and are ready for processing.
    Internal tables are generally processed line-by-line using the LOOP statement.
    The internal tables of infotypes have features which allow special processing.
    These tables are defined for specific intervals. In HR, these are time intervals or validity periods.
    Processing of infotype records is time-dependent; by this we mean dependent on the data selection period entered on the selection screen. The data of several infotypes can be processed
    at the same time and made available for a specific partial period.
    Internal infotype tables are processed with the PROVIDE statement.
    The syntax is as follows:
    PROVIDE * FROM Pnnnn BETWEEN PN-BEGDA AND PN-ENDDA.
    WRITE: / Pnnnn-<field>.
    ENDPROVIDE.
    nnnn stands for the four-digit infotype number. The relationship between the infotype and the data selection period of the selection screen is established using the PN/BEGDA and PN/ENDDA variables.
    In the PROVIDE loop, the data of an infotype record is available for processing in the Pnnnn
    structure.
    Preventing Page Breaks: PROTECT
    You can specify, either in the style or in the form, that a particular paragraph should not be split in two by a page break. If this page protect attribute is set, then the complete paragraph is always printed on one page. This property applies only to that particular paragraph.
    This attribute is not intended to be used to protect all paragraphs against a page break. The point is that a page break is by its very nature a dynamic event and the exact point at which it occurs depends on the current state (length and contents) of the preceding text. It is also possible that you may want to protect only certain parts of a paragraph against a page break. One way to achieve this is to use the NEW-PAGE command immediately before the text concerned starts. Explicitly beginning a new page at this point should ensure that a further page break does not occur within the text. However, this technique is not change-friendly. For example, you format your text with the help of the NEW-PAGE command so that no page breaks occur where they should not. At a later time, you insert or delete some lines. These changes cause all the subsequent text to be moved relative to the printed page, and you must check each NEW-PAGE command you previously inserted to see if it is still in the correct place.
    To allow you to define the areas to be protected against a page break on an individual basis, SAPscript provides the PROTECT.. ENDPROTECT command pair. If you enclose the text to be protected in these commands, then SAPscript will ensure that each line of this text is printed together on the same page. If the complete text fits in the space remaining on the current page, then it is printed on this page just as it would be if no PROTECT command had been used. If, however, the remaining space is not sufficient for the text, then the PROTECT command has the same effect as a NEW-PAGE command and text is printed on a new page.
    Thus the PROTECT/ENDPROTECT commands may be regarded as a kind of conditional NEW-PAGE command, the condition being whether or not the lines enclosed between the two commands fit in the space remaining in the current main window.
    Syntax:
    /: PROTECT
    /: ENDPROTECT
    The text lines to be protected are enclosed between the two commands.
    o     An ENDPROTECT command without a preceding PROTECT command has no effect.
    o     If the terminating ENDPROTECT is missing, SAPscript assumes it at the end of the text.
    o     PROTECT.. ENDPROTECT command pairs cannot be nested. If a second PROTECT command occurs before the first one has been terminated by an ENDPROTECT, it is ignored.
    o     If the text enclosed by a PROTECT.. ENDPROTECT pair is itself too long for a single page, then a page break is generated immediately before the text and the text is printed in the normal way. It is then unavoidable that a page break will occur at some point within the text.
    <REMOVED BY MODERATOR>
    Regards,
    Nitin.
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:51 AM

  • RP_PROVIDE_FROM_LAST AND PROVIDE AND ENDPROVIDE

    hi all,
        When to use RP_PROVIDE_FROM_LAST and Provide and EndProvide?
    which scenario we go for RP_PROVIDE_FROM_LAST and Provide?
    both will do the same purpose?
      RP_PROVIDE_FROM_LAST  will read recent records.
      Provide will read sequentially data.
    other than this...difference
        can anyone clear my doubt?

    Hi,
    For PROVIDE-ENDPROVIDE : 
    1) You can fetch individual fields of the infotypes.
    2) You can also use the JOIN and PROJECTION of infotypes. Based on the criteria, datas can be fetched from two or more infotypes.
    3) It is similar to the SELECT STATEMENT of normal ABAP.
    4) You can do processing within the Block of PROVIDE -  ENDPROVIDE
    For RP_PROVIDE_FROM_LAST:
    1) You fetch only the recent record of the Infotype.
    2) This is a MACRO delivered by SAP and not a statement. You can also create something similar to this.
    Regards,
    Anirban

  • PROVIDE END PROVIDE

    Dear All,
    I have written a program for using Logical Database PNP displaying employee data which are fetched from different infotypes. I have used PROVIDE END PROVIDE Statement. In the Report it is found that it is Printing PN-BEGDA and PN-ENDDA value for P0001-BEGDA and P0001-ENDDA when User selects following values in Selection Screen.
    1) Today
    2) Current Month
    3) Current Year
    4) Up to Today
    5) From Today
    if require I will send the code.
    Thanks in Advance
    Regards
    Mangesh

    Hi Mangesha,
    <li>PROVIDE-ENDPROVIDE is like LOOP-ENDLOOP but It creates partial periods.
    Lets say we have two records for one employee in itab p0001.We give dates on selection-screen 01.06.2008 to 01.06.2009.
    Lets say p0000 has two records
    1).. 01.01.2008 to 31.12.2009 -first record
    2).. 01.01.2009 to 31.12.2009 -second record
    If use PROVIDE statement to loop the p0000 table, It is looped two times. But if you see P000-BEGDA and P0000-ENDDA inside PROVIDE-ENDPROVIDE, the records are like below.
    p0000-begda -- p0000-endda
    01.06.2008  --  31.12.2009
    01.01.2009  --  01.06.2009.
    <li>It can be used to join tables more tables
    Thanks
    Venkat.O

  • Provide ABAP statement

    Hello All,
    Can someone please tell me how does a PROVIDE statement work? How does it help retrieve data from multiple infotypes?
    Thanks.
    Regards,
    KP

    PROVIDE
    Variants:
    1. PROVIDE { FIELDS {*|{compi}}
                  FROM itabj INTO waj VALID flagj
                  BOUNDS intlim1j AND intlim2j
                  [WHERE log_expj] }
              BETWEEN extlim1 AND extlim2
              [INCLUDING GAPS].
    2. PROVIDE { {*|{compi}}
                  FROM itabj }
              BETWEEN extlim1 AND extlim2.
    Effect
    Special join for internal tables. Variant 1 is the universally applicable form of the PROVIDE statement. Variant 2 is a short form of variant 1 that is not permitted in ABAP Objects.
    Variant 1
    PROVIDE { FIELDS {*|{compi}}
                FROM itabj INTO waj VALID flagj
                BOUNDS intlim1j AND intlim2j
                [WHERE log_expj] }
            BETWEEN extlim1 AND extlim2
            [INCLUDING GAPS].
    Effect
    The statements PROVIDE and ENDPROVIDE define a loop through a statement block. In this loop, any number of internal tables itabj are processed together. A single table can appear several times. For every table itabj you must specify a FIELDS clause. After FIELDS you must specify the character * for all components or a list compi for specific components of the relevant table. The names of the components compi can only be specified directly.
    To be able to process internal tables using PROVIDE, all tables itabj must be fully typed index tables and contain two special columns that have the same data type (d, i, n, or t) for all relevant tables. For every table you must specify the names intlim1 and intlim2 of these columns using the BOUNDS addition.
    The columns intlim1 and intlim2 in every row of the relevant internal tables must contain values that can be interpreted as limits of closed intervals. Within a table, the intervals specified in these columns must not overlap and must be sorted in ascending order. The intervals therefore make up a unique key for every row.
    For every table you must specify a work area waj compatible with the row type and a variable flagj, for which a character-type data type with length 1 is expected. In the PROVIDE loop, the components specified after FIELDS are filled with values in the relevant work areas waj for every specified internal table. The variable flagj is also filled. A single work area waj or variable flagj cannot be specified more than once.
    With the BETWEEN addition you must specify an interval extlim1, extlim2. It must be possible to convert the data objects extlim1 and extlim2 into the data types of the respective columns intlim1 and intlim2 of the individual tables.
    The interval limits intlim1j and intlim2j for every row of all relevant internal tables itabj that are within the closed interval made up by extlim1 and extlim2 divide the latter into new intervals and every interval limit closes one interval in the original direction. If, within a relevant table, a lower interval limit follows an upper interval limit with no space or gap between them and the components of the corresponding rows specified after FIELDS have the same content, the two interval limits are combined and the corresponding interval limits intlim2j and intlim1j are ignored for the new intervals.
    For every interval that is created in such a way and overlaps with at least one of the intervals of a table involved, the PROVIDE loop is passed once. The components of every work area waj specified after FIELDS and the variable flagj are filled with values as follows:
    The components intlim1 and intlim2 of every work area waj are filled with the interval limits of the current interval.
    If the current interval overlaps with one of the intervals of an involved table, the remaining components of the corresponding work area are assigned the contents of the relevant components of this table row and the variable flagj is set to the value "X". Otherwise, the work area components and the variable flagj are set to their initial value.
    Except for intlim1j and intlim2j, the components not specified after FIELDS are always set to their initial value. The components intlim1j and intlim2j are always assigned.
    The ABAP runtime environment checks for every table involved, whether the condition of sorted and non-overlapping intervals is met within the interval made up by extlim1 and extlim2 and, if necessary, triggers an exception that can be handled.
    If the INCLUDING GAPS addition is specified, the system passes the PROVIDE loop for every interval, that is also when the current interval does not overlap with at least one of the intervals of an involved table. In the latter case, the variable flagj is of initial value for every relevant table.
    You can use the WHERE addition to specify a condition for every table involved. After WHERE, you can specify any logical expression log_exp; the first operand of every comparison must be a component of the relevant table. Here it is not possible to specify a component using character-type data objects in brackets. The table entries, for which the condition is not met are ignored by the PROVIDE loop.
    Notes
    The system fields sy-subrc and sy-tabix are set to the value 0 before every loop pass and at ENDPROVIDE. Only if the loop is not passed once, is sy-subrc set to 4 at ENDPROVIDE.
    The relevant internal tables should not be modified in the PROVIDE loop.
    The WHERE condition can be used to remove overlaps between the tables involved or ensure the sorting of the intervals.
    Example
    DATA: BEGIN OF wa1,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa1.
    DATA: BEGIN OF wa2,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF wa2.
    DATA: itab1 LIKE STANDARD TABLE OF wa1,
          itab2 LIKE STANDARD TABLE OF wa2.
    DATA: flag1(1) TYPE c,
          flag2(1) TYPE c.
    wa1-col1 = 1.
    wa1-col2 = 6.
    wa1-col3 = 'Itab1 Int1'.
    APPEND wa1 TO itab1.
    wa1-col1 = 9.
    wa1-col2 = 12.
    wa1-col3 = 'Itab1 Int2'.
    APPEND wa1 TO itab1.
    wa2-col1 = 4.
    wa2-col2 = 11.
    wa2-col3 = 'Itab2 Int1'.
    APPEND wa2 TO itab2.
    PROVIDE FIELDS col3
              FROM itab1
              INTO wa1
              VALID flag1
              BOUNDS col1 AND col2
            FIELDS col3
               FROM itab2
               INTO wa2
               VALID flag2
               BOUNDS col1 AND col2
            BETWEEN 2 AND 14.
      WRITE: / wa1-col1, wa1-col2, wa1-col3, flag1.
      WRITE: / wa2-col1, wa2-col2, wa2-col3, flag2.
      SKIP.
    ENDPROVIDE.
    In two tables itab1 and itab2, the respective columns col1 and col2 are interval limits of type i. The filling of the internal tables results in the following intervals (rows two and three):
    |01|02|03|04|05|06|07|08|09|10|11|12|13|14|
    |   Itab1 Int1    |     |Itab1 Int2 |     |
    |        |      Itab2 Int1       |        |
    |  |          ... BETWEEN ...             |
    |  | i1  |   i2   | i3  |   i4   |i5|     |
    The interval specified in the AB>BETWEEN addition to the PROVIDE statement is shown in the fourth row. It serves as a basis for the five intervals in the fifth row represented by i1 to i5. These can be processed in the PROVIDE loop.
    Because each of the five intervals overlaps with one of the intervals from rows two and three, the PROVIDE loop is passed five times.
    Only the component col3 of wa1 is filled in the first pass, only the component col3 of wa2 in the third pass, and the components col3 of both work areas in the second and fourth passes. The fields valid1 and valid2 are set accordingly.
    The list is displayed as follows:
    2           3  Itab1 Int1 X
    2           3
    4           6  Itab1 Int1 X
    4           6  Itab2 Int1 X
    7           8
    7           8  Itab2 Int1 X
    9          11  Itab1 Int2 X
    9          11  Itab2 Int1 X
    12          12  Itab1 Int2 X
    12          12
    Exceptions
    Catchable Exceptions
    CX_SY_PROVIDE_INTERVAL_OVERLAP
    Cause: In one of the tables involved, there are overlapping intervals within extlim1 and extlim2.
    Runtime Error: UNCAUGHT_EXCEPTION
    CX_SY_PROVIDE_TABLE_NOT_SORTED
    Cause: One of the involved tables is not sorted in ascending order by the intervals within extlim1 and extlim2.
    Runtime Error: UNCAUGHT_EXCEPTION
    Variant 2
    PROVIDE { {*|{compi}}
                  FROM itabj }
              BETWEEN extlim1 AND extlim2.
    This statement is not allowed in an ABAP Objects context. See Cannot Use Short Form of PROVIDE.
    Effect
    This form of the PROVIDE statement is a short form of variant 1. The compiler distinguishes the long and short forms by language elements FIELDS to be specified explicitly before the component specifications.
    In principle, the short form of the PROVIDE statement works like variant 1. Unlike variant 1 however, fewer additions are allowed here. In the short form, you cannot specify a table several times The internal tables must have headers and the additions that have to be specified in the long form are added by the runtime environment, as described below.
    For the PROVIDE loop to function correctly, the same conditions apply as in the long form. However, now exceptions are raised if one of the involved tables is not sorted or there are overlapping intervals.
    Interval limits BOUNDS
    The columns for interval limits to be specified in the long form as intlim1 and intlim2 using BOUNDS are attributes of the relevant tables in the short form and must be specified when they are declared.
    This is done using the VALID BETWEEN addition that can be specified after DATA END OF if an internal table is declared with obsolete OCCURS addition to the DATA BEGIN OF statement. If an internal table is declared using the INFOTYPES statement, these are the BEGDA and ENDDA columns. If no columns are specified for the interval limits in the declaration, the short form of PROVIDE uses the first two columns of the internal table.
    Work area INTO
    In the short form, the headers of the internal table are implicitly used for the work areas that have to be specified as wa in the long form using the AB>INTO addition.
    VALID flag
    The data objects that have to be specified as flag in the long form using the VALID addition are added in the short form by the system implicitly creating a data object itab_valid of type c and length 1 for every table itab.
    WHERE condition
    No conditions can be specified in the short form.
    INCLUDING GAPS addition
    In the short form, you cannot force the system to pass the PROVIDE loop for every interval.
    Notes
    The short form of the PROVIDE statement is especially useful with internal tables declared using INFOTYPES, or internal tables that have the structure of infotypes.
    The system fields sy-tabix and sy-subrc are not filled by the short form for PROVIDE - ENDPROVIDE.
    Example
    DATA: BEGIN OF itab1 OCCURS 0,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF itab1 VALID BETWEEN col1 AND col2.
    DATA: BEGIN OF itab2 OCCURS 0,
            col1 TYPE i,
            col2 TYPE i,
            col3 TYPE string,
          END OF itab2 VALID BETWEEN col1 AND col2.
    itab1-col1 = 1.
    itab1-col2 = 6.
    itab1-col3 = 'Itab1 Int1'.
    APPEND itab1 TO itab1.
    itab1-col1 = 9.
    itab1-col2 = 12.
    itab1-col3 = 'Itab1 Int2'.
    APPEND itab1 TO itab1.
    itab2-col1 = 4.
    itab2-col2 = 11.
    itab2-col3 = 'Itab2 Int1'.
    APPEND itab2 TO itab2.
    PROVIDE col3 FROM itab1
            col3 FROM itab2
                 BETWEEN 2 AND 14.
      WRITE: / itab1-col1, itab1-col2, itab1-col3, itab1_valid.
      WRITE: / itab2-col1, itab2-col2, itab2-col3, itab2_valid.
      SKIP.
    ENDPROVIDE.
    The example has the same result as the example for variant 1. Here, the tables itab1 and itab2 have headers and the columns col1 and col2 are defined as interval limits of type i using the VALID addition to the DATA END OF statement.
    awrd points if useful
    Bhupal

  • Re-write provide statement with loop

    Hello,
    I am a bit confused how to rewrite a provide statement but with loop instead.
    For example, how would the following code be written with 'loop at':
    PROVIDE * FROM P0001
              FROM P0016 BETWEEN '20020401' AND '20061001'
    ENDPROVIDE
    Thanks for your help.

    Data Retrieval from LDB
    1. Create data structures for infotypes.
    INFOTYPES: 0001, "ORG ASSIGNMENT
    0002, "PERSONAL DATA
    0008. "BASIC PAY
    2. Fill data structures with the infotype records.
    Start-of-selection.
    GET PERNR.
    End-0f-selection.
    Read Master Data
    Infotype structures (after GET PERNR) are internal tables loaded with data.
    The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
    GET PERNR.
    PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
    If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif.
    ENDPROVIDE.
    Period-Related Data
    All infotype records are time stamped.
    IT0006 (Address infotype)
    01/01/1990 12/31/9999 present
    Which record to be read depends on the date selection period specified on the
    selection screen. PN/BEGDA PN/ENDDA.
    Current Data
    IT0006 Address - 01/01/1990 12/31/9999 present
    RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.
    For example, pn/begda = '19990931' pn/endda = '99991231'
    IT0006 subtype 1 is resident address
    RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
    hope it will be of help to u.

  • HR Logical database PNP. OO to fill table dynamic table  from PNP  ?

    Hi all
    I want to get some stuff from the HR logical database into a dynamic table
    Here's a real simple example that writes info out to a normal list.
    (report is based on using Logical DB PNP)
    tables: pernr.
    INFOTYPES: 0001,                     "Organizational Assignment
               0002.                     "Personal Data
    SELECT-OPTIONS: language FOR p0002-sprsl.
    INITIALIZATION.
      pnptimed = 'D'.
    GET pernr.
      PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda.
        CHECK language.
        WRITE: / p0002-pernr,
                 sy-vline,
                 p0001-ename,
                 sy-vline,
                 p0002-sprsl,
                 sy-vline,
                 p0002-gbdat.
      ENDPROVIDE.
    endform.
    Now what I want to do is replace the write stuff by appending the entries into a dynamic table which I will display as an ALV Grid.
    so I add my structure in the data declarations
    types:  begin of s_elements,
       pernr  type  p0002-pernr,
       ename  type p0001-ename,
       sprsl  type p0002-sprsl,
       gbdat   type p0002-gbdat.
      drop_down_handle  type int4.
    types: end of    s_elements.
    include zz_jimbo_incl.
    build the dynamic table
    create data dref type s_elements.
      assign dref->* to <fs>.
      i_routine = 'POPULATE_DYNAMIC_ITAB'.*
    i_names   = 'NAME_COLUMNS'.
      i_gridtitle = 'HR  TEST'.
    invoker = sy-repid.
    i_zebra = 'X '.
    i_edit = '  '.
    call function 'ZZ_CALL_SCREEN'
         exporting
              invoker     = invoker
              my_line     = <fs>
              i_gridtitle = i_gridtitle
              i_edit      = i_edit
              i_zebra     = i_zebra
              i_names     = i_names
              i_routine   = i_routine
         importing
              z_object    = z_object
              dy_table    = dy_table.
    Now to populate the dynamic Itab the routine below is entered.
    form populate_dynamic_itab changing dy_table.
      assign dy_table->* to <dyn_table>.
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    However I can't use GET / PROVIDE / ENDPROVIDE in a Form.
    Anyway round this ---seems HR has an aversion to OO.
    Cheers
    jimbo

    Hi,
    well, GET_PERNR is a so called event_statement. It has nothing to do with ABAP 00.
    Normally it will be like this:
    START-OF-SELECTION.
    GET_PERNR.
    PROVIDE ....
    END-OF-SELECTION.
    -> and here the CALL SCREEN NNNN for ALV-Display.
    Provide-statements you can use in forms of course, and as many times you want during GET and END-OF-SELECTION.
    But as I understood : you just want to save the write-statements?
    I always develop a DDIC-Structure, declarate the data objects in the programm, read the data via Provide into the infotypes, and then make a move-corresponding to my structure. and display it.
    Normally no problem.
    kind regards
    maik

  • Abap-hr real time questions

    hi friends
    kindly send me ABAP-HR REAL TIME QUESTION to my mail [email protected]
    Thanks&Regards
    babasish

    Hi
    Logical database
    A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
    HR Logical Database is PNP
    Main Functions of the logical database PNP:
    Standard Selection screen
    Data Retrieval
    Authorization check 
    To use logical database PNP in your program, specify in your program attributes.
    Standard Selection Screen
    Date selection
    Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database.  When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.
    Person selection
    Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
    Sorting Data
    · The standard sort sequence lists personnel numbers in ascending order.
    · SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
    Report Class
    · You can suppress input fields which are not used on the selection screen by assigning a report class to your program.
    · If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
    Data Retrieval from LDB
    1. Create data structures for infotypes.
        INFOTYPES: 0001, "ORG ASSIGNMENT
                            0002, "PERSONAL DATA
                            0008. "BASIC PAY
    2. Fill data structures with the infotype records.
        Start-of-selection.
             GET PERNR.
        End-0f-selection. 
        Read Master Data
    Infotype structures (after GET PERNR) are internal tables loaded with data.
    The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
              GET PERNR.
                 PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
                        If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif.
                 ENDPROVIDE.
    Period-Related Data
    All infotype records are time stamped.
    IT0006 (Address infotype)
    01/01/1990   12/31/9999  present
              Which record to be read depends on the date selection period specified on the
              selection screen. PN/BEGDA PN/ENDDA.
    Current Data
    IT0006 Address  -  01/01/1990 12/31/9999   present
    RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.
    For example, pn/begda = '19990931'    pn/endda = '99991231'
    IT0006 subtype 1 is resident address
    RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
    Process Infotypes
    RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change.
    Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE
              REPORT ZHR00001.
              INFOTYPE: 0002.
              PARAMETERS: PERNR LIKE P0002-PERNR.
              RP-READ-INFOTYPE PERNR 0002 P0002 .
              PROVIDE * FROM P0002
                  if ... then ...endif.
              ENDPROVIDE.
    Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE. 
    · Three steps are involved in changing infotypes:
    1. Select the infotype records to be changed;
    2. Make the required changes and store the records in an alternative table;
    3. Save this table to the database;
    The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible.
    INFOTYPES: Pnnnn NAME OLD,
    Pnnnn NAME NEW.
    GET PERNR.
        PROVIDE * FROM OLD
               WHERE .... = ... "Change old record
               *Save old record in alternate table
               NEW = OLD.
        ENDPROVIDE.
        RP-UPDATE OLD NEW. "Update changed record
    Infotype with repeat structures
    · How to identify repeat structures.
    a. On infotype entry screen, data is entered in table form.
        IT0005, IT0008, IT0041, etc.
    b. In the infotype structure, fields are grouped by the same name followed by sequence number.
        P0005-UARnn P0005-UANnn P0005-UBEnn
        P0005-UENnn P0005-UABnn
    Repeat Structures
    · Data is entered on the infotype screen in table format but stored on the database in a linear  
      structure.
    · Each row of the table is stored in the same record on the database.
    · When evaluating a repeat structure, you must define the starting point, the increment and the
      work area which contains the complete field group definition.
    Repeat Structures Evaluation (I)
    · To evaluate the repeat structures
       a. Define work area.
           The work area is a field string. Its structure is identical to that of the field group.
       b. Use a DO LOOP to divide the repeat structure into segments and make it available for  
           processing in the work area, one field group (block) at a time.
    Repeat Structures Evaluation(II)
    Define work area
    DATA: BEGIN OF VACATION,
                  UAR LIKE P0005-UAR01, "Leave type
                  UAN LIKE P0005-UAN01, "Leave entitlement
                  UBE LIKE P0005-UBE01, "Start date
                  UEN LIKE P0005-UEN01, "End date
                  UAB LIKE P0005-UAB01, "Leave accounted
               END OF VACATION.
    GET PERNR.
         RP-PROVIDE-FROM-LAST P0005 SPACE PN/BEGDA PN/ENDDA.
         DO 6 TIMES VARYING VACATION
                 FROM P0005-UAR01 "Starting point
                     NEXT P0005-UAR02. "Increment
                 If p0005-xyz then ... endif.
          ENDDO.
    Processing 'Time Data'.
    · Dependence of time data on validity period
    · Importing time data
    · Processing time data using internal tables
    Time Data and Validity Period
    · Time data always applies to a specific validity period.
    · The validity periods of different types of time data are not always the same as the date selection period specified in the selection screen.
    Date selection period |----
    |
    Leave |----
    |
    · PROVIDE in this case is therefore not used for time infotypes.
    Importing Time Data
    · GET PERNR reads all time infotypes from the lowest to highest system data, not only those within the date selection period.
    · To prevent memory overload, add MODE N to the infotype declaration. This prevents the logical database from importing all data into infotype tables at GET PERNR.
    · Use macro RP-READ-ALL-TIME-ITY to fill infotype table.
    INFOTYPES: 2001 MODE N.
    GET PERNR.
        RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
        LOOP AT P0021.
             If P0021-XYZ = ' '. A=B. Endif.
        ENDLOOP.
    Processing Time Data
    · Once data is imported into infotype tables, you can use an internal table to process the interested data.
    DATA: BEGIN OF ITAB OCCURS 0,
                  BUKRS LIKE P0001-BUKRS, "COMPANY
                  WERKS LIKE P0001-WERKS, "PERSONNEL AREA
                  AWART LIKE P2001-AWART, "ABS./ATTEND. TYPE
                  ASWTG LIKE P2001-ASWTG, "ABS./ATTEND. DAYS
               END OF ITAB.
    GET PERNR.
    RP-PROVIDE-FROM-LAST P0001 SAPCE PN/BEGDA PN/ENDDA.
    CLEAR ITAB.
    ITAB-BUKRS = P0001-BURKS. ITAB-WERKS = P0001-WERKS.
    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
    LOOP AT P2001.
          ITAB-AWART = P2001-AWART. ITAB-ASWTG = P2001-ASWTG.
          COLLECT ITAB. (OR: APPEND ITAB.)
    ENDLOOP.
    Database Tables in HR
    ·  Personnel Administration (PA) - master and time data infotype tables (transparent tables).
       PAnnnn: e.g. PA0001 for infotype 0001
    ·  Personnel Development (PD) - Org Unit, Job, Position, etc. (transparent tables).
       HRPnnnn: e.g. HRP1000 for infotype 1000
    ·  Time/Travel expense/Payroll/Applicant Tracking data/HR work areas/Documents (cluster  
       PCLn: e.g. PCL2 for time/payroll results.
    Cluster Table
    · Cluster tables combine the data from several tables with identical (or almost identical) keys
      into one physical record on the database.
    . Data is written to a database in compressed form.
    · Retrieval of data is very fast if the primary key is known.
    · Cluster tables are defined in the data dictionary as transparent tables.
    · External programs can NOT interpret the data in a cluster table.
    · Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE
      FROM DATABASE are used to process data in the cluster tables.
    PCL1 - Database for HR work area;
    PCL2 - Accounting Results (time, travel expense and payroll);
    PCL3 - Applicant tracking data;
    PCL4 - Documents, Payroll year-end Tax data
    Database Tables PCLn
    · PCLn database tables are divided into subareas known as data clusters.
    · Data Clusters are identified by a two-character code. e.g RU for US payroll result, B2 for
      time evaluation result...
    · Each HR subarea has its own cluster.
    · Each subarea has its own key.
    Database Table PCL1
    · The database table PCL1 contains the following data areas:
      B1 time events/PDC
      G1 group incentive wages
      L1 individual incentive wages
      PC personal calendar
      TE travel expenses/payroll results
      TS travel expenses/master data
      TX infotype texts
      ZI PDC interface -> cost account
    Database Table PCL2
    · The database table PCL2 contains the following data areas:
      B2 time accounting results
      CD cluster directory of the CD manager
      PS generated schemas
      PT texts for generated schemas
      RX payroll accounting results/international
      Rn payroll accounting results/country-specific ( n = HR country indicator )
      ZL personal work schedule
    Database Table PCL3
    · The database table PCL3 contains the following data areas:
      AP action log / time schedule
      TY texts for applicant data infotypes
    Data Management of PCLn
    · The ABAP commands IMPORT and EXPORT are used for management of read/write to
      database tables PCLn.
    · A unique key has to be used when reading data from or writing data to the PCLn.
      Field Name KEY Length Text
      MANDT X 3 Client
      RELID X 2 Relation ID (RU,B2..)
      SRTFD X 40 Work Area Key
      SRTF2 X 4 Sort key for dup. key
    Cluster Definition
    · The data definition of a work area for PCLn is specified in separate programs which comply  
       with fixed naming conventions.
    · They are defined as INCLUDE programs (RPCnxxy0). The following naming convention applies:
       n = 1 or 2 (PCL1 or PCL2)
       xx = Relation ID (e.g. RX)
       y = 0 for international clusters or country indicator (T500L) for different country cluster
    Exporting Data (I)
    · The EXPORT command causes one or more 'xy' KEY data objects to be written to cluster xy.
    · The cluster definition is integrated with the INCLUDE statement.
    REPORT ZHREXPRT.
    TABLES: PCLn.
    INCLUDE: RPCnxxy0. "Cluster definition
    Fill cluster KEY
    xy-key-field = .
    Fill data object
    Export record
    EXPORT TABLE1 TO DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
           WRITE: / 'Update successful'.
       ENDIF.
    Exporting Data (II)
    . Export data using macro RP-EXP-Cn-xy.
    · When data records are exported using macro, they are not written to the database but to a  
      main memory buffer.
    · To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
    REPORT ZHREXPRT.
    *Buffer definition
    INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    RP-EXP-Cn-xy.
    IF SY-SUBRC EQ 0.
        PERFORM PREPARE_UPDATE USING 'V'..
    ENDIF.
    Importing Data (I)
    · The IMPORT command causes data objects with the specified key values to be read from
       PCLn.
    · If the import is successful, SY-SUBRC is 0; if not, it is 4.
    REPORT RPIMPORT.
    TABLES: PCLn.
    INCLUDE RPCnxxy0. "Cluster definition
    Fill cluster Key
    Import record
    IMPORT TABLE1 FROM DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
    Display data object
       ENDIF.
    Importing data (II)
    · Import data using macro RP-IMP-Cn-xy.
    · Check return code SY-SUBRC. If 0, it is successful. If 4, error.
    · Need include buffer management routines RPPPXM00
    REPORT RPIMPORT.
    *Buffer definition
    INCLUDE RPPPXD00.
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    *import data to buffer
    RP-IMP-Cn-xy.
    *Buffer management routines
    INCLUDE RPPPXM00.
    Cluster Authorization
    · Simple EXPORT/IMPORT statement does not check for cluster authorization.
    · Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
      authorization.
    Payroll Results (I)
    · Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
      n - country identifier.
    · Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
      report RPCEDTn0 lists the results on a payroll form.
    Payroll Results (II)
    · The cluster definition of payroll results is stored in two INLCUDE reports:
      include: rpc2rx09. "Definition Cluster Ru (I)
      include: rpc2ruu0. "Definition Cluster Ru (II)
    The first INCLUDE defines the country-independent part; The second INCLUDE defines the country-specific part (US).
    · The cluster key is stored in the field string RX-KEY.
    Payroll Results (III)
    · All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This
      allows you to use the same structures in different definitions and nonetheless maintain data
      consistency.
    · The structures for cluster definition comply with the name convention PCnnn. Unfortunately, 
       'nnn' can be any set of alphanumeric characters.
    *Key definition
    DATA: BEGIN OF RX-KEY.
         INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    *Payroll directory
    DATA: BEGIN OF RGDIR OCCURS 100.
         INCLUDE STRUCTURE PC261.
    DATA: END OF RGDIR.
    Payroll Cluster Directory
    · To read payroll results, you need two keys: pernr and seqno
    . You can get SEQNO by importing the cluster directory (CD) first.
    REPORT ZHRIMPRT.
    TABLES: PERNR, PCL1, PCL2.
    INLCUDE: rpc2cd09. "definition cluster CD
    PARAMETERS: PERSON LIKE PERNR-PERNR.
    RP-INIT-BUFFER.
    *Import cluster Directory
       CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
       CHECK SY-SUBRC = 0.
    LOOP AT RGDIR.
       RX-KEY-PERNR = PERSON.
       UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
       *Import data from PCL2
       RP-IMP-C2-RU.
       INLCUDE: RPPPXM00. "PCL1/PCL2 BUFFER HANDLING
    Function Module (I)
      CD_EVALUATION_PERIODS
    · After importing the payroll directory, which record to read is up to the programmer.
    · Each payroll result has a status.
      'P' - previous result
      'A' - current (actual) result
      'O' - old result
    · Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period
       when that payroll is initially run. It also will select all the relevant periods to be evaluated.
    Function Module (II)
    CD_EVALUATION_PERIODS
    call function 'CD_EVALUATION_PERIODS'
         exporting
              bonus_date = ref_periods-bondt
              inper_modif = pn-permo
              inper = ref_periods-inper
              pay_type = ref_periods-payty
              pay_ident = ref_periods-payid
         tables
              rgdir = rgdir
              evpdir = evp
              iabkrs = pnpabkrs
         exceptions
              no_record_found = 1.
    Authorization Check
       Authorization for Persons
    ·  In the authorization check for persons, the system determines whether the user has the 
       authorizations required for the organizational features of the employees selected with
       GET PERNR.
    ·  Employees for which the user has no authorization are skipped and appear in a list at the end
       of the report.
    ·  Authorization object: 'HR: Master data'
    Authorization for Data
    · In the authorization check for data, the system determines whether the user is authorized to
      read the infotypes specified in the report.
    · If the authorization for a particular infotype is missing, the evaluation is terminated and an error
      message is displayed.
    Deactivating the Authorization Check
    · In certain reports, it may be useful to deactivate the authorization check in order to improve
      performance. (e.g. when running payroll)
    · You can store this information in the object 'HR: Reporting'.
    these are the main areas they ask q?

Maybe you are looking for

  • Item text in BAPI_PO_Change

    Dear Expert, I used BAPI_PO_Change for add the item text. text = 'Completed'. s_bapimepotext-TEXT_LINE = text. call function 'BAPI_PO_CHANGE'   exporting     purchaseorder                = p_ebeln TABLES    RETURN                       = i_return   

  • How do I restore "Weather" app?

    I accidentally deleted my "Weather" app (the one that's included with every new iPod Touch). I thought "no problem," the app will still be on my Mac, so I can restore it from there. Wrong! I didn't find it there either. In fact, I don't find other "o

  • Leap year debugging

    I'm having a hard time debugging this program,It's suppose to determine if a year is a leap year. import java.util.*; public class LeapYear      static Scanner console = new Scanner(System.in);      public static void main(String[] args)      boolean

  • 100 disk usage all the tim HELP!!

    Hello,  I have the exact same issue as everyone else.  I have searched everywhere, tried all things, still no answer.  It is happening on multiple computers.    100% disk usage, 1000-20000 average response time on disk.  Computer comes to a grinding

  • ERP Screen Response Times

    One of our clients is accessing his ERP system through a satellite WAN. Could somebody please let me know the ideal respose time for an ERP screen accessed by a satellite at a bandwidth of 512 kbps for one user?