Online Tutorials & Training Materials | STechies.com
Register Login

CONDENSE Statement to Remove, Trim Leading Spaces from a String

|| || 0

CONDENSE Statement to Remove, Trim Leading Spaces from a String
Stechies

CONDENSE Statement to Remove Spaces in Strings in SAP ABAP

For removing leading and closing blank completely and convert a sequence of blanks into a single blank for a string "CONDENSE statement in ABAP is used".

Syntax Used for it: CONDENSE text [NO-GAPS]

For removing the entire blank spaces the addition NO-GAPS is used.

To remove leading spaces and trailing spaces we can make use of CONDENSE

Eg: CONDENSE inputText .
length = STRLEN( inputText ).
WRITE: 'Input :' , inputText.
WRITE: / 'Length: ', length.

To remove leading spaces in character field we can use SHIFT ----LEFT---

Eg: DATA V_CURR(17).
V_CURR = ITAB-CUR_FIELD.
SHIFT V_CURR LEFT DELETING LEADING SPACE.
WRITE / V_CURR.

To remove the spaces between words in the given text Use CONDENSE input text NO_GAPS

Eg: CONDENSE inputText NO-GAPS.
length = STRLEN( inputText ).
WRITE: 'Input :' , inputText.
WRITE: / 'Length: ', length.


Related Articles

0.0136 seconds.