Application Development 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: 

Select in both upper and lower case on text tables- Is it possible

Former Member
0 Kudos

Hi all,

I have below data in my data base.

SULPH1

SULPH2

Sulph3

I am querying the descritpion table with like operatior. if I query with SUL, I am getting 2 records, If I query with Sul I am getting only one record. it is possible to get all the 3 reocrds in one search like SUL or Sul?

Thanks in Advacne.

Vr reddi.

7 REPLIES 7

Former Member
0 Kudos

Hi,

Check if the checkbox "Lowercase" is checked in the domain level of the field. If its checked then you will have to select the whole table, convert to upper or lower case and process accordingly. On which table are you trying to perform this? custom or standard table?

0 Kudos

Hi,

I am querying a custom table. the check box for Lower case is checked for the filed .

Regards,

Vr Reddi.

0 Kudos

It is kinda getting [spooky|; out here in SDN

0 Kudos

Since its a custom table, check if the field 'lowercase' can be unchecked. If thats allowed then you wont have any problem with the select since SAP will convert all the data into uppercase internally.

If thats not possible you have no other option other than selecting the whole table and processing accordingly

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can try with native SQL and it should work.

Clemenss
Active Contributor
0 Kudos

Hi vrreddi,

independent of the lower case indicator programs are still able to store lower case data-

In this case, use

SELECT <whatever or *>
  INTO <target structure>
  FROM <DD TABLE NAME>
  WHERE ...
CONVERT  <target structure-your field> TO UPPERCASE.
CHECK <target structure-your field> IN S_SELECT.
APPEND <target structure> to <internal table>.
ENDSELECT.

Regards,

Clemens

former_member194797
Active Contributor
0 Kudos

Use native SQL like in this example:


data: wwlifnr like lfa1-lifnr.
exec sql performing display.
SELECT lifnr into :wwlifnr
     FROM  LFA1
       WHERE  UPPER(NAME1)  like '%SUL%'
       endexec.
form display.
write: / 'supplier:',  wwlifnr.
endform.