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

Select statement-Problem while case sensitve

Former Member
0 Likes
725

HI All,

I am trying to select the Material number(MATNR) from MARA based on the old material number(BISMT).

SELECT MATNR FROM MARA INTO ITAB_MARA

FOR ALL ENTRIES IN ITAB

WHERE BISMT = ITAB-BISMT.

The field MARA-BISMT contains data in upper case and my Internal table contains as lower case.So the select statement is not populating the corresponding records.

Please let me know is it possible to give a check in the select statement.

Or is there any way to change the BISMT column data in ITAB to upper case in one shot rather than going for TRANSLATE in a loop.

Thanks,

Savitha

5 REPLIES 5
Read only

ian_maxwell2
Active Participant
0 Likes
676

I think that your only way to do it is to update your internal table first and change the case. I don't belive that SAP's Open SQL contains an operator that allows you to compare ignoring case. Atleast not that I remember seeing ever.

There isn't an easy way to do it updating all records for that field in one shot, but from a performance perspecitive if there was a command that could do it it would be doing a loop anyways in it's implimentation so it should be ok.

I would suggest that the best optimized loop for this would be to do a loop assigning the record to a field- symbol instead of into a work-area. By using a field symbol you can directly access the data in the internal table and also it is faster since it isn't doing any transfer of data. In the loop you can then do a conversion to uper case on the field.

~Ian

Read only

Former Member
0 Likes
676

Hi savitha,

No other way u need to convert itab content in to lower case...

Read only

Former Member
0 Likes
676

Hi Savitha,

I think the only way is to convert the internal table data into UPPER case and you need to loop at that internal table and use the statement TRANSLATE.

LOOP AT ITAB.

TRANSLATE ITAB-BISMT TO UPPER CASE.

MODIFY ITAB.

ENDLOOP.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
676

FROM WHERE YOU ARE GETTING THIS, Which table you are using?

ITAB-BISMT

Read only

Former Member
0 Likes
676

HI,

From where you are getting data into ITAB? If it is a Z table, while inputing data into Z table, you can convert into upper case.

the only other way is to loop through ITAB and use TRANSLATE command to convert the data into upper case.

And also you have to check for the preceeding zeros for fields, if any you are using in WHERE clause in other SELECT statements. Use CONVERSION_EXIT_ALPHA_INPUT to add leading zeros to the field