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: 

Upper Case and Lower Case

Former Member
0 Kudos

Helllo Friends,

Facing one problem, while selecting data from the table KNA1 in where clause .

Lets take example :

If data in the table in name field is shilpi agarwal

and i am selecting Shilpi Agarwal in which S,A in caps then it is not selecting .

If data in the table in name field is Shilpi Agarwal

and i am selecting shilpi Agarwal in which S,A in caps then also it is not selecting .

means if the case in records and section creteria same then only it select .

Please provde me feasible soln

5 REPLIES 5

Former Member
0 Kudos

Hi,

I think it is not wise to select data based on names and SAP is case sensitive in certain Areas...

Say for example it has 'test name' as the field content then it will not detect any other case combinations at all.

So the best thing for you to select is based on the number and not the name.

If you still want to select based on name.

You have to select all the data from KNA1 without anyselection.

Convert all the selected names to uppercase/lowercase

Keep your selection criterion also in the same case.

Compare and take it out from the internal table using loop and read statement.

Regards,

Pramod

0 Kudos

My req is like that only .

oops ... this is very time consuming for simple query and thats not feasible.

0 Kudos

Exactly..

When your requirement is out of ordinary right then possibilities are that your code will be out of performance too.

This is a normal DB protocol where you can only use a primary key for unique selection and i suppose a name cant be a primary key.

Although this is quite time consuming this will help you out for this requirement.

Regards,

Pramod

Former Member
0 Kudos

While selecting data from KNA1 table, dont specify NAME1 or NAME2 in the select query.

After getting the data in Internal Table, you can then loop at table and use CS to get the required data.


LOOP AT t_kna1 INTO wa_kna1.
  IF wa_kna1-name1 CS p_name.
  ELSE.
    DELETE t_kna1.
    CONTINUE.
  ENDIF.
ENDLOOP.

Edited by: Swastik Bharati on Oct 15, 2008 9:29 AM

0 Kudos

Thats some wht same answer of parmod .

Is there any cond which i put in select.