Extracting data from the SAP system - Part 2 - Table data (2)
Veröffentlicht von Shortcut IT in Sc4SAP · 1 August 2023
Tags: SAP automation;SAP data extract;SAP data download
Tags: SAP automation;SAP data extract;SAP data download
In practice, it is often necessary to extract data from the SAP system, whether for further processing outside the SAP system, for transfer to other SAP systems, or for other purposes. Part 1 of this blog was about extracting table data into a file with the "View table data" function. There is also another function - "Download / Upload table data" -, offering other possibilities: data can be backed up, restored and transferred to other systems / clients.
In the blog article "How to copy Idocs from one system to another?" it is described how to use this function for copying Idocs from the Production system to a Quality or Test system / client. To be honest, apart from what is written about the "Download / upload table data" function in that article there is not so much to add.
But with regard to the different functions and file types, you might ask yourself what function and what file type is suitable for fulfilling your aim. Therefore, you will find help here to make the right decision. Before we deal with the file types, let us start by having a closer look to the functions.
- The "View table data" function (currently) does not offer a selection of records to be processed. This is possible with the "Download / upload table data" function, using the 'Where condition' - a free text field where you can use the ABAP features available in the logical expession in the WHERE clause of a SELECT statement, depending on the release of the targeted SAP system.
- Also the files created by the "View table data" function are not suitable for using them as source for an upload in the "Download / upload table data" function. When it is about downloading and uploading the data again (e.g. for a data transfer), you have to use the "Download / upload table data" function.
- When your aim is to extract data that is to be used for further processing outside the SAP system (or as input file for processing the data in another SAP system), the "View table data" function should be used.
Both the "View table data" function and the "Download / upload table data" function offer different file types:
- The "View table data" function offers a plain text format and a CSV format.
The plain text format is a good choice when the data is to be used for further processing outside the SAP system (or for using an input file for another SAP system) - The record structure corresponds to the table definition in the Data Dictionary.
The CSV format is a good choice for using the file in a Spreadsheet application (like Microsoft Excel). By using this format also header info about the single columns will be written into the file. - The "Download / upload table data" function offers 3 file types:
- "ASC" - ASCII format. The table is transferred as text. Conversion exits are performed. The format is easily readable in a text editor. This file type is not suitable when your intention is to use the file for an upload lateron in an SAP system.
- "BIN" - Binary format. There is no formatting and no codepage conversion. The data is interpreted row by row; it is not formatted by columns. The readibility in a text editor is poor.
This format is a good choice for saving data and restore it lateron in the same system or in a system with same character set and endianess.- "DAT" - Column-by-column transfer. With this format, the data is transferred as text as with ASC. However, no conversion exits are performed and the columns are separated by tab characters. This format is a good choice for saving data and restoring / transferring it lateron in another SAP system, possibly with another character set and/or endianess. The readibility in a text editor is good, enabling you also to modify the file and adjust values in front of uploading it in an SAP system.
Consider the representation of dates and times, which is dependent on the settings of the user used in the connection! Therefore, when using this format for upload again - maybe in another system - the settings of the user for the decimal notation, the date and the time format need to be the same (transaction SU01, tab "Defaults").
Although the "Download / upload table data" function is suitable for saving / restoring / transferring data between SAP systems: if it is about processing the whole table (all records, resp. for client dependent tables all records in a client), using "Process table data using R3trans" usually is the recommended function.
Es gibt noch keine Rezension.