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

Looping condition

Former Member
0 Likes
738

Hi,

Loop at item_itab into wa

IF zyflag IS NOT INITIAL AND flag NE zyflag.

Delete item_itab INDEX sy-tabix.

ENDIF.

ENDLOOP.

This coding is not working. Here zyflag is a selection screen field which has multiple selection. Even though the flag value and zyflag value is equal, it is taking notequal. Is it because of zyflag is a multiple selecition field? If so, how can i give the condition?

Ezhil

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
703

Hello Ezhil,

Loop at item_itab into wa

" IF zyflag IS NOT INITIAL AND flag NE zyflag.

IF zyflag IS NOT INITIAL AND flag NOT IN zyflag.

Delete item_itab INDEX sy-tabix.

ENDIF.

ENDLOOP.

BR,

Suhas

5 REPLIES 5
Read only

Former Member
0 Likes
703

1. what do you mean by multiple selection field?

if it is a select option.. then the values comes as IEQXYZ ( where I is one field value for sign, EQ for option, and then the low high values)

so use flag in zyflag or not in

2.

inside the loop no need of indexing.

just "delete item_itab" will do.

Edited by: Soumyaprakash Mishra on Oct 20, 2009 6:34 PM

Read only

0 Likes
703

Delete statement is working fine. But the condition flag NE zyflag is not working. Though flag and zyflag are equal, it is showing not equal and delete statement is executed.

i think that is bec zyflag is in select-options.

So for that, how can i give the condition?

Read only

0 Likes
703

Hi,

Try this code.

Loop at item_itab into wa

IF zyflag IS NOT INITIAL AND flag NE zyflag-low.

Delete item_itab INDEX sy-tabix.

ENDIF.

ENDLOOP.

Thanks,

Harini

Read only

Former Member
0 Likes
703

HI,

Since ZYFLAG is a select option try using the field ZYFLAG-low for the comaprison.

Thanks,

Harini

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
704

Hello Ezhil,

Loop at item_itab into wa

" IF zyflag IS NOT INITIAL AND flag NE zyflag.

IF zyflag IS NOT INITIAL AND flag NOT IN zyflag.

Delete item_itab INDEX sy-tabix.

ENDIF.

ENDLOOP.

BR,

Suhas