CONDENSE (ABAP Keyword)

CONDENSE (ABAP Keyword) introduction & details

CONDENSE


Basic form
CONDENSE c.

Addition



... NO-GAPS


Effect
Shifts the contents of the field c to the left, so that each word is separated by exactly one blank.

Example

DATA: BEGIN OF NAME,
TITLE(8), VALUE 'Dr.',
FIRST_NAME(10), VALUE 'Michael',
SURNAME(10), VALUE 'Hofmann',
END OF NAME.
CONDENSE NAME.
WRITE NAME.


produces the output:

Dr. Michael Hofmann

Addition
... NO-GAPS

Effect
Suppresses all blanks from the field c

Example

DATA: BEGIN OF NAME,
TITLE(8), VALUE 'Dr.',
FIRST_NAME(10), VALUE 'Michael',
SURNAME(10), VALUE 'Hofmann',
END OF NAME.
CONDENSE NAME NO-GAPS.


The contents of NAME is now " Dr.MichaelHofmann ".

Since the field string NAME is interpreted and handled like a type C field, the CONDENSE statement treats it as a whole and ignores any sub-fields. The contents of the component field would therefore now be as follows:

NAME-TITLE = 'Dr.Micha'
NAME-FIRST_NAME = 'elHofmann '
NAME-SURNAME = ' '

Note
Do not use CONDENSE to manipulate field strings that include fields not of type C. This could result in these component fields containing characters of a different (i.e. incorrect) type.
Related SHIFT , CONCATENATE , REPLACE , SPLIT

Note
Performance
The runtime required to condense three fields is about 20 msn (standardized micooseconds). The variant ... NO-GAPS needs about 12 msn.

Most readed SAP Tutorials

Latest Added SAP documents

Custom Search
ABAP Tutorials ABAP Syntax BAPI SAP Jobs SAP Glossary SAP Netweaver SAP XI SAP Download SAP Interview questions

Complete SAP Study materials | SAP JOBS | PDF Tutorials   List of SAP Companies India

Google-Translate-Chinese (Simplified) BETA Google-Translate-English to French Google-Translate-English to German Google-Translate-English to Italian Google-Translate-English to Japanese BETA Google-Translate-English to Korean BETA Google-Translate-English to Russian BETA Google-Translate-English to Spanish

All of the product names here are trademarks of their respective companies. The site sapbrainsonline.com no way affiliated with SAP AG. Use information on this site at your own risk. Information furnished in the site is collected from various sites and posts from users. This site does not host any files on its server. If any compliants about the posts please contact us at sapbrain.support@gmail.com

Sitemap
web counter