Application Development and Automation 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: 
Read only

Using where condition with dynamic internal table

Former Member
0 Likes
1,441

Hi Friends.

How to use where condition with dynamic internal table ?

Regards,

Amit Raut

4 REPLIES 4
Read only

Former Member
0 Likes
582

Take a look at this thread

Regards,

Read only

Former Member
0 Likes
582

Hai Amit

REPORT ZDYNAMIC_SELECT .

TABLES: VBAK.

DATA: CONDITION TYPE STRING.

DATA: BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBAK-VBELN,

POSNR LIKE VBAP-POSNR,

END OF ITAB.

SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.

CONCATENATE 'VBELN' 'IN' 'S_VBELN.'

INTO CONDITION SEPARATED BY SPACE.

SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB

WHERE (CONDITION).

LOOP AT ITAB.

WRITE 'hello'.

ENDLOOP.

Thanks & Regards

Sreenivasulu P

Read only

Former Member
0 Likes
582

Hi Amit,

is the above thread is not sufficient for you, take a string variable and concatenate your where your where clause to that string and pasas it to where clause.

Regards

vijay

Read only

athavanraja
Active Contributor
0 Likes
582

you cannot use where calss with dynamic internal table.

somethid like below is not possible.

loop at <ltable> assigning <l_line> where field1 eq 'ABC' .

endloop .

youhave to live with a if statement within the loop .

Regards

Raja

i hope i understand the question - where condition with dynamic internal table and not DYNAMIC WHERE CONDITION