AletheonAI Labs

SAP downloads that break on import: leading zeros, YYYYMMDD dates and decimal commas

  • United States
  • United Kingdom
  • European Union
  • India
  • UAE
  • Australia
  • Canada

In short

SAP writes data the way it stores it, not the way other software expects it. Customer, vendor and material numbers carry leading zeros that Excel strips when it opens a CSV. Dates are stored as eight digits (20240301), with 00000000 for no date. Amounts follow the decimal notation in the user's own SAP settings, so 1.234,56 and 12,50- are normal. Negative amounts often show the minus sign at the end. Text downloads also carry report titles, ruler lines, repeated headers and a Number of entries line at the bottom. Read the file as text, decide each column's type from the whole column, and never open it in Excel first.

Why SAP downloads are different

Most exports come from tools built to be imported somewhere else. An SE16N or ALV download is a copy of a screen list: it keeps SAP's internal formats and adds the decoration a person needs to read the list on screen. Each of the problems below comes from one of those two facts.

The fix is always the same: read the file as text, look at the whole column before deciding what it is, and keep the original value when in doubt. The sections below say what to look for, what SAP's own knowledge base says, and what our reader does with each case.

Leading zeros: 0000100001 becomes 100001

SAP stores numeric customer numbers (KUNNR), vendor numbers (LIFNR), material numbers (MATNR) and document numbers (BELNR, VBELN, EBELN) as fixed-length text, padded with leading zeros. Depending on how a list was downloaded, the same customer can appear as 0000100001 in one file and 100001 in another.

The bigger risk comes after the download. When Excel opens a CSV file it reads 0000100001 as a number and drops the zeros. IBM's support note on the same problem calls this deliberate, expected Excel behaviour (IBM (opens in a new tab)). Once the file is saved again, the zeros are gone for good. Postal codes (PSTLZ) lose theirs the same way, so 01067 Dresden becomes 1067.

What to do: never open an SAP text download in Excel and save it again. Treat code columns as text from the first step. And download every table the same way, so the key in BSEG matches the key in KNA1 character for character.

  • Aletheon keeps every value exactly as written. It never strips or pads a code.
  • When the data looks like SAP, 21 code columns are kept as text, even when every value is digits: KUNNR, LIFNR, MATNR, BELNR, VBELN, EBELN, PSTLZ, BUKRS, SAKNR, HKONT, KOSTL, PRCTR, PARTNER, PERNR, ADRNR, ZTERM, AUFNR, POSNR, EBELP, BUZEI and MANDT.

Dates: 20240301, 00000000 and 99991231

SAP date fields (type DATS) are stored as eight characters, year first: 20240301 is 1 March 2024. A list may show them as 01.03.2024 on screen, but downloads and some export formats write the stored value. SAP's knowledge base covers both cases: exporting DATS fields to Excel (SAP KBA 1861296 (opens in a new tab)), and an ALV export option that turns dd.mm.yyyy columns into yyyymmdd text that Excel cannot sort or calculate with (SAP KBA 3691018 (opens in a new tab)).

Two values need a decision before they reach another system. 00000000 means no date: loaded as a date, it fails or becomes nonsense. 99991231 in an end-date field such as ENDDA means open-ended. That is a real date, but most destinations show it as a validity that never ends, which may not be what you want.

  • Aletheon reads 12 common SAP date columns (ERDAT, AEDAT, BUDAT, BLDAT, CPUDT, AUGDT, ZFBDT, BEDAT, AUDAT, BEGDA, ENDDA, GBDAT) as YYYYMMDD dates.
  • 00000000, 00.00.0000 and 0000-00-00 become empty dates, not errors.
  • 99991231 is kept as written. The ENDDA column description says what it means, so the choice is made in the mapping, not silently.

Amounts: 1.234,56, 12,50- and debit or credit

SAP writes numbers in the decimal notation set in each user's own defaults (transaction SU3). Downloads by a user in Germany read 1.234,56 and downloads by a user in the US read 1,234.56, even from the same system. A tool that guesses from one value gets 1.234 wrong: it could be one thousand two hundred thirty-four, or one point two three four.

Lists also commonly show negative numbers with the minus sign at the end: 12,50- rather than -12,50. Many import tools reject that, or read it as text.

Accounting line items add one more rule. In BSEG, amounts such as DMBTR are written without a sign. The debit/credit indicator SHKZG says which side the line is on (S for debit, H for credit). Load DMBTR as it stands and every credit becomes a debit.

  • Aletheon decides each column's decimal separator from the whole column, not from one value. In a decimal-comma column, 1.234 is read as 1234.
  • 1.234,56, 1,234.56, Indian grouping such as 1,23,456.78, a trailing minus (12,50-) and brackets ((1.234,56)) are all read as the numbers they are.
  • A value that fits none of these forms is reported as an error. It is never turned into a different number.
  • SHKZG is described as S = debit, H = credit. Aletheon does not flip signs on its own: the mapping has to apply the sign, and the discovery sets that up with you.

