Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic WHERE in READ TABLE

Former Member
0 Kudos

Hi

it is possible to do dynamic condition READ TABLE WITH KEY (dynamic),

or maybe in LOOP WHERE (dynamic)?

10 REPLIES 10

Former Member
0 Kudos

Did you try this?

Did you read the documentation??

Rob

0 Kudos

In documentation there aren't what I need

0 Kudos

So what does that tell you?

Rob

0 Kudos

Is not possible.

Do you have use

loop at itab into wa_itab where x = y

and z1 > z2.

your code ....

endloop.

kesavadas_thekkillath
Active Contributor
0 Kudos

READ TABLE ALL_CUSTOMERS
WITH KEY (KEY1) = VALUE1
(KEY2) = VALUE2.

Loop with dynamic where clauses are supported in higher versions of SAP.

0 Kudos

Unfortunelly I don't know number of keys in CONDITION it must be dynamic.

0 Kudos

Hi

Unfortunelly I don't know number of keys in CONDITION it must be dynamic.

That means you have to consider another solution:

let's to know what you need to do, perhaps we can give you an alternative one

Max

former_member182040
Active Contributor
0 Kudos

Using call function RH_DYNAMIC_WHERE_BUILD u create dynamic where

Edited by: Krupaji on Nov 19, 2010 11:01 AM

Former Member
0 Kudos

HI friend,

Yes it is possibel we can read the dynamic values using field symbols also or other wise we can use

string operation like CONCATENAT the fieldnames.

FIELD-SYMBOLS:<FIELDNAME1> TYPE ANY,

<FIELDNAME1> = 'LIFNR'.

READ TABLE ITAB INTO WA WITH KEY <FIELDNAME1> = VALUE.

LOOP AT ITAB INTO WA WHERE <FIELDNAME1> = VALUE.

if it is not possible u can use FIELD SYMBOLS then u can get the fields dynamcially.

0 Kudos

Good resolve but have only one weakness, I can't use in this case dynamic numbers of keys