Skip to Content
author's profile photo Former Member
Former Member

Select statement-Problem while case sensitve

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Aug 01, 2008 at 01: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 03:18 AM

    Hi savitha,

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 03: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2008 at 03:40 AM

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

    ITAB-BISMT

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.