Copyright 2024 - BV TallVision IT

The mapping information that is held on customizing tables controls how the interface populates it's fields. In effect, the mapping tables reflect the datasets (record structures, file layouts (where several file layouts could be applied to the same file, sequences of interface fields) from the receiving system. To do this, a total of 3 tables are required. 

 

The data in the above data model holds information on the dataset, field mappings and where translation tables are to be applied to map values from sending to receiving system, the translation table is used. This is all the interface program needs to produce output. 

A summary of fields capturing the following functionality (ZHRI_DATASET):

  • The dataset is part of an interface, thus multiple interfaces can be set up with the same interface report. If need be, the name of the dataset can start with a number, to capture the sequence of datasets. In out example there was no such sequence. 
  • The description on the dataset is only used for documentation purpose, never the less, it's a good idea to fill it in as it shows up in a utility report (accessible from the interface report selection screen).
  • Each dataset is composed via a primary table, which defines which data selection method is used when filling the dataset. In HR this can be interpreted as follows: HR master data is available on infotypes 0000, 0001 and 0002. A selection module (which is in effect a class with a few predefined methods) is implemented for the selection of HR master data. Whenever the dataset you need is composed with information from these (3) infotypes, the primary table for HR masterdata is to be used. 
  • The dataset also has an outputtype, which is meant for the final stages of interfacing: producing the output. In the example case (ADP) a file is produced for each dataset using a sem-colon delimited text file. The export module (again in effect a class with predefined method) determines whether the output is send to the presentation server or background server, or e.g. as RFC call to the next system. An export module can also be set up to create an outound Idoc. 
  • Last but not least: the active flag. Only active datasets are being processed, so in a live system there should not be any inactive datasets. The indicator was introduced to aid the development process. 

The mappings table holds the following fields - for the following functionality (ZHRI_MAPPINGS):

  • The mappings table describes the fields on a dataset, for an interface. The sequence of these fields is determined by the column field (this is a character-field, just in case you are dealing with more than 99 fields).
  • Each field has a geoKey which is a deviation controller key. Leave empty to indicate the default mapping setting is used. Much more on the geoKey later on. 
  • The targetfield holds the fieldname as is required in the receiving system. It's for documentation purpose only, unless your export module requires these names as e.g. column headers. Note that where errors are reported by the interface, the targetfield is often used as reference in the error message.
  • The description is also purely for documentation, but makes the process of filling in the customizing settings a lot easier.
  • The source field is very important for mapping. A source is typically a structure name and a fieldname, concatenated by a '-', like so: P0001-PERNR. In effect, the source fields that can be filled in here are available (or can be added) in LCL_CONTROLCENTER=>GW_INTERFACE-P0001-PERNR. If an invalid field is filled in when customizing these settings, the interface run will detect the mismatch and report an error.
  • The mapping table also has an options field, which can be used for a wide variety of options. How options is used is described elsewhere. One of the options is involving the translation table, see next section.

The last table on the data model is the translation table (ZHRI_TRANSLATION) which can be used to hold pairs of old and new values. The translation table can be used via option TRANSLATION:TITLES where TITLES is a set of pairs on table ZHRI_TRANSLATION.

These tables (or rather the data in these tables) is accessible from the interface selection screen, which also holds a report on the above data.

Table definitions

Transparent table with the field mapping settings: zhri_mapping(mandt, dataset, column, geokey, targetfield, description, source, options). Note: naming convention zhri_ is for Z (custom object) HR (Human resource) I Interface Data elements:

  • dataset - C20, “Name of the (target) dataset”, possible values in table zhri_datasets
  • column - C2, “Column number/code for fields”, 01 to 99 - alphanumerical to cater for inserts or wider datasets
  • geokey - C10, “Geographical key” - filter option, this field is empty for the initial setup. Deviations from the default can be held on the mapping table with a geokey e.g. “NL”;
  • targetfield - C20, “Name of the (target) fieldname”, docu only
  • description - T40, “Description of the field”, docu only
  • source - C10, “Source table or infotype”
  • options - C60, “Field-specific options”, conversion rules, reference to subtype (for infotype), translation table or Abap specific logic that would need to be applied.

Table maintenance (2-screen) to be generated, no recording routine.

Transparent table for dataset settings: zhri_dataset(mandt, interface, dataset, description, primarytable, geokeymaker, outputtype) Data elements:

  • interface C10, “Name of the interface - dataset group” - this will be set to “ADP” for the ADP interface
  • dataset - C20, “Name of (target) dataset” - this name is used in the file name
  • description - T40, “Description of the dataset”
  • primarytable - C10, “The primary table for selection of the data”
  • outputtype - C5, “The outputtype of the data”, supported output types will initially only be CSV or CSV through Idoc

Table maintenance (2-screen) to be generated, no recording routine.

Create transparent table for translations translations(value old becomes value new): zhri_translation(mandt, source, field, value, value_new) Data elements:

  • source - C10, “Source table or infotype”
  • field - C10, “Fieldname on table or infotype”
  • value - T60, “Value of the field”
  • value_new - T60, “New (translated) value of the field”

Table maintenance (2-screen) to be generated, no recording routine.