‎2010 Feb 18 5:04 PM
Hi All,
In the read statement after key vbeln can I use conditions like AND, OR
to check multiple conditions..?
Read table I_ITEMS with key vbeln = I_INV_ITEMS-VBELN
posnr = I_INV_ITEMS-uepos
binary search.
Pls let me know.
subbu.
‎2010 Feb 18 5:10 PM
answer for your question is No.
In read statement we are not suppose to use any AND and OR.
But this question is a basic question.
Before posting the question please do the some research. This kind of questions can be solved by yourself.
‎2010 Feb 18 5:08 PM
For that logic, I think we would want to do:
LOOP at <table> [ assigning <field-symbol>]
where...condition
and ( xxxx=xxxx or ( yyyy=yyyy and zzzz <> aaaa ) )
endloop.
‎2010 Feb 18 5:10 PM
answer for your question is No.
In read statement we are not suppose to use any AND and OR.
But this question is a basic question.
Before posting the question please do the some research. This kind of questions can be solved by yourself.
‎2010 Feb 18 5:11 PM
Hi,
Just READ the F1 help on READ. You will get the answer+ some bonus documentation:)
Try to use OR and see what it says.
FYI... Basic questions are not allowed in forums.
Thanks,
Vinod.
‎2010 Feb 18 10:48 PM
No, READ statement allows only simple = condition. If you want stronger condition with >, <, <=, AND, OR etc. there is trick for it using the loop cycle.
DATA: is_items LIKE LINE OF i_items.
LOOP AT i_items INTO is_items
WHERE vbeln = i_inv_items-vbeln
AND posnr = i_inv_items-uepos
OR <some other condition>.
EXIT.
ENDLOOP.After that loop you will have your line in the structure IS_ITEMS.
So the key is to use LOOP with additional WHERE condition and inside use EXIT. This will safely simulate READ functionality with possibility of strong logical condition.
And dont forget to check sy-subrc after loop