SAP Database

CONCATENATE : ABAP Keyword a day

Print This Post Email This Post Written by admin on Nov 17th, 2007 | Filed under: ABAP Keywords

CONCATENATE

Basic form
CONCATENATE f1 … fn INTO g.
Addition
… SEPARATED BY h

Effect
Places the fields f1 to fn after g .

With the fields fi (1 <= i <= n), trailing blanks are ignored, i.e. these fields are considered only to have the length STRLEN ( fi ). The return code value is set as follows: SY-SUBRC = 0 The result fits in g . SY_SUBRC = 4 The result was too long for g and was only copied to g in that length. Example DATA: ONE(10) VALUE 'John', TWO(3) VALUE ' F.', THREE(10) VALUE ' Kennedy', NAME(20). CONCATENATE ONE TWO THREE INTO NAME. Then, NAME contains the value " John F. Kennedy ". Addition ... SEPARATED BY h Effect Inserts the separator h between the fields fi . Here, h is used in its defined length. Examples DATA: ONE(10) VALUE 'John', TWO(3) VALUE 'F.', THREE(10) VALUE 'Kennedy', NAME(20). CONCATENATE ONE TWO THREE INTO NAME SEPARATED BY SPACE. Then, NAME has the value " John F. Kennedy ". DATA SEPARATOR(4) VALUE 'USA'. CONCATENATE SPACE ONE TWO THREE INTO NAME SEPARATED BY SEPARATOR. Then, NAME has the value " USA JohnUSA F.USA Ke ". The return value of SY-SUBRC is set to 4. Related SPLIT, SHIFT, REPLACE, TRANSLATE, CONDENSE Note Performance You are recommended to use the key word CONCATENATE rather than your own constructions because it is safer, more efficient and clearer. The runtime required to append two 30-byte fields amounts to approx. 14 msn (standardized microseconds). --------------------- ABAPer, mail: abap.community@gmail.com http://abaplearner.blogspot.com

If you like this post, you may as well like these too:

  1. CONDENSE : ABAP Keyword a day CONDENSEBasic formCONDENSE c.Addition… NO-GAPS EffectShifts 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),...
  2. CLEAR : ABAP Keyword a day CLEARBasic formCLEAR f.Additions 1. … WITH g2. … WITH NULL EffectResets the contents of f to its initial value. For predefined types (see DATA ), the following initial values...
  3. COLLECT : ABAP Keyword a day COLLECTBasic formCOLLECT [wa INTO] itab.Addition… SORTED BY fEffectCOLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab...
  4. 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...
  5. EXPORT : ABAP Keyword a day EXPORT *Export data - EXPORT obj1 ... objn TO MEMORY. - EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key. - EXPORT obj1 ... objn TO DATASET dsn(ar) ID...



Leave a Reply

  • Help Support CRY