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

loop with dynamic where clause

hi,

In a program we need to use a loop into an internal table with a where condition is decided on run time.

"Select" from database table is using dynamic where clause and it is working fine.

For the loop part does any one have any idea on this? if we can have dynamic where clause in a loop into internal tab?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jul 20, 2007 at 06:36 PM

    Hi,

    May be you use field-symbols in place of internal table

    ASSIGN COMPONENT <ls_cha> OF STRUCTURE <ls_thatcha> TO <l_thatfld>

    aRs

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2007 at 06:45 PM

    Hi,

    You can't use 'loop where' dynamically .

    Have you already tried to use Ranges and CHECK statement?

    Like:

    First mount range options;

    Loop at <table>.

    Check using the range.

    endloop.

    Maybe it's works for you !!

    Marcelo Ramos

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2007 at 08:33 AM

    hi

    good

    go through this FM.

    CLDY_DYN_SEL_WHERETAB_CREATE

    DYNSQL_GENERATE_WHERE_CLAUSE

    RH_DYNAMIC_WHERE_BUILD

    in the IT_WHERE you need to write the correct conditions, like

    IT_WHERE-FIELD1 = 'DATE1 = Sy-DATUM and'.

    Append IT_WHERE.

    IT_WHERE-FIELD1 = 'DATE2 = Sy-DATUM'.

    Append IT_WHERE.

    thanks

    mrutyun^

    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.