The TS Mapping configuration is used to export and import the data from and to qty_staging table in ALDH database. The table can be configured to get the data from any database and table based on the external logical system and external table name provided. In the same way the data can be exported to the specified application like Smoothie, ESOPT etc.
Following is the detailed description of each field:
1. MappingScn
The mapping scenario which combines a set of TS Mapping configuration to be passed as an input parameter to the external program which imports or exports the data to and from Qty_Staging in ALDH database.
2. IODirection
The IODirection governs the importing or exporting the data from Qty_Staging table.
For Importing the data IODirection = I and for exporting the data IODirection = O
3. QtyStgRecordType
The RecordType which will be used to populate or select the records in the Qty_Staging table.
4. QtyStgPlanID
The PlanID which will be used to populate or select the records in the Qty_Staging table.
While exporting the data to the external application, following will be the selection behavior:
If QtyStgPlanID = 00000000, all the data which have the Tdate prior to the Process date If QtyStgPlanID = 00000001, all the data which have the Tdate same or after the Process date If QtyStgPlanID = any other value, all the records will be selected
Does not have any relevance when PeriodOffsetBackward or PeriodOffsetForward is configured to -1.
5. QtyClass
The Class which will be used to populate or select the records in the Qty_Staging table.
6. ExtLogSys
This field has significance only when importing the records into Qty_Staging table. Points to the external logical system from where the data is to be imported.
7. ExtTable
This field has significance only when importing the records into Qty_Staging table. Points to the external database table from where the data is to be imported.
8. ExtTMapping
This field has significance only when exporting the records from Qty_Staging table.
8A. QtyStgTable {@Since 5.4.3}
This field has significance only when exporting the records from Qty_Staging table. The program uses the value as the table name from where the data should be exported. Default table name “qty_staging” is assumed if the field is left empty.
9. ExtPlanIDFieldName
This field has significance only when importing the records into Qty_Staging table. Specifies the RecordType field name in the external database table while importing the data.
10. ExtRecordTypeFieldName
This field has significance only when importing the records into Qty_Staging table. Specifies the RecordType field name in the external database table while importing the data.
11. ExtPlanID
This field has significance only when importing the records into Qty_Staging table. Selects the records with this value of PlanID while importing the data from external database table.
12. ExtRecordType
Indicates the RecordType for the external application (for e.g. Smoothie) while exporting the data.
Selects the records with this value of RecordType while importing the data from external database table.
13. PeriodOffsetBackward
This field has significance only when exporting the records from Qty_Staging table.
If the value is positive, sets the backward offset with the configured value and selects and summarizes the quantity data in that period while exporting.
If the value is -1, selects and summarizes all the data which have the Tdate prior to the Process date.
14. PeriodOffsetForward
This field has significance only when exporting the records from Qty_Staging table.
If the value is positive, sets the forward offset with the configured value and selects and summarizes the quantity data in that period while exporting.
If the value is -1, selects and summarizes all the data which have the Tdate same or after the Process date.
15. IncludeZero
This field has significance only when importing the records into Qty_Staging table. Indicates whether to import the zero values from the external table.
The External Program com.adaplink.aldh.ib.ss0004.qtystaging.builder.QtyStagingBuilder uses the TS Mapping configuration to populate the Qty_Staging table in ALDH database.
Make sure to set the Tdate as Process Date while importing the non transaction data like Inventory [RecordType = INV].
Following is the example configuration for importing the data:
Column (1 - 10)
| Mapping Scn | IO Direction | QtyStg RecordType | QtyStg PlanID | Qty Class | Ext LogSys | Ext Table | Ext TMapping | Qty StgTable | ExtPlanID FieldName |
|---|---|---|---|---|---|---|---|---|---|
| ACTIVE | I | DEMH | 00000000 | 20 | A_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | DEMF | 00000001 | 20 | A_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | REF1 | 00000002 | 20 | A_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | REF2 | 00000002 | 20 | A_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | REF3 | 00000002 | 20 | A_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | OPNSO | 00000002 | 20 | B_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | OPNPO | 00000002 | 20 | B_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | INTRS | 00000002 | 30 | B_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | PROMO | 00000000 | 30 | C_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | ADHIS | 00000000 | 30 | D_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | INV | 00000000 | 20 | D_STAGE | sapqtystaging | PlanID | ||
| ACTIVE | I | CURSH | 00000001 | 20 | D_STAGE | sapqtystaging | PlanID |
Column (11 - 16)
ExtRecordType FieldName Ext PlanID Ext RecordType Period Offset Backward Period Offset Forward Include Zero RecordType 00000000 DEMH 0 0 X RecordType 00000001 DEMF 0 0 X RecordType 00000002 REF1 0 0 X RecordType 00000002 REF2 0 0 X RecordType 00000002 REF3 0 0 RecordType 00000002 OPNSO 0 0 RecordType 00000002 OPNPO 0 0 X RecordType 00000002 INTRS 0 0 X RecordType 00000000 PROMO 0 0 RecordType 00000000 ADHIS 0 0 X RecordType 00000000 INV 0 0 X RecordType 00000001 CURSH 0 0 X
In the above mentioned configuration,
Mapping Scenario = ACTIVE IODirection = I
Following are the import actions which will be performed by the builder program,
The application specific External Programs are used to export the data from Qty_Staging table in ALDH database based on TS Mapping configuration. The exported data can be in the form of excel, database etc. as defined by the application where the data needs to be imported again for optimization, forecasting or any other actions.
Following are the partner’s application software for which the programs are developed in AdapLink:
Smoothie accepts data in both excel and database format. Whereas the data in excel can be in tabular or cross-tabular format, the database should always be in tabular format.
The external programs com.adaplink.ep.aldh.ob.smoothie.export.tabular.ExportTabularDataToDB and com.adaplink.ep.aldh.ob.smoothie.export.cross.ExportCrossTabDataToExcel are responsible for exporting the data from Qty_Staging table to database and excel file respectively based on the TS Mapping configuration.
Following is an example of TS Mapping configuration for exporting the data,
Column (1 - 10)
| Mapping Scn | IO Direction | QtyStg RecordType | QtyStg PlanID | Qty Class | Ext LogSys | Ext Table | Ext TMapping | Qty StgTable | ExtPlanID FieldName |
|---|---|---|---|---|---|---|---|---|---|
| ACTIVE | O | DEMH | 00000000 | 20 | |||||
| ACTIVE | O | DEMF | 00000001 | 20 | |||||
| ACTIVE | O | REF1 | 00000002 | 20 | |||||
| ACTIVE | O | REF2 | 00000002 | 20 | |||||
| ACTIVE | O | REF3 | 00000002 | 20 | |||||
| ACTIVE | O | OPNPO | 00000002 | 20 | |||||
| ACTIVE | O | OPNSO | 00000002 | 20 | |||||
| ACTIVE | O | INTRS | 00000002 | 20 | qty_staging_detail | ||||
| ACTIVE | O | INV | 00000000 | 20 | qty_staging_detail | ||||
| ACTIVE | O | CURSH | 00000001 | 20 |
Column (11 - 16)
ExtRecordType FieldName Ext PlanID Ext RecordType Period Offset Backward Period Offset Forward Include Zero RecordType DEMH 0 0 RecordType DEMF 0 0 RecordType REF1 0 0 RecordType REF2 0 3 RecordType REF3 2 0 RecordType OPNPO 0 0 RecordType OPNSO 0 0 RecordType INTRS 0 0 RecordType INV -1 -1 RecordType CURSH 0 -1 The following types of records will be exported from Qty_Staging table to Smoothie database for the Mapping Scenario = ACTIVE,
1. TS Mapping offset logic for exporting non transactional data to Smoothie:
OffsetBackward = -1 and OffsetForward = 0
Exports all the records from qty_staging where Tdate < ProcessDate
OffsetBackward = 0 and OffsetForward = -1
Exports all the records from qty_staging where Tdate >= ProcessDate
OffsetBackward = -1 and OffsetForward = -1
Exports all the records from qty_staging irrespective of Tdate