‎2008 Aug 01 2:05 AM
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
‎2008 Aug 01 2:13 AM
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
‎2008 Aug 01 4:18 AM
Hi savitha,
No other way u need to convert itab content in to lower case...
‎2008 Aug 01 4:38 AM
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
‎2008 Aug 01 4:40 AM
FROM WHERE YOU ARE GETTING THIS, Which table you are using?
ITAB-BISMT
‎2008 Aug 01 6:52 AM
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