CONDENSE : ABAP Keyword a day
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 microseconds). The variant … NO-GAPS needs about 12 msn.
———————
ABAPer, mail: abap.community@gmail.com http://abaplearner.blogspot.com
If you like this post, you may as well like these too:
- ABAP Keyword a day : ADD ADD Variants: 1. ADD n TO m. 2. ADD n1 THEN n2 UNTIL nz GIVING m. [...]...
- ADD-CORRESPONDING : ABAP Keyword a day ADD-CORRESPONDING Basic form ADD-CORRESPONDING rec1 TO rec2. Effect Interprets rec1 and rec2 as field strings. If, for example, rec1 and rec2 are tables, executes the statement for their header...
- AT : ABAP Keyword a day AT Events in lists- AT LINE-SELECTION.- AT USER-COMMAND.- AT PFn.Events on selection screens- AT SELECTION-SCREEN.Control break with extracts- AT NEW f.- AT END OF f.- AT FIRST.- AT LAST.- AT...
- CNT : ABAP Keyword a day CNT Basic form… CNT(h) …EffectCNT(h) is not a statement, but a field which is automatically created and filled by the system if f is a sub-field of an extract dataset...
- DO : ABAP Keyword a day DO Variants 1. DO. 2. DO n TIMES. Variant 1 DO. Addition … VARYING f FROM f1 NEXT f2 Effect Repeats the processing enclosed by the DO and ENDDO statements...
















Leave a Reply