2008 Oct 23 12:07 AM
I need to do a range on coss-objnr but I need it to be a pattern. I have the following but it doesn't work:
CONCATENATE 'KS' p_kokrs wa_overhead_values-valfrom '*' INTO d_objnr_low.
CONCATENATE 'KS' p_kokrs wa_overhead_values-valto '*' INTO d_objnr_high.
REFRESH: r_objnr.
r_objnr-sign = 'I'.
r_objnr-option = 'CP'.
r_objnr-low = d_objnr_low.
r_objnr-high = d_objnr_high.
APPEND: r_objnr.
CLEAR: r_objnr, d_objnr_low, d_objnr_high.
REFRESH: it_coss.
SELECT * INTO TABLE it_coss FROM coss WHERE lednr = '00' AND wrttp = '04'
AND gjahr = p_gjahr AND objnr IN r_objnr.
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE it_coss FROM cosp WHERE lednr = '00' AND wrttp = '04'
AND gjahr = p_gjahr AND objnr IN r_objnr.It doesn't return any values but I know that it should. For some reason this range isn't working when I add a pattern. It does, however, work if I take the * out and make it a range of type EQ.
Any idea?
Regards,
Davis
2008 Oct 23 1:20 AM
I has to be cleared. I clear and refresh r_objnr prior to filling it and I don't even specify the high. The select, with the range, works in this example:
coss-objnr = KS60000000054503
However, if coss-objnr = KS600000000545031111 then it doesn't pick up this record. It is as if the pattern isn't working for some reason.
I has to be cleared. I clear and refresh r_objnr prior to filling it and I don't even specify the high. The select, with the range, works in this example:
coss-objnr = KS60000000054503
However, if coss-objnr = KS600000000545031111 then it doesn't pick up this record. It is as if the pattern isn't working for some reason.
2008 Oct 23 12:28 AM
Can you post the entries in r_objnr when it works and also when it doesnt work. It should work the way you coded, but there mgith be just some small oversight somewhere
2008 Oct 23 12:39 AM
Sure, this is the record that doesn't work:
Sign = I
Option = CP
Low = KS60000000054501*
High = KS60000000054501*
The one that does work:
Sign = I
Option = EQ
Low = KS60000000054501
High = KS60000000054501
2008 Oct 23 12:41 AM
OK, I just took out the high, and it worked. I guess maybe you can't use a CP and a high and low if the high and low are the same. Does that some right?
I lied, it is bringing in the same records as the "EQ" range does; it doesn't pick up the pattern.
Davis
Edited by: Davis on Oct 22, 2008 7:42 PM
2008 Oct 23 12:43 AM
Thats correct, you can t use a pattern if the low and high values are same. If you have a different high value then only you shoudl use ICP with Low and High, else it shoudl be ICP with just low
2008 Oct 23 12:45 AM
and you can verify that easily,
DO SE16 on any table say TRDIR, put Z* for both low and high, and it will not bring anything, but if you remove high value and ljust leave low as Z* it will work
2008 Oct 23 12:48 AM
I did a select (SE16) on COSS using OBJNR = KS60000000054503* and it returns records. When the program runs using the following:
r_objnr-sign = I
r_objnr-option = CP
r_objnr-low = KS60000000054503*
SELECT * INTO TABLE it_coss FROM coss WHERE objnr IN r_objnr.
This does not return anything but, according to SE16, it should.
If I, in my program, change it to
SELECT * INTO TABLE it_coss FROM coss WHERE objnr like 'KS60000000054503%'.
It works. However, I need the range
Edited by: Davis on Oct 22, 2008 7:49 PM
2008 Oct 23 1:08 AM
did you forget to put append for r_objnr here
r_objnr-sign = I
r_objnr-option = CP
r_objnr-low = KS60000000054503*
SELECT * INTO TABLE it_coss FROM coss WHERE objnr IN r_objnr.
2008 Oct 23 1:11 AM
No, it was appended. I just forgot to put that in the post, sorry.
Regards,
Davis
2008 Oct 23 1:16 AM
I am thinking your r_objnr-high is not cleared somehow. Can you debug and check the entry in r_objnr right at select statement. if you post the entry row here, I will check further
2008 Oct 23 1:20 AM
I has to be cleared. I clear and refresh r_objnr prior to filling it and I don't even specify the high. The select, with the range, works in this example:
coss-objnr = KS60000000054503
However, if coss-objnr = KS600000000545031111 then it doesn't pick up this record. It is as if the pattern isn't working for some reason.
2008 Oct 23 1:27 AM
pattern should work, there migth be some small oversight somewhere
2008 Oct 23 1:48 AM
I'm an idiot. I need KL instead of KS.
Thanks for your help though.
Davis
2008 Oct 23 1:51 AM
good to know. thats what I was saying it has to be some minor oversight somewhere
2008 Oct 23 1:53 AM
When I saw your last post I decided to double-check SE16 against the debugger and it jumped out at me. I thought I checked for all oversights but not that one.
Thanks again.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |