Bounds in provide statement

hi all,
i need to use provide statement i found this provide in the f1 help.
but i am unable toget it how it is actually works . after executing this code the values become different than prevous ..
please give detail description , i have been debugging  this code... still i am unable to get .
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.
thanks&regards,
krishna

Hi,
Try with the fallowing example
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 ENDOF if an internal table is declared with the 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 the PROVIDE uses the first two columns of the internal table.
example for the bounds
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.
Hope it will be useful  to you.
Regards,
Shirisha

Similar Messages

  • New Provide statement in ECC 6.0

    Hi All,
    I am getting infotype 0001 information by using function module HR_READ_INFOTYPE.Now i need to check the Employee subgroup (PERSK) change from 11 to 12 .For this i need to use PROVIDE statment and if change happens i need to make a returning parameter false.
    How can i use the new provide statement
    l_sub is a flag.
    *provide fields * from p0001 into l_temp VALID l_sub*
    BOUNDS persk AND persk  BETWEEN l_begda AND l_endda.
    i am not getting any records while running this query.Can you please help me out.What l_temp returns if the loop pass success.In bound what  i need to give here i need to check the persk value.
    Thanks
    Chandu

    Hi Chandu,
    When you are using the bounds statement in a provide field statement,
    the two fields on which the bound condition is being applied have to be
    different columns of same type of the table from which you are selecting the values..
    For eg
    PROVIDE fields * from p0001 into itab valid flag1  BOUNDS begda AND endda
            BETWEEN pnpbegda AND pnpendda.
    What you are using is not giving any values is because it is referring to only
    one column of the table p0001.
    Get Back if u still have Doubts
    Ira !!

  • PROVIDE statement not working as I expected

    I am creating a report via the HR Logical Database PNPCE. It's pretty straightforward, and I'm returning data for two Infotypes -- 0001 and 0008 (Subtype '0' for Basic Contract).
    The clients said they'd like records combined unless there's a data value change between the time period (a two-week period) for Org. Unit (orgeh), Cost Center (kostl), or Time Recording Admin. (sachz). Looking back at my spiffy HR Programming course notes, it looks like I need to do a "join" and a "contraction", so my code looks like this:
    PROVIDE orgeh kostl sachz FROM p0001
    FROM p0008
    BETWEEN pn-begda AND pn-endda
    WHERE p0008-subty = '0'.
    So far so good. Testing data is nearly non-existent, but I think this is the right approach. Here's the problem: all those other data values I need from p0001 other than orgeh, kostl, and sachz are blank. I can understand why -- instead of *, I've specified three specific fields to return.
    So how do I get those other fields I need from p0001? Do I...
    1) ...code a separate PROVIDE * FROM p0001 prior to this, and save my values then?
    2) ...add them as part of my original PROVIDE statement, so after PROVIDE orgeh kostl sachz, I add other fields as well?
    3) ...read the 0001 Infotype directly, through a function, to get the data?
    I feel like I'm real close on this one -- I just need to get past this hurdle. It's going to be a huge learning experience for me as well, as I've never done a report using this approach before.
    Thank you!

    Suresh,
    That part I understand.  And I think what you're saying is one of the options I was pondering -- using a PROVIDE statement on just the P0001 table prior to the contracting.
    For now, I'm going to change it back to PROVIDE * so I can get all of the information and continue working on my project.  But if anyone has further advice, please post, as I think this is a key area of HR programming that I need to make sure I understand.
    Thanks again,

  • Provide Statement

    hi guys,
    kindly provide DOCUMENT  for PROVIDE statement in HR ABAP.
    Reg,
    Hariharan

    When  we are coding into SAP-HR
    we use provide and endprovide statements
    it works same as we use select and endselect statement in normal abap
    you can also use select and endselect
    the functionality is same
    hope this information is useful
    bhanu

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

  • I have a problem with a chart refreshing after its bound data provider changes.

    I have a problem with a chart refreshing after its bound data
    provider changes. After the subsetHighLowData.refresh() is called I
    would expect the chart to redraw, but it still looks the same. I
    even inspected the debugger to see if the slice had taken place and
    it had.
    Any ideas coding friends?

    "nikos101" <[email protected]> wrote in
    message
    news:gib6aa$prr$[email protected]..
    >I have a problem with a chart refreshing after its bound
    data provider
    >changes.
    > After the subsetHighLowData.refresh() is called I would
    expect the chart
    > to
    > redraw, but it still looks the same. I even inspected
    the debugger to see
    > if
    > the slice had taken place and it had.
    >
    > Any ideas coding friends?
    >
    > subsetHighLowData.source =
    >
    highLowData.source.slice(slider.values[0],slider.values[1]);
    Just use the ArrayCollection's removeItemAt, and it should
    handle the event
    dispatching for you.
    HTH;
    Amy

  • Error handling return code for Provide Statement

    Hi Experts,
    For select statement we have error handling return code sy-subrc.
    What is the error handling return code for provide.. end provide statement.
    Thanks,
    Ragu

    Ragu,
    Same thing.
    Check sy-subrc.
    sy-subrc is the return code for all ABAP statements as far as I know.
    Regards,
    Dilek

  • PNP logical database screen and provide statement.

    hi all,
    I have changed standard selection screen for PNP and now i dont have PERNR on it but it has only company code and one extra field added by me.
    then after "GET PERNR."
    Now if i execute statement "provide * from P0001 between pn-begda and pn-endda.", it gives me record for only pernr.
    can someone explain me??
    Reena..

    As your report is tied to PNP, & you have only BUKRS as on the selection screen, the GET PERNR will be executed for all the PERNRs that belong to the Company Code input. You don't have to specify the Pernrs.. the LDB will select it for you..
    ~Suresh

  • Help with provide statement In ABAP HR

    Hi to all experts,
    My requirement is to display locked  records with start date and end date
    But the problem when i select the period as current month im getting the start date of the current month and enddate of the current month
    PROVIDE * FROM p0008 BETWEEN pn-begda AND pn-endda.
            IF  p0008-sprps = 'X'.
              gs_final-pernr = p0008-pernr.
              gs_final-cname = w_name.
              gs_final-inftyp = '0008'.
              gs_final-begda = p0008-begda.
              gs_final-endda = p0008-endda.
              gs_final-uname = p0008-uname.
              gs_final-aedtm = p0008-aedtm.
              APPEND gs_final TO gt_final.
            ENDIF.
    the current month is selected in the period im getting the begda as 01.11.2009 and endda as 30.11.2009 but the start date and enddate should be 02.11.2009 and 31.12.2009 . after the provide the values are changed

    Hi!
    Provide "cuts" the date borders as described in the abap-documentation.
    You can use the following:
    loop at p0008 where ( begda le pn-begda and endda ge pn-endda ) or
                                       ( begda between pn-begda and pn-endda ) or
                                       ( endda between pn-begda and pn-endda ).
    move fields to gs_final
    append gs_final to gt_final.
    endloop.
    I hope this helps!
    Kind regards
    Peter

  • Need help with provide statement in pnp progrm

    hi experts,
    i need to select all the records that :
    1. pa00014-sunty in so_subty.
    base on the records that he found' i need to select from pa0001:
    p0014-endda = > p0001-begda and
    p0014-begda = < p0001-endda and
    p0001-persk ne so_persk.
    what i did:
    provide * from p0001
    from p0014
    between pn-begda and pn-endda
    where p0014-subty = so_subty  and
    p0014-endda = > p0001-begda and
    p0014-begda = < p0001-endda and
    p0001-persk ne so_persk.
    check p0001_valid = 'X'.
    endprovide.
    i got 2 problems:
    1. i not recognize the syntax: check p0001_valid = 'X'.
    2. the syntax for the provide is not good.
    i new in pnp thing.
    i hope i was clear.
    thanks in advanced,
    Michal.

    Hi,
       May be this code will help you.
    infotypes: 0001,0002,0008,0000,1000,0021,0041,0587 .
    PROVIDE ename BTRTL PLANS STELL ORGEH ABKRS FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA  .
    if p0001-begda = '20070801' .
          IT_FINAL-ORGEH = P0001-ORGEH .
          IT_FINAL-STELL = P0001-STELL .                            "   JOB
          IT_FINAL-PLANS = P0001-PLANS .                            "   POSITION
          IT_FINAL-ename = P0001-ename .                            "   personnel name
          IT_FINAL-BTRTL = P0001-BTRTL .                            "   DEPARTMENT
          IT_FINAL-ABKRS = P0001-ABKRS .                            "   PAYROLL AREA
          APPEND IT_FINAL .
    endif .
    ENDPROVIDE.
    PROVIDE GBDAT GESCH FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA .
           IT_FINAL-GBDAT = P0002-GBDAT  .                            "   DOB
           IT_FINAL-GESCH = P0002-GESCH  .                            "   ***
         IF IT_FINAL-GESCH = 1   .
           IT_FINAL-GTXT  = 'M'  .
         ELSE.
           IT_FINAL-GTXT  = 'F'  .
         ENDIF .
           APPEND IT_FINAL .
    ENDPROVIDE .
    PROVIDE TRFST FROM P0008 BETWEEN PN-BEGDA AND PN-ENDDA.
            IT_FINAL-TRFST = P0008-TRFST .                          "   personnel level
            APPEND IT_FINAL .
    ENDPROVIDE.
    PROVIDE  FAVOR FANAM FROM P0021 BETWEEN PN-BEGDA AND PN-ENDDA where P0021-pernr = pernr-pernr
      and  p0021-SUBTY = '11' .
           IT_FINAL-FAVOR  = P0021-FAVOR .                          "   FATHER'S NAME
           IT_FINAL-FANAM  = P0021-FANAM .
           CONCATENATE IT_FINAL-FAVOR IT_FINAL-FANAM  INTO IT_FINAL-FNAME .
           APPEND IT_FINAL .
    ENDPROVIDE.
    Regards,
    Himanshu

  • Using Provide statement in HR programming

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

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

  • Error in Provide Statement

    TABLES     : PERNR.
    INFOTYPES  : 0000.
    get pernr .
    PROVIDE * FROM P0000 BETWEEN PN-BEGPS AND PN-ENDPS.
        WRITE: /10 P0000-PERNR, 20 P0000-BEGDA,30 P0000-ENDDA.
      ENDPROVIDE.
    in gave PN-BEGPS  =  01.01.2009 and PN-ENDPS = 31.12.2009
    but for all record the result P0000-BEGDA,30 P0000-ENDDA. is coming as
    01.01.2009 and 31.12.2009 .
    can u give any suggestion
    thanks and regards
    Renjith

    That is standard SAP Functionality.  If you want to see the actual dates you have to use a different method of getting your data.

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

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

