‎2008 Jul 23 12:36 PM
hiii
with read statement, can you read with a key where the value contain wildcards.
such as
read table i_tab with key field1 = v_field
the v_field will may contain "BU*"
that is the will read the value in itab where the field1 will contina BU01 or BU02
can anyone please confirm. since with read we cannot use CS
‎2008 Jul 23 12:42 PM
‎2008 Jul 23 12:38 PM
hi,
I appologize that this statement doesn't work .... I remember using it but probably i am wrong ...as Eric said loop with cp only works ...
Regards,
Santosh
Edited by: Santosh Kumar Patha on Jul 23, 2008 5:35 PM
‎2008 Jul 23 12:41 PM
Hi,,
with read statement, you can read with a key where the value contain wildcards.
such as
read table i_tab with key field1 like v_field
the v_field will may contain "BU*"
that is the it will read the value in itab where the field1 will contina BU01 or BU02.
Regards,
Sunil Kumar Mutyala.
‎2008 Jul 23 12:42 PM
Try CP (Covers pattern)
Covers Pattern: True, if the content of operand1 fits the pattern in operand2. Wildcard characters can be used for forming the operand pattern, where "" represents any character string, and "+" represents any character. Upper/lower case is not taken into account. If the comparison is true, sy-fdpos contains the offset of operand2 in operand1, whereby leading wildcard characters "" in operand2 are ignored if operand2 also contains other characters. If the comparison is false, sy-fdpos contains the length of operand1. You can select characters in operand2 for a direct comparison by adding the escape symbol "#" before the required characters. For these characters, upper/lower case is taken into account, wildcard characters and the escape symbol itself do not receive special treatment, and trailing blanks in operands of type c are not cut off.
‎2008 Jul 23 12:42 PM
‎2008 Jul 23 12:46 PM
Florian Kemmer,
however answer is simply no as said by others.
but i would like to intimate to Florian for avoinding mis leads on SDN.
Amit.
‎2008 Jul 23 12:48 PM
Amit: you are a bit unfair, it is not just Florian, but everyone else, except Vijay... biggest fault has Santosh Kumar Patha with nearly 10K points...
(I wonder if moderators can remove the wrong ansers in this case - if they don't do it on their own)
‎2008 Jul 23 12:57 PM
I am aware that CS and CP don't work
but Sunil Kumar Mu.. says that
read table i_itab where field1 = "BU*"
I cahnged the value in debut but it won't work is there a possibility of doing that without passing through the loop since my key conditio contain 8 condition.
‎2008 Jul 23 12:57 PM
Eric,
yes i do agree with you.biggest mistake made by Santosh really surprising who is on wave in term of points.
here is another example of misleads both are made today only.even i saw often such kind of unwanted replied moderator should omit their replies so that SDN can remain stand as heaven for needed person like us forever:
cheers
‎2008 Jul 23 1:00 PM
>
> I am aware that CS and CP don't work
>
> but Sunil Kumar Mu.. says that
>
> read table i_itab where field1 = "BU*"
>
> I cahnged the value in debut but it won't work is there a possibility of doing that without passing through the loop since my key conditio contain 8 condition.
I think Sunil gave you wrong information this time...
There is only the LOOP, no other way...
‎2008 Jul 23 1:01 PM
newbie82 c
I cahnged the value in debut but it won't work is there a possibility of doing that without passing through the loop since my key conditio contain 8 condition.
i think than you need to use if endif with wildcard charecter but howevenr loop there also needed only thing you can bypass is condition with loop.
anyways earth is round.
Amit.
‎2008 Jul 23 12:43 PM
since with read we cannot use CS
loop at i_tab where field1 cs v_field.
<---- do waht ever you want here.....
exit.
endloop.
‎2008 Jul 23 12:43 PM
hi,
it does not matter how many people says it works, there is no way, you can 't do that with READ TABLE, only = is allowed.
however as alternative, you can use LOOP AT ... INTO ... WHERE field CP 'BU*'.
hope this helps
ec
‎2008 Jul 23 12:56 PM
‎2008 Jul 23 12:59 PM
according to your long piece of code do you mean do a select statement
coz i am a bit confuse with this logn code
‎2008 Jul 23 1:09 PM
>
> according to your long piece of code do you mean do a select statement
>
> coz i am a bit confuse with this logn code
that source code is completely irrelevant to your problem. Don't even bother with that!
‎2008 Jul 23 1:00 PM
Hi,
READ statement is used to a single record not multiple records.
So we cant use the Wild card characters (_,%) with READ.
Thanks & Regards,
Chandralekha.