Skip to content

CDS & ABAP Data Types Cheat Sheet ​

Use alongside Lesson 8 — Custom Persistence Modeling. Browse all cheat sheets.

CDS / Dictionary typeUseABAP counterpart
abap.char(n)Fixed-length textc LENGTH n
abap.numc(n)Numeric text, often IDs with leading zerosn LENGTH n
abap.stringVariable-length / long textstring
abap.int1Very small integerb
abap.int2Small integers
abap.int4Standard integeri
abap.int8Large integerint8
abap.dec(p,s)Exact decimal valuep ... DECIMALS s
abap.decfloat16Decimal floating pointdecfloat16
abap.decfloat34High-precision decimal floating pointdecfloat34
abap.fltpBinary floating pointf
abap.datsDated
abap.timsTimet
abap.utclongUTC timestamputclong
abap.cukyCurrency key/code such as EUR, USD, GBP; used to tell the system which currency an amount is inCharacter-based key with currency semantics
abap.curr(p,s)Monetary amount such as 125.50; normally paired with a CUKY field so the value has a currencypacked number p
abap.unit(n)Unit key such as KG, KM, L; used to describe the unit belonging to a quantityCharacter-based key with unit semantics
abap.quan(p,s)Measured quantity such as 12.500; normally paired with a UNIT fieldpacked number p
abap.clntSAP client identifier; used for client-dependent data separationCharacter-based client key
abap.langLanguage key such as E, D, F; used for language-dependent data/textsCharacter-based language key
abap.raw(n)Fixed-length binary datax LENGTH n
abap.rawstringVariable-length binary dataxstring

Quick rules ​

  • Use CHAR for normal business fields with a sensible maximum length.
  • Use STRING for variable-length or potentially long free text.
  • Use NUMC for numeric-looking identifiers where leading zeros matter.
  • Use INT* for real integer arithmetic.
  • Use CURR + CUKY for money.
  • Use QUAN + UNIT for quantities.
  • Use reusable types such as SYSUUID_X16 when the business meaning is known.

Small DEFINE TABLE example ​

abap
@EndUserText.label : 'Simple Example'
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zexample_### {

  key client        : abap.clnt not null;
  key uuid          : sysuuid_x16 not null;

  item_no           : abap.numc(8) not null;
  title             : abap.char(80) not null;
  description       : abap.string;
  quantity          : abap.int4;
  created_on        : abap.dats;

  @Semantics.amount.currencyCode : 'zexample_###.currency_code'
  amount            : abap.curr(10,2);

  currency_code     : abap.cuky;

}