sapdev logo background
sapdev logo sapdev logo
Comments

SAP STRING PROCESSING OPERANDS documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

Operands in Character String and Byte String Processing

Operands in Character String Processing
If you use character string processing (defined by the addition IN CHARACTER MODE in overloaded statements) and statements that only support character string processing, the relevant operands must be character-like. This is because the operands are processed by character and the repository of the characters in the memory is dependent on the code page used. This is absolutely essential for character string processing to work properly.
  • It is checked, however, in different ways: In non-Unicode programs, breaking this rule causes a syntax error or exception only in classes. Outside of classes, breaking the rule in non-Unicode programs just produces a warning in the syntax check, and no exceptions.

  • In Unicode programs, both the syntax check and runtime checks check the rule inside and outside classes.

  • Note also that the concept "character-like" (or "character-type") is more strictly defined in Unicode programs than in non-Unicode programs.
  • In Unicode programs, only data objects with the character-like data types c , d , n , t , and string , or structures with purely character-like components are themselves character-like. Data objects with the types d , n , and

  • t and structures with purely character-like components are handled like data objects with the type c (implicit casting is used).
  • In non-Unicode programs, any flat structures and byte-like data objects can be character-like. These operands of non-character-like data types are also handled like character-like data objects with the type c (implicit casting), regardless of their type.

  • This last point enables character string processing of byte strings in non-Unicode programs to produce the same results as explicit byte string processing in Unicode programs, if the statement is suitable as defined in the table of statements .

    Note
    When you use the character-like data objects d , n , and t in character string processing, note that the conversion rules appropriate to type do not apply to the assignment of interim results to target fields; instead the conversion rules for data type c apply.

    Operands in Byte String Processing
    If you use byte string processing (defined by the addition IN BYTE MODE in overloaded statements) and the statements GET BIT and SET BIT , the relevant operands must be byte-like. This is because the operands are processed by byte. This rule applies both inside and outside classes and in both Unicode and non-Unicode programs .
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    STRING_PROCESSING_EXPR_FUNC
    STRING_PROCESSING_OVIEW




    comments powered by Disqus