12-23-2017 7:34 PM
Hi in the below query i need the match 'ableinh ' with one select option parameter..
in select option field iam passing '01' or '02' or '03' or etc..
the value of 'ableinh' is '0112' or '01345' or '0287' or '03455' or etc.
i know LIKE work for single value , here i need to fetch multiple records..
SELECT anlage bis tariftyp ableinh FROM eanlh
INTO TABLE lt_eanlh WHERE anlage IN s_instl
AND bis = '99991231'
AND tariftyp IN s_ortyp
AND ableinh = .
please help me.
Thanks
NK
01-08-2018 6:13 PM
The above issue resolved with different approach . I find the field
ableinh in another table te422 , so now I used inner join on tables
eanlh and te422 .
Thanks all for your inputs.
12-23-2017 11:25 PM
Hi NK Reddy, Are you not getting the output if you write the query like below...?
SELECT anlage bis tariftyp ableinh FROM eanlh
INTO TABLE lt_eanlh WHERE anlage IN s_instl
AND bis = '99991231'
AND tariftyp IN s_ortyp
AND ( ableinh = c_0112 OR ableinh = c_01345 OR ableinh = c_0287 OR ableinh = c_03455 ).
12-24-2017 1:57 AM
the field values are dynamically populated on selection screen , they are not fixed, so in runtime my query should compare first 2 characters of ableinh with SELECT-OPTION field value.
Thanks
NK
12-24-2017 4:47 PM
Hi NK Reddy,
Please write the select query as below and enter the select option field value on selection screen as 01* , 02*, 03*
(for the field 's_able'). It should work.
SELECT anlage bis tariftyp ableinh FROM eanlh
INTO TABLE lt_eanlh WHERE anlage IN s_instl
AND bis = '99991231'
AND tariftyp IN s_ortyp
AND ableinh IN s_able.
12-25-2017 12:11 AM
I coded as below ,i but see different issue , on selection field iam passing range '01' to '03' , but it always fetching the records start with 01 , its considering the range ..even tried on on table SE11/SE16 , if you give range 01* to 03* , it only get the records start with '01'.
any idea.. cant really get range of values using pattern?
ls_data-option = 'BT'.
ls_data-sign = 'I'.
if not s_portn-low IS INITIAL.
CONCATENATE s_portn-low '%' INTO ls_data-low .
endif.
if not s_portn-high IS INITIAL.
CONCATENATE s_portn-high '%' INTO ls_data-high .
endif.
APPEND ls_data TO lt_data.
SELECT anlage bis tariftyp ableinh FROM eanlh
INTO TABLE lt_eanlh WHERE anlage IN s_instl
AND bis = '99991231'
AND tariftyp IN s_ortyp
AND ableinh IN lt_data .
12-27-2017 2:08 AM
Hi,
Goodday!
Have you solved this concern?
As per checking my code above did not work but I suggest you to try this work around.
SELECT anlage bis tariftyp ableinh FROM eanlh
INTO TABLE lt_eanlh WHERE anlage IN s_instl
AND bis = '99991231'
AND tariftyp IN s_ortyp.
DELETE lt_eanlh WHERE ableinh(2) NOT IN s_ableinh.
If this concern already solved, please close this thread.
12-29-2017 10:40 PM
Please don't use Answers to post additional information, use Comments instead.
Regarding the question - post the screenshots of the actual values you see in SE16. I don't see any conversion exits in this field in our system so I'm not sure what could be the problem. But with numeric values in CHAR 8 field it is most likely "owls are not what they seem".
P.S. Not sure why you're adding "%" in this code. Use selection variable as is, from the selection screen. No need to make it more complicated.
P.P.S. Just for the giggles why not try *03* pattern and see what happens.
12-30-2017 12:09 AM
If you want any value which starts with 01 or any value which starts with 02 or any value which starts with 03, then initialize your range table with those 3 entries:
SIGN OPTION LOW
I CP 01*
I CP 02*
I CP 03*
EDIT: solution corrected as per Horst remark (thanks!)
12-30-2017 11:19 AM
I'd say the OPTION must be CP instead of EQ and LOW must be '01*', ...
12-30-2017 4:10 PM
01-02-2018 7:07 PM
Hm, this seems to be very peculiar. I don't have the same exact data as OP but tested with T001 table. It looks like if the range is entered using from/to select options (which translates into BT option with LOW/HIGH) then the "to" part is not included in the result.
If I enter 002*, 003*, and 004* as 3 separate items then it correctly finds all items that start with those numbers. But if I enter selection criteria from 002* to 004* then it only includes 002* and 003*. If I change it as up to 005* then 004* shows up.
This is very odd because if I just specify the exact values, e.g. 0020 to 0049 then 0049 is included in the result set. What the deuce? Is there any reasonable explanation? No wonder OP got confused...
01-02-2018 9:02 PM
When using BT the LOW and HIGH are not seen as patterns but just single entries. Since '*' comes before '0' in the ASCII table it will not select any 004 entries when you use HIGH as 004*.
01-02-2018 10:44 PM
01-03-2018 4:45 PM
Thanks for a reply! So essentially there is no "BP" option, like BT one but for the pattern. Weird...
01-08-2018 6:30 PM
01-08-2018 9:02 PM
"The relational operator matches the content of the column seltab-option
and the content of the columns seltab-low and seltab-high is concatenated as the right operand."
I might be slow today but I'm honestly having trouble translating this into "CP with 001*-004* will not find 004* pattern". 🙂 Specific examples could be helpful.
Thank you!
12-30-2017 10:43 AM
12-30-2017 11:08 PM
12-31-2017 11:04 AM
Hi NK,
A lot of people took time and effort in order to help you reach the solution.
I would like to refer you to the rules of engagement section 5:
"5. Share expertise transparently. We are a community based site that encourages public knowledge sharing. Be open about your knowledge and how you obtained it."
Taking that into account, please share your solution and mark helpful/correct answers.
Iftah
SAP Community Moderator
01-08-2018 6:13 PM
The above issue resolved with different approach . I find the field
ableinh in another table te422 , so now I used inner join on tables
eanlh and te422 .
Thanks all for your inputs.