Remove spaces from character field (CONDENSE)

The CONDENSE command is used to remove spaces from a character field. See example below.

*Code to demonstrate CONDENSE command
DATA: ld_field(50) type c.
p_field = 'Welcome to SAPDev'.
CONDENSE p_field NO-GAPS.  "P_field must be of type character
*Result of p_field would be: 'WelcometoSAPDev'.


Related Articles

Data manipulation - Example code and information on various data manipulation techniques
Retrun the fraction / whole value of a decimal number using MOD, DIV, FRAC or SHIFT
Move minus sign(-) from end to start of field
ABAP Round functionality to round values down to nearest value based on your decimal place requirement
Round ABAP values up to the nearest value
Inserting TAB's into text strings
Change characters within a string ( TRANSLATE )