Maybe you are looking for

  • Adobe Photoshop 12 Mac, Installation problem

    Hi there ! I have a Adobe Photoshop Elements bought a few days ago 12 full version in retail and this is now trying to install on my Imac. Now I am annoyed about the following problem. " This serial number for Adobe Photoshop turning 12 could not be

  • Installed 10.5 on G5 to replace 10.3.9 and lost all

    Installed 10.5 on G5 to replace 10.3.9 and lost iphoto, itunes, all files, settings etc. I thought I was making a backup, but everything is erased now. Is there anyway to get all my files, settings, itunes, etc. back?

  • My iPod keeps stopping when i download songs to it

    I first had a problem with downloading music to my ipod because it said that there was a corruption, so I format my ipod and then I start having a bunch of other programs installing the software but I fixed that. Now when I update songs on to my iPod

  • CAN I PULL THE MUSIC FROM AN IPOD TO UNDATE A LIBRARY

    I had to upgrade my system and unfortunately I lost my music library when I was transferring it to an external drive. Can I use the ipod information to recreated my music library?

  • Address instance of class with webserviceconnector

    Hi, what am I missing here? I'd like to create a movieclip which has linkage to a class. The class should have a function that calls a webservice that returns some data. The movieclip itself has an instance - i_checkHolder - which just is a graphic b