Skip to Content
author's profile photo Former Member
Former Member

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2010 at 06:24 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.