Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Loop... Where clause is not working

Hello experts.

There is program , which i want to add conditions to a loop command.

The constraints is considered only for this condition : blart = lv_blart , and doesn't consider for the second one opbel <> lv_opbel (meaning the loop continues even if this condition is FALSE ).

On the other hand , when i write with IF clause, the constraints is valid .

The program is :

data : lv_blart TYPE blart_kk,

lv_opbel TYPE opbel_kk,

it_blart TYPE TABLE OF dfkkop,

wa_dfkkop TYPE dfkkop.

.

.

.

.

/// Loop where ///

lv_blart = 'DI'.

LOOP AT it_blart INTO wa_dfkkop WHERE

( ( opbel <> lv_opbel ) AND ( blart = lv_blart ) ) .

*********************************

/// IF clause ///

lv_blart = 'DI'.

LOOP AT it_blart INTO wa_dfkkop.

IF ( wa_dfkkop-opbel <> lv_opbel )

AND ( wa_dfkkop-blart = lv_blart ).

***************************************

Thanks for help.

Avi.

Edited by: avi azulay on Jun 11, 2008 2:07 PM

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question