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: 

Handle upper-case,lower case in Select-options

ricky_shaw
Contributor
0 Kudos

Hi Experts,

When i enter some values in Select-options, they are getting converted to upper & lower cases which is

failing the select query on the same fields for underlying DB table.

My code is below:

select-options: 
                s_lname for LAST_NAME  no intervals,
                s_fname for FIRST_NAME no intervals.

 perform names_case_search changing s_lname s_fname.
    *gv_lname & gv_fname are fields in a Ztable 
	gv_lname = s_lname-low.
    	gv_fname = s_fname-low.
    	gv_city = s_city-low.

**   Data selection
    select * from ztable into table it_outdata
     where ord_no in s_dlno
        and last_name eq gv_lname
        or  first_name eq gv_fname
        and city in s_city.

form names_case_search changing xy_lname like s_lname
                                xy_fname like s_fname.

This form contains logic with offsets to convert upper-case to lower-case & 
vice versa & translate.. etc and assign back to xy_lname & xy_fname.

endform.<br>

Can someone please guide me how to i handle this?

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

Use the F1 key on the Abap Editor, or look in online help

  • To prevent input conversion look for SELECT-OPTIONS option LOWER CASE but selection will require exact matching of upper/lowercae characters
  • To perform a search that ignore lower/upper case (so 'aBc' matches 'Abc') look for SELECT ... WHERE ... UPPER (and convert criteria to upper)
7 REPLIES 7

manfred_reinart
Active Participant
0 Kudos

Hello,

if you want anyone to help please provide a self contained complete example that can be tried out right away.

Have your checked the documentation on select-options and the domain of your fields?

Regards, Manfred

tom_wan
Contributor

option "LOWER CASE" :

0 Kudos

Thank you Tan & Sandra

Sandra_Rossi
Active Contributor
0 Kudos

Bis repetita what Tow Wan said: look at the ABAP documentation for SELECT-OPTIONS:

SELECT-OPTIONS ... LOWER CASE ...

raymond_giuseppi
Active Contributor

Use the F1 key on the Abap Editor, or look in online help

  • To prevent input conversion look for SELECT-OPTIONS option LOWER CASE but selection will require exact matching of upper/lowercae characters
  • To perform a search that ignore lower/upper case (so 'aBc' matches 'Abc') look for SELECT ... WHERE ... UPPER (and convert criteria to upper)

xiswanto
Active Participant

Your code is kind of confusing, you're using select option and yet you are passing the low field value to other field instead of using them directly in the select query.

But anyway, if your problem is to maintain the case sensitivity issue, then you should be using the type which are using domain with lower case enabled option, so that the field could maintain the field input as it is ( not translating it upper or lower case ).

However, if you are saying that the input value you provide must be able to find the data with weird text case ( such as input value: Coding, value in database: cOdiNg ) then i don't think you have any way to solve such case.

ricky_shaw
Contributor
0 Kudos

hi

I upated the code slightly with comments.

The underlying domains for Last_name & First_name are : BU_NAMEP_L & BU_NAMEP_F.

respectively.Can you please try now.