Sei sulla pagina 1di 25

Configuration of DME Payment Files in SAP R3

Configuration of Data Medium


Exchange (DME) Payment
Files in SAP R3

1 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Introduction
This paper attempts to provide simple Configuration tips while defining DME (Data Medium
Exchange) Payment file in R3.

Requirement
Of late most of the organisations send an Electronic Payment File to Banks and Financial
Institutions which contains all the Payment Details. The Banks and Financial Institutions define
their own file formats and accept the files from their clients in the same format. There is no standard
format universally used by the Banking organisations.
Hence it is becomes imperative for the bank customers to design a file in the same format as
acceptable to the bank.

Solution Overview in R3
In R3 there is a simple tool Data Medium Exchange Engine which enables you to define a file
format that is acceptable to banks. This tool does not require any ABAP knowledge.

Data Medium Exchange Engine


Creation of a DME file format is better explained by the following example.
Following is the file format details that are required by the Bank
S.No. Level Field Character Additional field attributes
Length
1 1 Record ID 3
2 1 Sender Name - Payer 15
3 1 Account Number - Payer 15
4 1 Bank ID - Payer 10
5 1 Creation Date 8
6 2 Record ID of Business Partner 3
7 2 Business Partner 20
8 2 Business Partners Account Number 15
9 2 Business Partners Bank ID 10
10 2 Business Partners Bank Name 15
11 3 Payment Record ID 3
12 3 Payment Sequential Number 4 Right justified Numeric Characters
13 3 Payment Amount 15 Amount left justified with 2
decimals
14 3 Payment Currency 4
15 3 Euro Indicator 1 Indicator for Euro Payments. If it is
a Euro payment it should indicate
Y, else N
16 1 Footer Record ID 3
17 1 Sum of Payment 15 Amount left justified with 2
decimals

2 Sanjay Babel
Configuration of DME Payment Files in SAP R3

The file can be created as follows:


1. Creation of Payment Medium Format
Menu Path: SAP Customising Implementation Guide > Financial Accounting > Accounts
Receivable and Accounts Payable > Outgoing Payment > Automatic Outgoing Payments >
Payment Media > Make Settings for Payment Medium Formats from Payment Medium
Workbench > Create Payment Medium Formats

Create a new Format.


a. Specify the name of the format SAP_EXAMPLE
b. Specify the file Type: 01
c. Country: CN (example)
d. Check the box Mapping using DME Engine
e. The output media file can be divided based on Company Code, House Bank, House Bank
Accounts, Debit / Credit Memo or Payment Method

Click DME Engine . You will reach the screen of format tree creation.

2. Creation of a Format Tree


Enter Tree Type: PAYM.
Enter Format Tree: SAP_EXAMPLE

Pls. note that the Payment Medium Format Name created in Step1 above should be identical to the
DME Format Tree Name.

3 Sanjay Babel
Configuration of DME Payment Files in SAP R3

The format tree creation screen is divided into 3 parts as shown below
1. Tree Structure
2. Details: This place the attributes of the nodes are specified
3. Source Fields: This place contains the source fields from where the data is extracted and
mapped to the various nodes

Details

Tree Structure

Source fields

Tree Structure
In this section, the format tree is defined by inserting nodes and specifying their attributes in the
Details view in line with the file format requirements.
The format tree structure has two parts
1. Header
2. Nodes

Header

Nodes

4 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Header: The Header Node is generated automatically when a new format tree is created. On the
right hand side in Details you specify all the attributes that are applicable to the entire file. This
consists the following:
I. Administrative Data: In this section the a short description of the file format is maintained. In

addition, documentation text about the file can be maintained by clicking

II. Format Attributes: This screen is divided in three sections as shown below

The field type 1 is used when you intend to have fixed field positions in which case the
field is valid even if it is blank. Field type 2 is used when you separate 2 fields by some
delimiter and the field position depends on whether other fields are filled up

The delimiters like , or / or : or _ etc can be defined here as delimiters between segment
groups or segments or composites

Whether an accompanying sheet is to be generated or not is specified here

III. Levels: The number if levels required in the file are defined here.. Also a Repetition limit can be
specified here for each level. The number here restricts the output of that particular level in the
media file.
In our example it is unto 3 levels as seen in the file requirement and Repetition can be maximum

5 Sanjay Babel
Configuration of DME Payment Files in SAP R3

IV. Sort/Key fields: In this section, you can specify how the fields are sorted out at a specific level in
the file. One can specify Company Code or Currency or Account as the fields according to which
the file data shall be sorted. This is done by specifying the source field in a proper sequence.
In our example we sort Level 1 first Company Code and then by Bank Account Number. Level 2
is sorted by Payee and Level 3 by Document Number. If an accompanying sheet is also to be
printed, one has to check the key fields by which subtotals are required in the accompanying
sheet.

6 Sanjay Babel
Configuration of DME Payment Files in SAP R3

V. File Data: If required the segments can separated by Carriage feed or line feed. This is specified in
the File Data tab.

