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

Data fetch problem from EBAN table

Former Member
0 Likes
1,615

Hi All,

I have a problem in data fetching. My SQL statement is

SELECT A~BANFN

A~FRGDT

A~MATNR

A~MENGE

A~MEINS

A~AFNAM

A~EKGRP

A~PRIO_URG

A~STATU

A~RLWRT

A~EBELN

A~LOEKZ

A~EBELP

A~FRGKZ

INTO CORRESPONDING FIELDS OF TABLE ITAB_DATA

FROM EBAN AS A

WHERE A~STATU IN S_STATU

AND A~EKGRP = S_EKGRP

AND A~BANPR = '05'

AND AFNAM IN P_AFNAM

AND BEDNR IN P_BEDNR .

In EBAN table data in AFNAM field is like 'Mech', 'mech' & 'Mech'

Now in selection screen if user give Mech then system picks only that data where 'Mech' is there but requirement is it should pick all data related to ('Mech', 'mech', 'Mech') in AFNAM field. How do I do?

Thanks and regards,

Rajesh Vasudeva

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,375

Open SQL wont allow you to perform this, so you have to find an other way like one of those proposals :

In the report

- Ignoring this parameter in the WHERE clause of the SELECT statement, then looping at internal table using UPPER function to compare

- Using Native SQL, if upper() function available

- Building a where clause with every possible values (that can give a too big where clause and resume in a dump)

In the update application (in ME51N/ME52N or BAPI)

- Changing the domain to no longer allow lowercase (Updating legacy data before)

- In an exit/BADI/enhancement point converting the data input to uppercase

- Adding a new field in EBAN (CI_EBANDB) and via CMOD on SMOD enhancement MEREQ001 or BADI ME_PROCESS_REQ_CUST copying and converting AFNAM to uppercase in ZZ field

Regards,

Raymond

7 REPLIES 7
Read only

former_member217544
Active Contributor
0 Likes
1,375

Hi Rajesh,

Upto my knowledge, select query behaves in that way only. One work around is to take care of this field while updating itself.

During update convert all letters to upper case and save. And also while fetching, convert the parameters data to upper case and then fetch using the select query.

Regards,

Swarna Munukoti.

Read only

former_member217544
Active Contributor
0 Likes
1,375

Hi Rajesh,

Upto my knowledge, select query behaves in that way only. One work around is to take care of this field while updating itself.

During update convert all letters to upper case and save. And also while fetching, convert the parameters data to upper case and then fetch using the select query.

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
1,375

Hello,

What you ask is not easy but it is feasible.

We had the same request to make a case-insensitive search on a text field.

As a reference for our development we took the following example:

[http://wiki.sdn.sap.com/wiki/display/Snippets/CaseInsensitiveSearchHelpExitforMaterialGroup|http://wiki.sdn.sap.com/wiki/display/Snippets/CaseInsensitiveSearchHelpExitforMaterialGroup]

In short : the purpose is that first of all you build up a list of all possible values in a separate internal table.

Then use this separate internal table in the FOR ALL ENTRIES clause when you perform the select on the actual data.

Success.

Wim

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,376

Open SQL wont allow you to perform this, so you have to find an other way like one of those proposals :

In the report

- Ignoring this parameter in the WHERE clause of the SELECT statement, then looping at internal table using UPPER function to compare

- Using Native SQL, if upper() function available

- Building a where clause with every possible values (that can give a too big where clause and resume in a dump)

In the update application (in ME51N/ME52N or BAPI)

- Changing the domain to no longer allow lowercase (Updating legacy data before)

- In an exit/BADI/enhancement point converting the data input to uppercase

- Adding a new field in EBAN (CI_EBANDB) and via CMOD on SMOD enhancement MEREQ001 or BADI ME_PROCESS_REQ_CUST copying and converting AFNAM to uppercase in ZZ field

Regards,

Raymond

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,375

Hello Raymond,

Using Native SQL, if upper() function available

Why did you add "If available" clause ? I was thinking the easiest solution will be to use Native SQL.

BR,

Suhas

Read only

0 Likes
1,375

I worked some (long) time ago on SQL versions with some "unpredictable" results when using such functions, you should not get any trouble with the current versions which support SAP server, as the page code are well managed of course, remember there are differences between langages.

Regards,

Raymond

Read only

0 Likes
1,375

Thanx Raymond

I use Ist option suggested by you and it serves my purpose. Thanx a lot.

regards

Rajesh Vasudeva