Posts

Showing posts with the label When To

Difference between Chaining operator(&&) and Literal Operator(&)

Image
Recently I talked about the Chaining Operator(&&) and how it simplifies dealing with texts and strings. I wanted to talk about a similar-looking operator with some similar functions to the chaining operator which makes it easy to confuse each other. A literal operator( & ) is used to join two or more literals to produce a single literal. However, there is a hard character length limit of 255. Example of using a literal operator: There are more features and limitations to a literal operator. Below are the points on which it's similar/different to a Chaining operator.     - Similar to the chaining operator, you can use join string templates using & .     - Any trailing blank in text field literals is preserved, unlike chaining operator.     - Can span multiline:      - Calculated at compile-time.     -  Can not have more than 255 c...

ABAP text field literal vs text string literal

Have you ever had a variable containing text? I am sure you did and regularly do. What is your preferred way to do declare it? If you don't know or use the second option, then this post is for you. There is a minute difference in the way text literal has been defined in options one and two.  First of all the declaration is a literal being passed to a variable, and some of you may ask: what is a literal?     L iterals are defined in the source code of a program by specifying a string representing a value.     Possible literals are numeric literals and character literals. The character literal comprises text       field literals and text string literals. So there are two kinds of text literal, let's see them in detail. Text Field Literals:   - Defined using single inverted commas (').   - Data type is c  with the length of the included characters, including trailing blanks.   ...

ABAP BOOLC and XSDBOOL use-cases

 In the previous post  ABAP Convert Logical Expressions Into Boolean Values , I talked about BOOLC and XSDBOOL functions and their respective features. I thought I would elaborate on their use cases with examples. BOOLC: Set boolean flag: