SAP ABAP Data Element RSAN_WB_DS_FILE (Source "File")
Hierarchy
SAP_BW (Software Component) SAP Business Warehouse
   BW-EI-APD (Application Component) Analysis Process Designer
     RSAN_WB (Package) APD - Tool - User Interface
Basic Data
Data Element RSAN_WB_DS_FILE
Short Description Source "File"  
Data Type
Category of Dictionary Type     Direct Type Entry
Type of Object Referenced     No Information
Domain / Name of Reference Type      
Data Type STRG   Character String of Variable Length 
Length 0    
Decimal Places 0    
Output Length 0    
Value Table      
Further Characteristics
Search Help: Name    
Search Help: Parameters    
Parameter ID   
Default Component name    
Change document    
No Input History    
Basic direction is set to LTR    
No BIDI Filtering    
Field Label
  Length  Field Label  
Short 10 Text 
Medium 20 Description 
Long 40 Description 
Heading 60 Description 
Documentation

Use

This node enables you to use data from a file in an analysis process. The file can either be found on an application server (for CSV files only) or on the presentation server.

The two file formats CSV and Excel are supported.

CSV File

The technical name of the InfoObject has to be in the first line of the file, for example, 0BPARTNER for the business partner. The data is in the following lines. The values are separated from one another with semicolons (;). Each line in the file becomes a data record. The data is transferred with ABAP MOVE logic into type-related fields. The data is expected in internal data format.

If you require several columns with the same InfoObject, you can add a field name prefix when specifying the InfoObejct: <field name>:<InfoObject>. Separate the field name from the name of the InfoObject with a colon (:).

Example: You want to read a file containing answers to a questionnaire in each line. The first line of the file can contain the following information:
0BPARTNER ; ANSWER1:0WS_ANSWER ; ANSWER2:0WS_ANSWER ; ANSWER3:0WS_ANSWER

Only data from the application server can be used in background processing.

Excel File

Specify the data to be read in. To do this, enter the worksheet as well as the file name and the data area. The Excel columns (for example A, B, C) are used as field names in the analysis process. In the first rows to be read in, column headers are expected. If the data area contains just one row, the column names (A, B, C etc.) are used as column headers.

The data format of the various columns is recognized automatically, with a distinction made between the categories Date, Time, Numeric and String. The data format of the second row in the data range is decisive. This is the first row with the actual values. The system expects the rest of each column to correspond to the same data format category. This means for example that varying data formats are allowed in a column (27.01.1983 and 1983 January 27 for example). Switching from a date to a string can cause exceptions though if the content of the cell cannot be interpreted as a date. This does not apply to columns with category String. Switching date formats does not pose a problem for these.

While loading the data, the system uses your PC#s clipboard. You should therefore avoid using the clipboard functions at this time, especially the copy function. After loading, the content of the clipboard is deleted.

If a column in the worksheet is defined as "Hidden", it is ignored during loading.

Reading the Data

  • String: The cell content is always read as displayed (region-specific) in the Excel application. Internal ABAP Type: CHAR255.
  • Date: The date is standardized, meaning that the entered value is loaded rather than the displayed formatted value. If for example value "27.01.1983" has been entered, but the formatting excludes the day, it will be displayed as just "01.1983". The complete value "27.01.1983" will be loaded however. If the cell is empty, the initial date is transferred. Internal ABAP Type: DATS8.
  • Time: The time is also standardized, meaning that the entered value is loaded rather than the displayed formatted value (see Date). If the cell is empty, "00:00:00" is transferred. Internal ABAP Type: TIMS6.
  • Numeric: The number is standardized, meaning that the entered value is loaded rather than the displayed cell content. This means in particular that all decimal places entered are included. If the cell is formatted as "Percentage", the value entered is divided by 100. "4 %" is carried over as "0,04" for example. If the cell is empty, "0" is transferred. Internal ABAP Type: DECFLOAT34.

Cell Formatting

If the column is formatted as "Standard", the content of the first cell is used for division into categories. The system then only distinguishes between String and Numeric.

The following is a list of the criteria by which a column is assigned to a category using the cell formatting. These criteria are applied in cascading form, meaning that the next criterion is only applied if the previous one was not met. If the formatting meets the criteria for Date and Time for example, the column is interpreted as a date.

  • String: The formatting does contains formatting symbols not reserved by Excel. These are flagged in the formatting for a cell with ' \ ' or ' " '. Not only user-specific formatting contains these symbols. The Chinese date formatting integrated in Excel contains Chinese symbols as strings for example. In this example the column is therefore interpreted as a string. Example: ' "I am" 0 "years old" '
  • Date: The formatting contains the formatting symbols for Year, Month and/or Day reserved by Excel. If the formatting only contains the formatting symbol for Month, the column is interpreted as a string. Example: ' YYYY.MM.DD '
  • Time: The formatting contains the formatting symbols for Hour, Minute and/or Second reserved by Excel. If the formatting only contains the formatting symbol for Minute, the column is interpreted as a string. Example: ' HH:MM:SS '
  • Numeric: The formatting contains the formatting symbols for Currency, Fraction, Percentage and/or exponential display reserved by Excel. Examples: ' [$$-1009]#.##0,00 ', ' # ?/? ', ' 0,00% ', ' 0,00E+00 '

If the formatting does not meet any of the criteria, the column is interpreted as a string in the standard setting.

Entering InfoObjects

To format a column using an InfoObject, enter the name of the InfoObject after the column name in the first row. This must be separated by the separator specified in 'File Properties', for example <Field Name>:<InfoObject>. If no field name is entered, the InfoObject long text is used as the field name. If the InfoObject does not exist, the separator is ignored and seen as part of the field name.

You then have to make sure that the data type in the Excel column is compatible with the InfoObject data type (see Cell Formatting).

Entering an InfoObject has no effect on how the data is saved internally. Instead, it serves to propagate a data type for transformation operations (joins for example). The data from the worksheet is saved with the greatest possible precision (see Reading the Data). If you define a join to numeric fields for example and forward the result, the target objects still receive the data with floating commas with the greatest possible precision, regardless of the InfoObject entered.

Example:

You load data from a worksheet and want to create a join with an InfoProvider. The InfoProvider contains the 'Customer Number' (0D_CUSTOMER). The worksheet contains a column with the 'MyCustomers' field name. The 'MyCustomers' is normally saved as CHAR255. 0D_CUSTOMER is of type CHAR10, meaning that a join in the APD is not possible. If you now add ':0D_CUSTOMER' to the 'MyCustomers' field name, a join is possible.

Example

A CSV file should contain the following data:

Business Partner    Revenue    Currency

1000    1200    EUR

1002    1500    EUR

1080    1100    EUR

The file must also contain the following:

0BPARTNER;0REVENUE;0CURRENCY 
1000;1200;EUR 
1002;1500;EUR 
1080;1100;EUR
History
Last changed by/on SAP  20130604 
SAP Release Created in 30B