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>

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

  • 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.

  • 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.

  • 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

  • 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.

  • Regarding provide

    Hi,
    I am selecting some fields from infotype by using provide.
    like ..
    provide aedtm
               ename
               plans
               orgeh
               kostl  from p0001  between pn-begda and  pn-endda.
    when I am writing where condition the data will be printing with zero's.
              where p0001-aedtm le p_aedtm.
    why it is giving I am not getting.
    please guide me how to follow.
    Regards
    Anil

    Hi Anil
      See the below code. Also make sure you have data in infotype PA0001 and the LDB 'PNP' is included in your program.
    TABLES pernr.
    INFOTYPES: 0001.
    GET PERNR.
    provide aedtm
    ename
    plans
    orgeh
    kostl from p0001 between pn-begda and pn-endda
    where p0001-aedtm le sy-datum.
      write:/
        p0001-aedtm,
        p0001-ename,
        p0001-plans,
        p0001-orgeh,
        p0001-kostl.
    endprovide.

  • 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

  • Regarding Providing Authorisation

                       I have created a new user under the organisational unit. Created a new service and assigned that particular user to approve or reject a service. But under my services authorisation tab,created service is not getting displayed to approve or reject.
    Can u please tell me the procedure how to approve the service , when the user submits the order

    Parvin, is this within context of IAC 3.1 extensible authorizations (approvals)? Or are you asking from a generic approach of creating a new service outside of the IAC packages/solution?    

  • 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

  • How to provide access to Critical Transactions in GRC AC 10.0

    +Hello Gurus,+
    +We are in phase of implementing GRC AC 10.0 , and have a requirement where there are "Critical Transactions" identified by the Business and if there is any end user who wants to access any specific "Critical Transaction" e.g. PA30 etc then it must automatically go to a specific Owner of that transaction.+
    +As far as i know , we can have a workflow for getting a role assigned, but not sure if it is possible to have a workflow where every "critical transaction" will have an owner and then on selection of the transaction it will trigger a workflow.+
    +I would also like to know what is a standard or rather best practice in SAP GRC , regarding providing access to "CRITICAL Transactions" ??+
    +We thought of creating a role containing multiple "Critical transactions" and then assigning to the firefighter ID , for which we have an approval workflow !! But that does not help , as assigning the role will give user access to some other "critical transactions" as well which we would like to control.+
    +Looking forward to know about the suggestion/solution for this issue.+
    +Thanks in advance.+
    +Regards,+
    +Victor+

    Hello,
    Victor Ger wrote:
    > +We thought of creating a role containing multiple "Critical transactions" and then assigning to the firefighter ID , for which we have an approval workflow !! But that does not help , as assigning the role will give user access to some other "critical transactions" as well which we would like to control.+
    > +Victor+
    I think that only one firefighter with all the critical transactions is not a good idea. I guess it's better to have different firefighters IDs assigned to different users. The point here is to decide if you really want to have a trace for all critical transactions executions.
    An example:
    Tx. SM37 is considered a critical transaction if the user has also the auth. object S_BTCH_ADM set to "yes".  This allows to delete or copy others user's jobs. This is and authorization that a Basis person must have. Do you really want to trace this?
    I think that force a Basis person to use a firefighter for this is nonsense, because this tx. is part of his/her job. Then, you should accept this sort of risks, otherwise you'll get the point where you replace the normal users with FF users. This is not the idea of FF.
    Of course, this is just a thought and all depends on your business requirements.
    Cheers,
    Diego.

Maybe you are looking for

  • CO Object Assignment Error while posting Down Payment Request

    User is raising a Down Payment Request for the purchase of an Asset  through a Purchasing Document. This Asset Master has got the cost center and WBS Element assigned in it. System while saving the DP Request is throwing an error that “CO Account Ass

  • ITunes 11 42404 error

    Help!!! I am getting an error in iTunes after I upgraded to version 11. I am running Windows 7, IE 9 (now 10).  The two error messages are: Error1:  A required iTunes component is not installed. Please repair or reinstall iTunes. (-42404) Error2:  We

  • Terrible apple service in China

    Hi fellow apple fans! I have a question. I bought a Mac pro last year and since then I think I'm having some hardware problems. Obviously! I'm terrified with the apple service in China. The first month my hard disk crashed and I had to get a new hard

  • ELECTRIC SHOCK!?

    When admiring the beautiful aluminum finish of my Macbook Pro today (strocking it) i felt a strange textured sensation, doin so again reminded me of "pins & needles" I have come to believe the Macbook Pro's give off static discharge! It is actually q

  • Qmaster from FCP 5.0 and 5.1 together?

    Quick question - A client has FCP 5.0 on several PPC Macs, and is buying one Intel Mac with FCP 5.1. If they'd like to set up Qmaster (which they're not using at the moment), do they need to upgrade the 5.0 to 5.1 on the other Macs? Any other interop