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'.