Interval data

Introduction:

In this blog, we are going to learn how to add timestamp field to a data source. We will try to load data for respective time intervals by,

  1. Enhancing the Data Source.
  2. Selecting the options.
  3. Replicating Data source in BW.

Blog content:

Option 1 – Check whether the field is there in the Data Source. If the field is available enhance the Data Source in Rsa6, checking the selection checkbox and replicating the Data Source in BW.
Fields in Data Source of type RAW and Decimal is not available for selection in filter conditions of DTP.

Option 2 – New custom field in the structure. This structure is appended to the standard structure of the Data Source. The enhancement is triggered, when Include from Function group is called. The input of this new custom field is the output of the previously available field (Raw or Decimal).

Option 1
We did not have Time Stamp Field enabled in 0FI_ACDOCA_20 Data Source.

0FI_ACDOCA_20

It is easy to load respective day’s data when we enable Time Stamp field in Data Source.

To add a field, we need to enhance the Data Source.

Go to RSA6 Transaction
Select the Data Source, for this 0FI_ACDOCA_20.

CDOCA_20-1

Double click on the data Source and the field is not there in selections.

CDOCA

Select your data source and click on the edit icon. Collect TR and enable selections for Timestamp by checking Selection checkbox for Timestamp.

CDOCA

Deselect the check boxes ‘Hide field’ and ‘Field only known in customer exit’. Save.

(Note: if you do not deselect these options here, the field will not come to BW).

Replicate the Data Source.

Use this while extracting data from Data Source in filter conditions.

CDOCA

Using Timestamp in filters we can load respective time data.

Here Timestamp field is decimal Datatype.

CDOCA
Here Timestamp field is the Decimal data type.

Fields in Datasource of type RAW and Decimal is not available for selection in filter conditions of DTP. Option 1 won’t work because the field is decimal.

Option 2 –

Here we need to create a custom field with Char datatype.

The Purpose of the custom field is to maintain the Time Stamp value. The previously defined Time Stamp field is of decimal data type, In BW we cannot use Decimal and Raw data types in Info-Package selection filters. So, we are creating a new Time Stamp field of CHAR datatype.

Code is written in such a way that the newly created custom field(ZZ_TIMESTAMP) gets value from the old field (TIMESTAMP) thereby we are using this new custom field in BW Info-Package selection filter to extract data for specific Time Stamp.

ECC – BACKEND1. New custom field ZZ_TIMESTAMP has been created in the structure ZFINS_AS_****_BW_TS. This structure is appended to the standard structure FINS_ACDOCA_BW_CT (Extractor) of the Data Source 0FI_*****_20.The custom field has predefined data element ZDE_TIMESTAMP, of type CHAR and length 15.2. The enhancement ZEI_BW_*****_TIMESTAMP is triggered, when Include LFIS_****_BIWF01 from Function group SAPLFIS_****_BIW is called.

Implicit enhancement has been triggered.

CDOCA

3. When Data Source is 0FI_*****_20 is being extracted using t-code RSA3, the enhancement is triggered from the said call. Internal table I_T_SELECT contains the inputted filters used for extraction. The internal table is checked for not null condition and if success, the said table is read for fieldname ‘TIMESTAMP’.

4. I_T_SELECT table is looped for fieldname ‘ZZ_TIMESTAMP’ into work area LS_SELECTION. The work area is then assigned value ‘TIMESTAMP’ to it, for fieldname FIELDNM. This work area is appended to the table.

Here we are passing TIMESTAMP field to custom ZZ_TIMESTAMP field.

CDOCA

ECC – BW Changes Enabled custom field for display and selection in the Data Source capture the changes (same as option 1).

CDOCA

BW- BACKEND
Replicate the Data Source in BW, new field is available in Info Package Selection.

CDOCA

Captured Active version of Data Source.

CDOCA

Now, Newly created custom field can filter records specific to timestamp.

Leave a comment

Your email address will not be published. Required fields are marked *