Dme Creation
Dme Creation
Dme Creation
To
Februray 2005
Data Medium Exchange Engine
Background
In SAP, payment programs are used to process domestic and international payment
transactions with customers and vendors. The payment programs allow both incoming and
outgoing payments and are used by following components of SAP: Accounts Receivable
(FI-AR), Accounts Payable (FI-AP), Treasury (TR), and Bank Accounting (FI-BL).
The overview of handling the open items using the payment programs is given below.
The payment programs create documents and supplies data to the payment medium
programs. These payment medium programs in turn print either a payment list, payment
forms (for example, cheques) or create data carriers such as magnetic tape or floppy
disks.
Payment forms and file formats are specific to country. These payment forms are
designed by SAP script.
The payment medium programs store the data in the SAP print administration and in DME
administration (where DME is used). This data is picked up separately (per form or data
carrier) and sent to printer or data carrier.
Apart from handling both incoming and outgoing payments, other features of payment
programs are:
Objective:
This document attempts to showcase ‘Data Medium Exchange Engine’, a new tool
devised by SAP used to create payment medium formats. These payment medium
formats are configured using the tool ‘Payment medium workbench’ which overcomes the
disadvantages of classical payment medium programs used to configure and create the
payment media sent by the organizations to their house banks.
Scope:
Scope of this document is limited to the configuration of payment medium format for the
payment program (application area: PAYM) by using Data Medium Exchange Engine.
Out of scope:
This document does not intend to cover the following topics. It is recommended to refer
SAP help for these topics.
1. Configuration of Payment Medium workbench when Data Medium Exchange
Engine (DMEE) format tree is used to generate a DME file for a given payment
method. However, a brief description of this tool is provided in the next section
2. Configuration of DMEE format tree for Incoming file formats (data medium
exchange file that you receive – for example, an electronic bank statement from
your bank)
3. Use of tree types other than PAYM, such as UMS1, ASLD and WTRE.
4. DMEE node types for creating the XML file.
In simple terms, Payment Medium Workbench is used to create payment media. This
workbench provides a generic payment medium program for all payment medium formats
compared to the individual classic payment medium programs (RFFO*). SAP is going to
use this generic tool in future and will gradually phase out the classic payment medium
programs (RFFO*) due to the range of advantages that it provides.
The generic payment medium program of PMW will have variants defined in customising.
The user can decide on the layout of the note to payee, and select differing notes to payee
according to origin (vendors, customers, personnel, travel expenses, Treasury, online
payments and so on).
This workbench provides the developers and functional consultants simple tools for
changing without modifying the formats delivered or for setting up new formats. This
integrates the existing development tools (ABAP Dictionary, Function Builder) and also the
DME Engine that make the PMW into a workbench.
Advantages of PMW over classic payment medium programs:
The Data Medium Exchange Engine (DMEE) is used to define file formats that meet the
requirements of the companies. This is particularly important as there is no worldwide or
regional standard. In some cases, no country standard exists and the file must comply with
bank-specific standards. With no ABAP programming knowledge required, this tool
enables you to flexibly define new formats and to efficiently modify existing ones. In
addition, DMEE can be used by calling applications to generate a DME file.
The following application areas in Financial Accounting use the formats implemented in
DMEE and generate Data Medium Exchange files.
Payment program
Tax reporting
After the payment programs are run, the data from the SAP tables should be output to the
target file based on the payment proposal and the file should contain the fields as per the
format specified in the attachment. This DME file will be sent to respective banks.
The various configurations required for generating the DME file by the calling applications
such as Payment program when DMEE format tree is used for different tree types, is
explained in previous section.
SECTION A
The basic steps to be followed for configuring the DME Engine are given below.
1. Define Format Tree
2. Setup Header Attributes
3. Setup Nodes
Fig-1
During the definition of the format tree following actions are performed
1. Data selection
After you specify the application for which you wish to create a file format (such as
the payment program) and assign a unique format tree ID, the system executes a
selection step. It selects all R/3 fields that are predefined for the particular
application. These fields form the source field inventory and are made available to
you when you do the data mapping in step 3.
2. Definition of tree structure
In this step, you define the layout of the format tree in a hierarchical structure. This
tree stores all data that is relevant to describe this file structure: here you maintain
the level structure of the file, the field structure, and the mapping and conversion of
SAP source fields to file target fields.
3. Data mapping
When you define your structure, you must link the fields in your file format to the
corresponding fields in the R/3 System. This enables the DME Engine to extract the
required data from the appropriate fields when you later generate a file. There are
several mapping procedures; the most common ones are direct reference to R/3
fields or specification of a constant. You can also define more complicated mapping
rules by including conditions, aggregation, or user exits.
After the above steps have been completed, you activate your format tree and it can
then be used for generating DME files from the defined applications.
1. Administrative data
2. Format Attributes
3. Levels
4. Sort/Key fields
5. File data
Fig-2
A. Administrative data
- Specify short description and any documentation to your format tree in this screen.
The documentation will be saved as text in SAP Script editor.
- Version of the format tree will be assigned by the system as 0 for the active version
and 1 for the subsequent maintenance version
B. Format Attributes
Here you specify a DDIC structure in the case of format-specific parameters and delimiter
information. For some applications, it is possible to fill additional parameters dependent on
the DMEE format tree that has been selected. These additional parameters must come
from a fixed DDIC structure that must be assigned to the format tree. The fields from this
structure are then made available as possible source fields during the mapping process.
For format trees of the tree type PAYM, you can additionally specify that an accompanying
sheet is to be printed when the file is generated. The system supports the printing of both
simplified sheets and sheets with subtotals. If you specify an accompanying sheet with
subtotals, you must maintain the key fields on the Sort/key fields tab strip.
C. Levels
Here you specify the number of levels in the format. In addition, you can define a repetition
limit for each level. This value specifies how often a certain level may be output. If this
number is exceeded, the corresponding level cannot be output anymore. If the limit is
reached for the uppermost level in the format tree and additional data is to be processed,
a second file is generated. If the limit is reached for lower levels, the preceding level is
repeated so that data can continue to be output for this level.
D. Sort/Key fields
Here you can specify how certain fields are to be sorted. For the payment program, for
example, you can sort according to currency or account by specifying the appropriate
source field. If a sort field is additionally marked as a key field, then a change to the value
in this field causes the corresponding format level to end and new level is started.
Fig-3
If you indicate on the Format attributes tab strip that an accompanying sheet is to be
printed, you maintain the key fields in the bottom half of this section (Key fields for
accompanying sheet sub totals). Then system will calculate the sub totals for these fields
and then outputs it on the accompanying sheet. In the background system uses an internal
table of structure ‘FPM_SUMTABLE’ for storing the sum amounts before outputting to file.
E. File data
Block: End of Segment
Here you specify whether segments are to be separated by carriage return or by line feed.
Node types
Each node type performs a different function and various data can be maintained
accordingly in the detailed view. For additional information on nodes and when to use
certain node types, choose Extras Node legend on the DMEE: Create/Change Format
Tree <format tree> screen.
Below is an overview of node types in the DME Engine to create flat files and their use.
Please note that the node types for creating the XML file are different and is not in the
scope of this document
Fig-4
Node Use
1. Segment Group
Always a new level in DMEE starts with segment group. Segment groups are used for
arranging segments. Segment groups can be followed by either segment groups or
segments.
2. Segment
Segments represent a record in the output file. They need to have at least one composite
or one element as sub nodes.
3. Composites
Composites are used to group the elements. If there is a common condition exists for a
group of elements, this condition can be specified in the conditions tab of the composite.
Composites are closely related to Conditions. Refer STEP3 for conditions.
4. Elements
Elements represent the fields in the target file at different levels. Mapping rules are
specified at element level.
5. Atoms
These nodes will be used, only if there is more than one mapping rule to be defined for an
element. We have not used atoms for our scenario.
6. Technical Fields
Technical nodes are type of element which will not be output to the target file. Only
elements will be written to output file. They store values that are used in other tree nodes
(elements, atoms) by reference to the technical node. For this reason, a technical node
generally contains a reference ID.
Aggregations
We can aggregate the values for the specified nodes (called aggregation nodes) and
assign this aggregated value to an element which can be output to the target DME file
The aggregation function can be used at the end of a level or a file to:
Add the total value of specified nodes
In this case, you can only specify aggregation nodes that are filled with values
(elements). Example for this would be the amount of all payments in a level.
Add the number of nodes
In this case, you can specify any aggregation nodes because the system totals the
number of occurrences, not specific values. Example for this would be the number
of payments in a level.
After defining the nodes for the format tree, we have to define the rules by which R/3
source fields will be mapped to the target fields in a DME file. In most cases, we specify
how data is to be mapped to elements, the nodes in the DMEE format tree that represent
these target fields. You can also specify a mapping procedure and source information for
atoms, which you define if an element contains several mapping rules.
List of the source fields which can be mapped to the elements for the application selected
will be available in the source field inventory.
Source Field Inventory
For each DMEE tree type, a set of possible source fields is predefined by SAP. These
fields form the source field inventory, which is generated automatically during the data-
selection step. You can select from these fields in the data-mapping process.
The source field inventory can consist of the following fields, depending on the tree type:
Source fields for the application
These fields are dependent on the particular application.
ABAP system fields
These fields are made available for each application. An example is the system
date.
Technical fields
These fields are additional ABAP system fields that are usually not selected in the
data-mapping process. However, they are still made available in the case that you
require such source fields.
1. Source fields for note to payee (internal table)
These fields are specific to the tree type PAYM (payment program). If the
appropriate settings are defined in Customizing for Payment Medium Formats for
the Payment Medium Workbench and you select one of these fields as your source
field, then a value will be filled in this target field.
Parameters and source fields from Customizing
These fields are specific to the tree type WTRE (withholding tax reporting). By
choosing one of these fields, you map data that has been defined in Customizing
and that remains unchanged.
When the elements are created under the composites, the system automatically displays
the detailed view for an element in the right frame.
This includes the following tab strips:
Attribute
Source
Conditions
Aggregation
Attribute tab:
Attribute tab is used to define the Attributes for the element and select the Mapping
Procedure for element definition. See Fig-5.
It has two blocks:
Attribute Block
Mapping Procedure Block
Mapping Meaning
Procedure
Structure field A value is to be retrieved from a specific source field in the R/3
System
Exit module The standard mapping and conversion rules do not meet your
requirements and you wish to specify an exit module
Fig–5
Source tab:
Source tab is basically varies based on the selected Mapping Procedure.
It is the actual definition of the element. It has four blocks which are available based on the
selected mapping procedure. See Fig-6
Blocks:
Constant
Mapping from structure field Block: This block is available if ‘Structure Field’ Mapping Procedure
is selected.
Reference to other tree node Block: This block is available if ‘Reference to tree node’ Mapping
Procedure is selected
Exit Function Block: This block is available if ‘Exit Module’ Mapping Procedure is
selected.
Fig–6
Condition tab:
By specifying the conditions for the nodes we can control the generation of a certain
format tree node is processed during file generation. Conditions can be defined for any
node type. If one condition applies to several consecutive elements, you should define a
composite. If you assign a condition to a segment or a composite, it applies to the
corresponding sub tree. In this way, for example, you can control that a complete record (a
segment, including all its elements defined as sub nodes) is not output to the file.
See figure Fig-7.
Fig – 7
Aggregation tab:
This tab is available if ‘Aggregation’ Mapping Procedure is selected.
We can aggregate the values for the specified nodes (called aggregation nodes) and
assign this aggregated value to an element which can be output to the target DME file.
See figure Fig-8
The aggregation function can be used at the end of a level or a file to:
Add the total value of specified nodes
In this case, you can only specify aggregation nodes that are filled with values
(elements). Example for this would be the amount of all payments in a level.
Add the number of nodes
In this case, you can specify any aggregation nodes because the system totals the
number of occurrences, not specific values. Example for this would be the number
of payments in a level.
Fig-8
Maintenance
After activating a format tree, two versions exist in the system: the active version (000) and
the maintenance version (001). You always maintain version 001. When making changes
to the maintenance version, you can always return to the last active version. You would
want to do this, for example, if you make changes to the maintenance version, save it, and
decide later that you do not want to keep these changes. To return to the last active
version, on the DMEE initial screen choose Edit Maintain active version.
When you return to the last active version, it overwrites the maintenance version.
Only two versions exist in the system at any given time. Once you modify a maintenance
version and activate it, this is the only active version that exists – at this point it is not
possible to return to an earlier active version.
Both the active and maintenance versions can be transported to other systems.
Financial Accounting applications: payment program, tax reporting, and withholding tax
reporting.
SECTION B
This section explains the steps to be followed for setting up the DMEE for the scenario in
BP
of detail, they can be specified as ‘No Sorting’ in this screen as they are already presorted
while the payment program is run.
No action is required for the format tree Z_BANK_FORMAT as we are not using any
accompanying sheet
E. File data
Select carriage return and Line feed options and select ‘Only permit these
characters’ and do not specify any characters in ‘Charctr’ field to allow all the characters.
Create Segment
We had requirement to send the data to two house banks of BP in Turkey. They are
‘ABC’ and ‘YBC’. The file formats for each bank had one ‘Header’ record and
multiple ‘Detail’ records.
Create a segment under the segment group by right click of mouse -> create
segment -> as sub node
Name this segment as ‘Header[Seg]’ in the right hand screen and provide short
description. The level for this segment will be ‘1’ as this represents the header
record in the file. There are no conditions to be specified at this level.
To represent ‘Detail’ records of ABC and YBC bank formats, we have to create one
more segment group under the segment group ‘AR[SG]’. This new segment group
will be called as ‘Detail[SG]’ with description as ‘Detail Segment Group’. Since, this
new segment group represents detail lines of the bank formats, which are for
header lines, it should be created as sub node under the segment ‘Header[Seg]
instead of the segment group ‘AR[SG]’.
Hence, place the cursor over the node ‘Header[Seg]’ , right click and create the
segment group ‘Detail[SG]’ as sub node. Please note that the level of this segment
group should be ‘2’ as it represents the detail records of the bank formats
As given above, to represent the detail records of the two bank formats, we need to
have segments. Create segment ‘ABC[Seg]’ and ‘YBC[Seg]’ as sub nodes under
the segment group ‘[Detail[SG]’ as explained above. Again, level of these segments
will be ‘2’ as they are under the segment group ‘Detail[SG]’ which represents level
‘2’.
As mentioned above, the segments need to have at least one composite or one
element as sub node
Create Composites
The header records for two banks of BP had varying number of fields as shown in
the attached documents.
Since we are going to use only one format tree for both banks, we should be able to
select the header record appropriately based on some condition. Composites can
be used for this purpose.
Create a composite under the segment ‘Header[seg]’ called ‘ABC[comp]’ with
description as ‘Composite for ABC bank’ by right clicking on the segment node.
This will be used to group some fields/elements for header record of bank ABC.
Create one more composite at the same level as ‘ABC[Comp]’ under segment
node. Call this as ‘YBC[Comp]’ with description as ‘Composite for YBC bank’. This
will be used for grouping some fields/elements for header record of bank YBC.
In order to control the fields for the two bank formats at detail level and to satisfy the
condition of having at least one composite under a segment, composites need to be
defined for segments ‘ABC[Seg]’ and ‘YBC[Seg]’. Create the composite
‘YBC_Detail[Comp]’ under the segment ‘YBC[Seg]’ and ‘ABC_Detail[Comp]’ under
the segment ‘ABC[Seg]’. These composites may hold the conditions which govern
the elements underneath them, but it is not mandatory.
Create Element
Elements will be created under the composites at header and detail segment levels
as per the format required by the bank. Referring to the ABC and YBC bank
formats, create the fields with following names. These fields are part of the header
record in the file for ABC and YBC bank. Mapping rules for these fields are
explained in step 5.
A. Fields under header composite ‘ABC[Comp]’ for ABC bank.
CONSTANT1
BANK PROCESSING DATE
CONSTANT2
BP BANK BRANCH NO
BP BANK AC NO
CREATION DATE
TOTAMT
COUNT
BLANK1
CONSTANT3
BLANK2
B. Fields under header composite ‘YBC[Comp]’ for YBC bank.
CONSTANT1
TOTAMT
POSTING DATE
CONSTANT2
CONSTANT3
After adding the above fields for the two header record composites, the left hand
screen should look like this.
Fig-9
Similarly create the following fields for the detail records. These fields will be part of
detail records for ABC and YBC bank formats.
A. Fields under detail composite ABC_Detail[Comp] for ABC bank
CONSTANT1
CONSTANT2
POSTING DATE
CONSTANT3
CUST BANK BRANCH NO
CUST BANK AC NO
SYSDATE
AMT
CONSTANT5
CONSTANT6
CONSTANT7
REFNO
POSTDT
PAYMENT DOC NO
CONSTANT8
B. Fields under detail composite YBC_Detail[Comp] for YBC bank
CUST BANK BRANCH NO
CUSTBNKNO
AMT
PAYMENT DOC NO
REFERENCE DOC
CONSTANT1
CONSTANT2
After adding the above fields for the two detail composites, the left hand screen
should look like this.
Fig-10
Atoms
No Atoms created
Technical Fields
No Technical Fields are used here
mc
Aggregat Aggregati Reference Id:
ion on REF_COUNT_03
Agg. Type :1
BLANK1 Attributes Attributes 14 Cha Constant
r
Source Constant (Blank – No value)
CONSTA Attributes Attributes 2 Cha Constant
NT3 r
Source Constant 00
BLANK2 Attributes Attributes 48 Cha Constant
r
Source Constant (Blank – No value)
Source Constant 0
T DOC utes s r
NO
Sourc Exit ZDMEE_EXIT_
e function GET_PAYM_D
OC
CONSTA Attrib Attribute 20 Cha Constant
NT8 utes s r
Sourc Constant (Blank – No
e Value)
Fig-11
Glossary
References