* ab V7.31
* http://zevolving.com/2013/07/abap-string-templates-new-feature-in-abap-731/
* Hinweis: String-Templates funktionieren nur Programmen bei denen die Unicodeprüfung aktiv ist!
* Z.B. kommt es in Modulpool-Programmen zu Fehlern beim kompilieren des Codes und der Compiler moniert die '|'-Symbole
DATA: text TYPE string VALUE 'Text'.
DATA: atext TYPE string VALUE '012345'.
DATA: num TYPE p DECIMALS 3 VALUE '-123.45'.
* Case
WRITE: / |RAW: { text CASE = RAW }|. " Text
WRITE: / |LOWER: { text CASE = LOWER }|. " text
WRITE: / |UPPER: { text CASE = UPPER }|. " TEXT
* Align
WRITE: / |LEFT: ->{ text WIDTH = 20 ALIGN = LEFT }<--|. " >Text <
WRITE: / |RIGHT: ->{ text WIDTH = 20 ALIGN = RIGHT }<--|. " > Text<
WRITE: / |CENTER: ->{ text WIDTH = 20 ALIGN = CENTER }<--|. " > Text <
* Padding, Auffüllen mit definiertem Zeichen
WRITE: / |PAD: { text ALIGN = LEFT WIDTH = 20 PAD = '_' }|. " Text________________
WRITE: / |PAD: { text ALIGN = RIGHT WIDTH = 20 PAD = '_' }|. " ________________Text
WRITE: / |PAD: { text ALIGN = CENTER WIDTH = 20 PAD = '_' }|. " ________Text________
* führende Nullen hinzufügen, ersetzt FUBA 'CONVERSION_EXIT_ALPHA_INPUT'
WRITE: / |ALPHA: { atext WIDTH = 20 ALPHA = IN }|. " 00000000000000012345
* führende Nullen entfernen, ersetzt FUBA 'CONVERSION_EXIT_ALPHA_OUTPUT'
WRITE: / |ALPHA: { atext ALPHA = OUT }|. " 12345
* Zahlen 1
WRITE: / |RAW: { num NUMBER = RAW }|. " -123.45
WRITE: / |USER: { num NUMBER = USER }|. " -123,45
WRITE: / |ENVIRONMENT: { num NUMBER = ENVIRONMENT }|. " -123,45
* Zahlen 2
WRITE: / |SCIENTIFIC: { num STYLE = SCIENTIFIC }|. " -1.2345E+02
WRITE: / |SCIENTIFIC_WITH_LEADING_ZERO: { num STYLE = SCIENTIFIC_WITH_LEADING_ZERO }|. " -0.12345E+03
WRITE: / |SCALE_PRESERVING_SCIENTIFIC: { num STYLE = SCALE_PRESERVING_SCIENTIFIC }|. " -1.2345E+0002
WRITE: / |ENGINEERING: { num STYLE = ENGINEERING }|. " -123.45E+00
* Datumsformat
WRITE: / |RAW: { sy-datum DATE = RAW }|. " 20160705
WRITE: / |ISO: { sy-datum DATE = ISO }|. " 2016-07-05
WRITE: / |USER: { sy-datum DATE = USER }|. " 05.07.2016
WRITE: / |ENVIRONMENT: { sy-datum DATE = ENVIRONMENT }|. " 05.07.2016
* Uhrzeitformat
WRITE: / |RAW: { sy-uzeit TIME = RAW }|. " 102336
WRITE: / |ISO: { sy-uzeit TIME = ISO }|. " 10:23:36
WRITE: / |USER: { sy-uzeit TIME = USER }|. " 10:23:36
WRITE: / |ENVIRONMENT: { sy-uzeit TIME = ENVIRONMENT }|. " 10:23:36
* Timestampformat
DATA: lv_tsl TYPE timestampl.
* Zeitstempel lang
GET TIME STAMP FIELD lv_tsl.
WRITE: / |SPACE: { lv_tsl TIMESTAMP = SPACE }|. " 2016-07-05 08:23:36.0908600
WRITE: / |ISO: { lv_tsl TIMESTAMP = ISO }|. " 2016-07-05T08:23:36,0908600
WRITE: / |USER: { lv_tsl TIMESTAMP = USER }|. " 05.07.2016 08:23:36,0908600
WRITE: / |ENVIRONMENT: { lv_tsl TIMESTAMP = ENVIRONMENT }|. " 05.07.2016 08:23:36,0908600
* ABAP Serialization XML (axXML)
WRITE: / |XML: { lv_tsl XSD = YES }|. " 20160705082336.09086