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

How to use Upper in a select statement from database table

0 Likes
1,268

Hello,

I want to select entries from table adr6 where Upper(smtp_addr) in @s_addr.

This is my code, what modification is needed? How can I use Upper in a select statement from database table?

SELECT addrnumber, persnumber, smtp_addr FROM adr6
FOR ALL ENTRIES IN @lt_adddr
WHERE addrnumber = @lt_adddr-addrnumber
AND smtp_addr IN @s_addr
INTO TABLE @DATA(lt_adr6).

Hello,

I want to select entries from table adr6 where Upper(smtp_addr) in @s_addr.

This is my code, what modification is needed? How can I use Upper in a select statement from database table?

SELECT addrnumber, persnumber, smtp_addr FROM adr6
FOR ALL ENTRIES IN @lt_adddr
WHERE addrnumber = @lt_adddr-addrnumber
AND smtp_addr IN @s_addr
INTO TABLE @DATA(lt_adr6).
2 REPLIES 2
Read only

_4ndr3as_
Explorer
0 Likes
1,184

Ciao Imen,

maybe you can use CAST to move info to a uppercase data element. SQL Expressions, Cast Expression - ABAP Keyword Documentation (sap.com). Not sure if this works, but it's a try.

Regards Andreas

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,184

This is the link: sql_cond - IN range_tab for

SELECT ... WHERE ... operand IN ranges_table ...

For operand, the doc says:

  • The following applies to operand:
    • SQL expressions except for aggregate expressions and window expressions can be specified.
    • In a HAVING clause, aggregate expressions can also be used.