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

SLIN-Greater/lesser than comparisons w/ character type operands not portabl

Hi Experts,

As am downloading the data from UNIX file into my_itab, I was defined my_itab with CHAR format fields.

My issue code is,

LOOP AT t_qty WHERE matnr =my_itab-matnr

AND menge LT my_itab-menge.

------ some logic

ENDLOOP.

But, when am running the SLIN for this, am getting the following error!!

Greater than/less than comparisons with character type operands may not be

portable

(You can hide the message using "#EC PORTABLE)

I understood the message, but, pls. let me know that

1 - Is it danger some times, if it is moved to Production?

2 - Is it results in INCORRECTness/data?

3- or just SAP lettig me know, to correct for good prog. standards?

thanq

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 17, 2008 at 08:29 PM

    Hi.

    If I understand your right you have defined my_itab-menge as char(x). Now you are using an operation like 'LT' on characters. This should be avoided. The SLIN-message is pointing into the right direction. The result of an comparison of characters (other than equality) depends on your operating system / codepage. As an example

    'A' LT '1' gives different results when executed on an EBCDIC-system and an ASCII-system.

    In most cases all your systems are running the same setup but you should know there are pitfals. A good program should not rely on a specific codepage.

    Best regards,

    Jan Stallkamp

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 07:31 PM

    Hello,

    If you use the where like you did maybe you lost some data.

    I suggest you to change the code like follows:

    LOOP AT t_qty WHERE matnr = my_itab-matnr.
      CHECK qty-menge LT my_itab-menge.
    ------ some logic
    ENDLOOP.
    

    Regards.

    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.