!--a11y-->
Creating a Mapping
Procedure
Invoke the transaction /nsmap.
The front-end for Structure Mapper appears.
Enter a Map Name in the Mapnames list box and click on the Save button.
- It is ensured that no duplicate mapname entries are entered.
- Click on the Mapping details tabsheet to enter the details of map header entries.
- In the Map Header entries we enter the source and destination DDIC structures.
The following entries can be made for the source and destinations
- The combination of transaction and table entries is checked, if a segment structure exists (SEG_DD) for that combination.
- When Transaction name is blank, the table name column takes either a DDIC structure name or a transparent table name. Its existence is checked.
- When a DDIC segment structure name (SEG_DD) is entered, the tool automatically maps the structure to Transaction name and Table name.
- Input type field should contain the value either ‚I‘ or ‚S‘, which signifies ITAB processing or Structure processing for the mapping. Normally we enter ‚I‘ which is for ITAB processing.
- Map Order should be numeric and no two entries are allowed to have the same map order.
- When a map name is deleted, all the relevant entries in Map Header table SMO9_SMAP1 and the Map Details table SMO9_MDTL1 are deleted.
- When a Map Header row is deleted, all the entries in the Map Details table SMO9_MDTL1 are deleted.
- Choose Save to save the Map Header.
- The combination of transaction and table entries is checked, if a segment structure exists (SEG_DD) for the combination.
- When Transaction name is blank, the table name column takes either a DDIC structure name or a transparent table name. Its existence is checked.
- When a DDIC segment structure name is entered, the tool automatically maps the structure to Transaction name and Table name.
- Input type field should contain either the value 'I‘ or 'S‘.
- Map Order should be numeric and no two entries are allowed to have the same map order.
- ‚Cascade Delete‘ is ensured.
- When a map name is deleted, all the relevant entries in Map Header table SMO9_SMAP1 and the Map Details table SMO9_MDTL1 are deleted.
- When a Map Header row is deleted, all the entries in the Map Details table SMO9_MDTL1 are deleted.
If mapping has to be done on the Data Element level go to the Map Structure fields tabsheet.
- Choosing Save would create map entries in the tables on Data Element level. To view the result of the Data Element mapping click on the Map Fields Details tabsheet.
- If map entries other than the Data Element need be done or functions and conditions for the mapping need to be applied, click on the Map Fields Details tabsheet.
Following are the descriptions of each column in the control:
- Source Field is
the name of the source field in the source structure entered in the previous tab. Source fields can be concatenated like STREET+KTOKD.
- Destination Field
is the name of the field in the destination table structure entered in the previous tab.
- The Forward function and Reverse function columns specify the functions that could be applied for the source field before mapping to destination field.
- Constant
column assigns constant value specified to the destination field.
- Forward Condition & Reverse Condition
columns specify the conditions which could be applied for mapping in the forward and reverse direction. The field name specified should belong to the source structure. The format for specifying conditions is &IPSTRU-<field name> = <value> e.g. &IPSTRU-KTOKD = ‘CONT’ or &IPSTRU-<field name> = &IPSTRU-<field name> e.g. &IPSTRU-KTOKD = &IPSTRU-SOURCE.
- Append Destination
column indicates whether contents of source field are to be appended or overwritten to the destination field. A tick in this check box means the contents of source fields would be appended to destination field.
- Forward Mapping and Reverse Mapping
column suggest that this particular mapping code be generated for the forward map or reverse map. A tick in this check box means that, this map would be done for the direction in which the check box is checked.
- The contents of Map Comment column would be appended as comments to the generated mapping code
The following are the valid functions that can be applied in source field.
- TRIMSTART( )
- TRIMEND( )
- TRIMALL( )
- LEFTJUSTIFY( )
- RIGHTJUSTIFY( )
- PADR( C )
- PADL( C )
- TOUPPER( )
- TOLOWER( )
- Choose Save when finished with editing of mapping field details
- Click on the List of mapping tabsheet to go to the initial screen.
Now our mapping is defined and ready for generation.
- Click on the Single Map Generate button to generate code for the newly created mapping.
You can view error during code generation by pressing the Error Status button after code generation.
The Generated code would be in the following function module.
Forward Mapping Code : <Customer Name space>_<Map Name>F_SMP
Reverse Mapping Code : <Customer Name space>_<Map Name>R_SMP
example for Map Name SALES_DATA defined in Structure Mapper front-end tab List of Mappings,
the generated function would be under the following names in SFA system:
Forward Mapping: /1CRMG0/SMOT_SALES_DATAF_SMP
Reverse Mapping: /1CRMG0/SMOT_SALES_DATAR_SMP
where
1CRMG0 : customer namespace,
SALES_DATA : Map Name
F/ R : Forward / Reverse