Carriage feed is inserted at the end of segment

Line feed is inserted at the end of segment

Prevents characters specified above in the file

Allows only characters specified above in the file

Nodes
In the format tree there are 6 different nodes that can be defined. They are as follows:
S.No. Node Description Where used
1 Segment Group To group segments
2 Segment To represent record in the file
3 Composite To group elements
4 Element To represent a target field in the DME file
5 Atom To describe the link from the file definition to
the internal R/3 structures
6 Technical Node To store some value (by reference to this node)
but not a target field in the output file

In our example, we will create a Segment Group which will have two segments viz. one for
payment details (Header) and other for total amount (Total). Within Header we will have another
segment (Business Partner) so as to group payment line items for a single payee together and then
another segment (Payment record) under Business Partner segment where all the actual Payment
records will be output. The screenshot below explains this

7 Sanjay Babel
Configuration of DME Payment Files in SAP R3

This groups together the segment Header Record and Total

This segment is created at Level 1 which outputs the Payment


records from the same sender name and same sender bank
account

This segment is created below Segment 1 at Level 2 which


outputs Payment records to the same Payee

This segment is created below Segment 2 at Level 3 which


outputs Payment records for a given Payee

This segment is created at Level 1 which summarises all the


Payment records

Mapping the source fields.


There is a mapping procedure to be followed to source the data for various fields. The necessary
nodes should be created in the left block of the screen as shown below

Once the nodes are created a detailed view is automatically generated on the right hand side with
the tabs Attributes, Source, Aggregation, Conditions and Comment. These tabs describes
the entire node.
Attributes

8 Sanjay Babel
Configuration of DME Payment Files in SAP R3

This is the place where


we specify the name,
description, length ,
character type or the
Field length in the file,
Conversion function (if
any) for a given node.
Conversion function
means for instance
having the date in
some format
(egDDMMYYYY)

Every node should be


mapped to one of these
alternatives. The use of
each of these is
explained below

Constant: If the field has some constant value, this field is checked and the value is entered in the
Constant field of the Source tab as shown here

Structure field: If the field is to be extracted from R3, this field is checked and the source field is
specified in the Source tab. Normally in Payment files we source the fields from FPAYH,
FPAYP and FPAYHX structures. The screen shot below explains it further.

The user can pick up the source field on clicking this icon appearing on the right side of Field
Name

Reference to tree node: If the value of this field is to be derived with reference to some other node
in this tree structure, then this field is checked and that other field Reference ID is specified in the
Source tab

9 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Aggregation: If a total of values of some other field is required, then this field is checked and the
Reference ID of that other field is specified in the Aggregation tab

Exit Module: If the value of this field is to be derived by using some exit module, this field is
checked and the name of the Exit Module is specified in the Exit Function section of the Source
tab

Own Mapping (atoms): If the value of a field is to sourced from more than one R3 fields then this
field should be checked, and atoms are created each of them having been mapped properly. E.g. the
field should have Date and time concatenated, then two atoms are created under an element. The
element is checked for Own Mapping (atoms). The screen shot below show this properly.

System date has the following Attributes and source tab information

10 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Source

Similarly System time has proper field mapping

Note: This field can also be used if the value of a certain field in the file is derived with some
Conditions. In such a case, the conditions are specified in the Conditions tab

11 Sanjay Babel
Configuration of DME Payment Files in SAP R3

In the bank file format in this example, the mapping procedure required is as follows:
S. Leve Field Mapping Procedure Source tab (S)/ Aggregation tab
N l (A)/ Conditions tab (C)
o.
1 Header Record Segment Node
1 1 Record ID Constant (S) Value of Constant = HD
2 1 Sender Name - Payer Structure field (S) Structure = FPAYHX and Field
= AUST1
3 1 Account Number - Payer Structure field (S) Structure = FPAYHX and Field
= UBKNT
4 1 Bank ID - Payer Structure field (S) Structure = FPAYHX and Field
= UBNKL
5 1 Creation Date Structure field (S) Structure = SYST and Field =
DATL0
2 Business Partner Segment Node
6 2 Record ID of Business Partner Constant (S) Value of Constant = BP
7 2 Business Partner Structure field (S) Structure = FPAYH and Field =
ZNME1
8 2 Business Partners Account Structure field (S) Structure = FPAYH and Field =
Number ZBNKN
9 2 Business Partners Bank ID Structure field (S) Structure = FPAYH and Field =
ZBNKL
10 2 Business Partners Bank Name Structure field (S) Structure = FPAYH and Field =
ZBNKA
3 Payment Record Segment Node Reference ID in
Attributes=COUNT
11 3 Payment Record ID Constant (S) Value of Constant = PY
12 3 Payment Sequential Number Reference to tree Reference Node ID = COUNT
node Attribute = 3 (Counter reading)
13 3 Payment Amount Structure field (S) Structure = FPAYH and Field =
RWBTR
Reference ID in Attributes
tab=AMOUNT
14 3 Payment Currency Structure field (S) Structure = FPAYH and Field =
WAERS
15 3 Euro Indicator Own mapping
(atoms)
15 Euro (Yes) Constant (S) Value of Constant = Y with
a Condition (C) WAERS value=EUR
15 Euro (No) Constant (S) Value of Constant = N with
b Condition (C) WAERS value <>
EUR
1 Total Segment Node
16 1 Footer Record ID Constant (S) Value of Constant = SU
17 1 Sum of Payment Aggregation (A) of reference ID = AMOUNT
(Field 13 in our example)

