STRING OPERATIONS??
SAP

STRING OPERATIONS??

STRING OPERATIONS- CONDENSE

In SAP ABAP, the CONDENSE statement is used for string operations to remove leading and trailing spaces from a string. Here’s how it works:

CONDENSE
OUTPUT.

  • CONDENSE removes all leading and trailing spaces from the string and compresses multiple consecutive spaces within the string to a single space. It does not affect spaces between words or characters within the string.
  • CONDENSE is particularly useful when dealing with user input or data extracted from databases, where spaces can inadvertently affect comparisons or display.
  • It simplifies string handling by ensuring consistent formatting without unnecessary spaces.


STRING OPERATIONS- FIND

The FIND statement is used for string operations to locate the position of a substring within a string. Here’s how it works:

FIND
OUTPUT


  • FIND is case-sensitive in its search.
  • To perform a case-insensitive search, you can convert both lv_string and lv_substring to uppercase or lowercase using TRANSLATE lv_string TO UPPER CASE or TRANSLATE lv_substring TO UPPER CASE before performing the FIND operation.
  • If you need to find subsequent occurrences of lv_substring, you can use FIND NEXT instead of FIND.

STRING OPERATIONS- TRANSLATE.

The purpose of translation is to convert the string to upper case or lower case.

TRANSLATE
RESULT

STRING OPERATIONS- TRANSLATE using pattern

In SAP ABAP, the TRANSLATE ... USING statement allows you to perform character translations based on a pattern. This is particularly useful when you want to replace or delete characters based on a set of rules defined by the pattern. Here’s how you can use TRANSLATE with a pattern:

TRANSLATE USING PATTERN
OUTPUT

STRING OPERATIONS- SHIFT

In SAP ABAP, the SHIFT the statement is used for string operations to move characters within a string to the left, right, and circular. It is particularly useful for manipulating strings by shifting character positions based on specified offsets. Here’s how it works:

SHIFT
OUTPUT

SHIFT RIGHT/LEFT DELETING TRAILING '0'.

In SAP ABAP, when you want to shift a string to the left or right while deleting trailing zeros, you can achieve this using the SHIFT statement in combination with other string operations. Here’s how you can accomplish this:

SHIFT RIGHT/LEFT DELETING TRAILING '0'.
OUTPUT.

  • SHIFT <string> RIGHT/LEFT DELETING TRAILING '0': This syntax tells SAP ABAP to shift the characters in <string> either to the right or left, while simultaneously removing any trailing zeros ('0').
  • The DELETING TRAILING '0' addition ensures that after the shift operation, any zeros at the end of the string are removed.

STRING OPERATIONS- SUBSTRING PROCESSING.

In SAP ABAP, substring processing involves extracting portions of a string based on specified starting positions and lengths. This is useful for manipulating and working with parts of a larger string within your ABAP programs. Here’s how you can perform substring operations:

The basic syntax for substring processing in SAP ABAP typically involves using the SUBSTRING statement or the SUBSTRING function module:

SUBSTRING PROCESSING
OUTPUT.


THANK YOU FOR READING??











要查看或添加评论,请登录

Pallavi Kumari的更多文章

  • Module Pool Vs ALV (ABAP List Viewer)??

    Module Pool Vs ALV (ABAP List Viewer)??

    what is a module pool, what is the purpose of a module pool, and how it is different from alv? In SAP, Module Pool and…

  • CLASSICAL REPORT EVENT??

    CLASSICAL REPORT EVENT??

    WHAT IS A CLASSICAL REPORT EVENT?? classical reports are basic reports that generate lists of data. They use a…

  • JOIN

    JOIN

    WHAT IS JOIN ?? In SAP ABAP, a "join" refers to the process of combining records from two or more database tables based…

  • SAP ABAP CONCEPTS??

    SAP ABAP CONCEPTS??

    SAP ABAP internal table with header line or without header line. In SAP ABAP, internal tables can be defined with or…

  • TYPES OF INTERNAL TABLES ??

    TYPES OF INTERNAL TABLES ??

    In SAP ABAP, internal tables are a fundamental data structure used to store and manipulate data within programs. There…

  • INTERNAL TABLE OPERATIONS??

    INTERNAL TABLE OPERATIONS??

    INTERNAL TABLE: Internal table operations typically refer to actions performed on tables that are managed within the…

  • INTERNAL TABLES & WORKAREA??

    INTERNAL TABLES & WORKAREA??

    WHAT IS INTERNAL TABLE???♀? In SAP ABAP (Advanced Business Application Programming), an internal table is a data…

  • SYSTEM VARIABLE & STRING OPERATIONS????

    SYSTEM VARIABLE & STRING OPERATIONS????

    Let's start with the system variable. A system variable refers to a predefined variable provided by the SAP system…

    2 条评论
  • L??????P

    L??????P

    After knowing about the IF statement and CASE Statement, now we will know about their differences. IF VS CASE STATEMENT…

    1 条评论
  • SAP ABAP

    SAP ABAP

    Conditional Statement?? In SAP ABAP, conditional statements are used to control the flow of the program execution based…

社区洞察

其他会员也浏览了