2023 Jun 16 12:21 AM
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?
2023 Jun 16 9:27 AM
Use the F1 key on the Abap Editor, or look in online help
2023 Jun 16 6:45 AM
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
2023 Jun 16 7:14 AM
2023 Jun 16 2:51 PM
2023 Jun 16 8:32 AM
Bis repetita what Tow Wan said: look at the ABAP documentation for SELECT-OPTIONS:
SELECT-OPTIONS ... LOWER CASE ...
2023 Jun 16 9:27 AM
Use the F1 key on the Abap Editor, or look in online help
2023 Jun 16 9:29 AM
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.
2023 Jun 16 2:37 PM
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.