12 Sanjay Babel
Configuration of DME Payment Files in SAP R3

All the above fields settings in the tree structure are as shown in the screen shots below:
Header Record

This segment is created at Level 1 as seen above


No Conditions are required. Comments can be inserted if required

Record ID: Attributes tab

13 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Record ID: Source tab

Sender Name: Attributes tab

14 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Sender Name: Source tab

Account Number: Attributes Tab

15 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Account Number: Source tab

The fields Bank ID and Creation Date are similarly mapped in the tree structure

The segment Business Partneris created at Level 2

16 Sanjay Babel
Configuration of DME Payment Files in SAP R3

The fields Business Partner, Account Number, Bank ID, Bank Name, are mapped to the
structure fields as mentioned in the Mapping table above

The Payment Record segment is created at Level 3 under the Business Partner segment

There is a requirement to count the number of Payment records in the field Sequential Number in
this segment. This would be achieved by setting a counter at that node with reference to this
segment Payment Record. Hence this segment has been given a Reference ID COUNT. This is
marked in the red box above.

The node Sequential Number is mapped to Reference to Tree Node to Segment Payment
Record and the counter is set to 3 in Attributes which serves a counter.

17 Sanjay Babel
Configuration of DME Payment Files in SAP R3

The node Payment Amount is also given a Reference ID AMOUNT

There is a need in the file to specify which are EUR payments and which are not. This can be
achieved by creating a Element Node and two atom nodes just below it. Also there will be a

18 Sanjay Babel
Configuration of DME Payment Files in SAP R3

condition tied up to these nodes which will check if the Payment record has got EUR currency. If
it has EUR the field will output Y or else N. The screen shot below further explains this
The Euro Indicator Node

Atom Node EURO Yes has a constant Y mapped to it and a Condition to check the currency is
attached in the Conditions tab. The screen shots of all the three tabs are seen below
Attributes:

19 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Source:

Conditions:

Similarly Atom Node EURO No has a constant N mapped to it and a Condition to check the
currency is attached in the Conditions tab. The screen shots of all the three tabs are seen below
Attributes:

20 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Source:

Conditions:

Next the Total segment is created at Level 1, since this would be output only once in the file

21 Sanjay Babel
Configuration of DME Payment Files in SAP R3

There is a requirement to output the total amount of all the Payment records in the file. This is
achieved in the last node. This node is mapped to Aggregation procedure and the Reference node
for summing up used is Node Payment Amount with Reference ID AMOUNT.

Aggregation tab

22 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Checks
After the tree is maintained there is a manual check for checking the correctness of the file. This can
be carried out anytime while defining the tree. The Manual check may output a log of message
which are either errors or warnings or information. These errors should be solved before activating
the format tree.

Activation of Format Tree


A format tree is initially created in Maintenance Version (001). After it is complete and errorless, it
is activated. The system then stores it in the Active Version (000).

Creation of Payment Medium Report Medium


The DME file report variant is attached to the Payment Medium Format. This variant is created as
follows:
MenuPath: System > Services > Reporting
Specify the Payment Program name SAPFPAYM
Goto Variants
Specify some variant name and then click Create
Enter the Payment Medium Format: SAP_EXAMPLE
Check the box Data Medium Exchange
Specify the file name in the field File Name if the file is to be stored in the file system
If the file is to be stored into SAP system (Tem se), the name of the file is specified during
downloading the file after running the Payment program
Save the Variant

23 Sanjay Babel
Configuration of DME Payment Files in SAP R3

Running the Payment Medium Program


On successful completion of the Payment Run, the Payment Medium Run program is executed.
This is done as follows:
Click Schedule Print
In the following screen specify the start date and time and the Job Name

Click Enter
The system gives a message The Print job is scheduled

Data Medium Administration


The data medium file generated can be accessed through the Data Medium Administration
After scheduling the Print job,
Goto Environment > Payment Medium > DME Administration

24 Sanjay Babel
Configuration of DME Payment Files in SAP R3

This takes you to the Data Medium Overview. Here you can download the file generated or view it
or delete it if required.

Conclusion
The Data Medium Exchange Engine (DMEE) helps to define file formats that meet the
requirements of your financial institution.
This Paper explains the steps to be followed while creation of a DME Payment File.With no ABAP
programming knowledge required, this tool enables you to flexibly define new formats and to
efficiently modify existing ones.

25 Sanjay Babel

Potrebbero piacerti anche