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

Ranges CP question

Former Member
0 Likes
6,811

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,310

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.

14 REPLIES 14
Read only

Former Member
0 Likes
5,310

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

Read only

0 Likes
5,310

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

Read only

Former Member
0 Likes
5,310

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

Read only

0 Likes
5,310

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

Read only

0 Likes
5,310

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

Read only

0 Likes
5,310

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

Read only

0 Likes
5,310

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.

Read only

0 Likes
5,310

No, it was appended. I just forgot to put that in the post, sorry.

Regards,

Davis

Read only

0 Likes
5,310

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

Read only

Former Member
0 Likes
5,311

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.

Read only

0 Likes
5,310

pattern should work, there migth be some small oversight somewhere

Read only

Former Member
0 Likes
5,310

I'm an idiot. I need KL instead of KS.

Thanks for your help though.

Davis

Read only

0 Likes
5,310

good to know. thats what I was saying it has to be some minor oversight somewhere

Read only

0 Likes
5,310

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.