Titles, rulers, repeated headers and the last line

A list saved as a text file often looks like this: a title line, a blank line, a row of dashes, the header between | characters, another ruler, the data, the header repeated at each page break, and Number of entries: 12 at the end. A plain CSV reader takes the title for the header and the rulers and footers for records.

Encoding is the other surprise. SAP GUI can write the file as Unicode or in the PC's local code page. An umlaut or accent that looks right in SAP becomes ü or ? when a tool guesses the code page wrong.

  • The header is the first full-width row. The lines above it are reported as titles, not read as data.
  • Ruler lines, repeated page headers and trailer lines without a separator are skipped and counted, and the intake report lists them.
  • Commas, semicolons, tabs and | are all detected as separators, and padded | cells are trimmed.
  • Encoding: a byte-order mark decides (UTF-8 or UTF-16). Otherwise valid UTF-8 is read as UTF-8 and anything else as Windows-1252. Other code pages, for example for Japanese or Chinese text, are not detected: save those as Unicode.

How to download SAP tables for a migration

Whatever tool reads the files, these habits avoid most of the problems above:

  1. Keep SAP's technical column names (KUNNR, NAME1) rather than the screen labels. They are unambiguous, and they are how a reader recognises the table.
  2. Download each table the same way, in one format, so keys match between files.
  3. Prefer Unicode text or .xlsx. Never open a CSV in Excel and save it again.
  4. Download one company code at a time if the volume is large, and keep the row counts SAP showed. They are your first reconciliation check.
  5. Include the master tables (KNA1, LFA1, MARA, SKA1) with the transaction tables, so lines can be linked to their customer, vendor, material or account.
  6. For customer and vendor addresses, check whether the address users see comes from ADRC rather than KNA1 or LFA1 (see the SAP tables guide).

Check your own SAP files

Upload SE16N or ALV downloads, or several of them in one ZIP, in the free check. You see which tables were recognised, what each column means, the header line of each file and every line that was skipped, before anything is mapped. SAP migration projects themselves are planned with you and quoted, and are described on the SAP page (opens in a new tab).

In the downloadUsual resultHow it is read
KUNNR 0000100001100001 after ExcelText, zeros kept
PSTLZ 010671067Text, zeros kept
ERDAT 20240301The number 20,240,301Date: 1 March 2024
AUGDT 00000000Import errorEmpty date
DMBTR 1.234,561.234 or text1234.56
DMBTR 12,50-Text or rejected-12.50
DMBTR with SHKZG HCredit loaded as debitDescribed; sign applied in the mapping
Number of entries: 12A recordSkipped and listed
ü instead of üWrong code pageEncoding detected (BOM, UTF-8, Windows-1252)
What SAP writes, what usually goes wrong, and how Aletheon reads it

Questions people ask

Why does SAP export lose leading zeros?

SAP keeps them: customer, vendor, material and document numbers are stored as zero-padded text. They are usually lost afterwards, when Excel opens a CSV and reads the column as numbers. Do not open SAP text downloads in Excel and save them again; read code columns as text.

How do I convert an SAP date like 20240301?

Read it as year, month, day: 20240301 is 1 March 2024. Treat 00000000 as no date. In end-date fields, 99991231 means open-ended, so decide whether the destination should store it or leave the end date empty.

Why are my SAP amounts wrong after import?

Usually one of three things. The decimal notation is the user's own SAP setting, so 1.234,56 is misread by a tool expecting 1,234.56. Lists often put the minus sign at the end (12,50-). And in BSEG, amounts are unsigned, with SHKZG saying debit (S) or credit (H).

Which SAP files can Aletheon read?

SE16, SE16N, SQVI and ALV list downloads saved as .txt, .csv or .tsv with comma, semicolon, tab or | as separator, Excel files (.xlsx, .xls), OpenDocument (.ods), or several of them in one ZIP. Checking the files is free; SAP migration projects are quoted after a paid discovery.

Does Aletheon change values when it reads SAP files?

No. Values are kept exactly as written; columns are not renamed. What the reader adds is a type for each column, a description of SAP columns it knows, and a report of every line it skipped.

Sources

Try it on your own data

Run the free sample, read the reconciliation report, roll it back if you like.

See how SAP migrations are planned
Start free sample

Keep reading

Contact us

SAP, multi-company Odoo or more than 2 million records?

Most migrations start with the free sample and need no call. For jobs above 2,000,000 records, SAP or multi-company ERP, or a pathway marked Contact us, tell us what you are moving and we will reply within one business day.

  • A reply from a person within one business day
  • A written plan and a price before any work starts
  • The same reconciliation report and rollback journal as every self-serve run
We reply within one business day, and use these details only to reply.