Formatoption COUNTRY: Unterschied zwischen den Versionen

Aus SAP Wiki ツ
(Die Seite wurde neu angelegt: „Kategorie:Formatoptionen(ABAP) Abhängig vom Datentyp wird es als Zahl, Datum, Zeit oder Zeitstempel formatiert.<br /> Alternative zu Formatoptionen Form…“)
 
 
Zeile 6: Zeile 6:
==== Datum ====
==== Datum ====


<syntaxhighlight lang="abap" line start="1">
  SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
  SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
  WRITE |{ sy-datum COUNTRY = lv_land_de }|.  
  WRITE |{ sy-datum COUNTRY = lv_land_de }|.  
</syntaxhighlight>
 
<syntaxhighlight lang="abap" line start="1">
  SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
  SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
  WRITE |{ sy-datum COUNTRY = lv_land_us }|.  
  WRITE |{ sy-datum COUNTRY = lv_land_us }|.  
</syntaxhighlight>


==== Uhrzeit ====
==== Uhrzeit ====


<syntaxhighlight lang="abap" line start="1">
  SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
  SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
  WRITE |{ sy-uzeit COUNTRY = lv_land_de }|.  
  WRITE |{ sy-uzeit COUNTRY = lv_land_de }|.
</syntaxhighlight>
   
   
<syntaxhighlight lang="abap" line start="1">
  SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
  SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
  WRITE |{ sy-uzeit COUNTRY = lv_land_us }|.
  WRITE |{ sy-uzeit COUNTRY = lv_land_us }|.
</syntaxhighlight>

Aktuelle Version vom 12. August 2021, 14:17 Uhr

Abhängig vom Datentyp wird es als Zahl, Datum, Zeit oder Zeitstempel formatiert.
Alternative zu Formatoptionen NUMBER, DATE, TIME und TIMESTAMP.
Zur Bestimmung eines dynamsichen Sprachenschlüssels kann Tabelle T005X verwendet werden.

Datum

 SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
 WRITE |{ sy-datum COUNTRY = lv_land_de }|.
 
 SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
 WRITE |{ sy-datum COUNTRY = lv_land_us }|.

Uhrzeit

 SELECT SINGLE land FROM t005x WHERE land = 'DE' INTO @DATA(lv_land_de).
 WRITE |{ sy-uzeit COUNTRY = lv_land_de }|.
 SELECT SINGLE land FROM t005x WHERE land = 'US' INTO @DATA(lv_land_us).
 WRITE |{ sy-uzeit COUNTRY = lv_land_us }|.