Professional Documents
Culture Documents
Introduction:
DME stands for Data Medium Exchange
A data medium exchange (DME) is a data exchange file which is used to send
payment information of an enterprise to banks or tax authority. Basically these files
contain financial data which can be in flat file or xml file format. Different File
formats can be created for different countries and different banks based on their own
norm which replaces conventional ABAP programs.
Description : Z_IDES
Type : 01 File
Country : IN
Save!
Create a new format with the same name as your DMEE format tree. Choose
the format output Payment medium without docs., and type File.
Under Program control, set the Mapping using DME engine indicator. Once
this indicator is set, the DME engine button appears, which allows you to
access the DMEE format tree directly.
Under Format information, specify your country. You can also write
documentation for your PMW format by choosing the field help for
the Documentation module field. From there, choose Proceed, and a
document maintenance screen appears. Select document class General text,
enter a name for the text, and create the documentation. Lastly, enter the
name of this text in the PMW format in the Documentation module field.
DME Engine: Initial Screen (DMEE):
Select Active Version and press Copy.
Click on Change.
Here you need to give the format attributes for your DMEE output File.
In Delimiter Section I have taken | but you can use comma,semi colon or anything.
Delimiter separates the items in DMEE file by the input provided by you.
Header data should appear only once, so a value like the payment run identifier
(FPAYH-LAUFD) is the same for the entire payment run and file created. Next level
is usually the single payment (FPAYH-LFDNR), so the DMEE creates a new line for
every payment. Alternatively and based on the requirements, this could be done also
per vendor. Lowest level is usually the invoice references, as you can group several
vendor invoices in a single payment.
After This Goto File Data where you need to tick on Carriage return and Line Feed.
The tick on Carriage return and Line feed is for creatin new line after the finish of
Header Part.
Carriage Return is used for creating new line in word or PDF formart and Line Feed
is used for creating new line in XML format.
The tick on Carriage return and Line feed is for creating new line after the finish of
Header Part.
Carriage Return is used for creating new line in word or PDF formart and Line Feed
is used for creating new line in txt Format.
Add the fields to Header and Details as per the requirement and then save.
Now will show step by step for every Header and payment Details configured here.
In Header Part I have made it Constant which you need to choose in Attributes tab of
DMEE.
Give name(as I have given Header),Give Length and choose character as shown in
Screen Shot Below.
Go to Source Tab and write what you want to get in the output as shown in screen shot
below.
Please select Structure Field(I have taken Structure Field because it can be fetched
from the Tables and Field,Some data are there which you can fetch from tables so
either you have to make it constant or you have to use Exit Module).
Click on Source Tab.
You will find Field name,You can choose Field name according to your requirement.
As I have copied the standard structure where Segment group and Elements were
already there but you can definitely create segment group,segment and elements
according to the requirement.
Now click on the Source Tab and one need to provide structure and Field
name(though we are using Exit Module but we need to provide Structure and Field
name so that the data can be populated in the Structure and field given and system
populates the data in DMEE file through this Structure and Field)
I am giving the code as well which is done by ABAPER and it works according to
NODE ID.
CASE i_extension–node–node_id.
WHEN ‘N_8559886880’ .
IF l_item–fpayp–dmbtr LT 200000.
l_item–fpayh–formz = ‘NEFT’.
o_value = l_item–fpayh–formz.
c_value = l_item–fpayh–formz.
ELSE.
l_item–fpayh–formz = ‘RTGS’.
o_value = l_item–fpayh–formz.
c_value = l_item–fpayh–formz.
ENDIF.
Now click on Payee IFSC Code and Configure as given in the screen shot below.
PS:Please maintain the IFSC code of Payee bank in Control Data Tab in SWIFT
column in House bank .
Now in Vendor Master Data You need to maintain IFSC code in Reference Details
Field as shown in Screen Shot Below.
Now Click on Beneficiary Account No and configure as shown in Screen Shot Below.
Here also I have used Exit Module and the Coding is as follows:
Maintain bank account in vendor master in Bank account Column as Shown in Screen
Shot Below.
Now Click on Transaction Currency and configure as shown below.
Now Click on Amount and configure as Shown in Screen Shot.
Click on Name of Payee(Vendor) and configure as shown in Screen Shot Below.
Click on Vendor Email Id and Configure as shown in Screen Shot Below.
Here also I have used Exit Module.
Coding is as follows:
a) Payment Methods in Country: Create Pymt. Method ‘E’ for country ‘IN’. Define
the Currency.
In Payment Medium,Put Z_IDES in Format Column.
b) Bank Determination: For Paying Company Code ‘1000’, select Ranking Order.
c) Bank Accounts
Create Bank Account for 1000.
http://scn.sap.com/docs/DOC-65031
Then select Print Parameters and give the name of the printer.
Then Save.
As you know, our main transaction code for this post will be DMEE. Please be aware
that the examples used in this post are random and created for tutorial purposes to help
you understand how DMEE works
1. Go to Transaction Code DMEE, Enter the Tree Type and Format Tree, then click
Create.
2. You will encounter the question “What kind of file would you like to create with
the DMEE format?”. In our example, we will be using XML. As such, click on the
XML file button.
DME Tree Properties
3. You will now end up in the DMEE tree creation screen. For now, we have 1 row
called “DMEE tree: properties”. You need to fill out the tabs first before creating
anything else. The screenshot below shows that we are populating the
“Administrative Data Tab”
You can leave the documentation blank for now since that will only generate a Warning.
4. Click on the next tab called “Format Attributes”. Here you will see entries for
Format Data and Print Accompanying Sheet. You can click on F1 on your
keyboard per field to understand the usage more.
In the example below, I indicated Structure FPM_SEPA in the format specific structure
field so I can use its fields later on when I do mapping configurations for format
purposes. If you do not need this, you can leave this blank.
Fmt-spec.strct. : FPM_SEPA
Print accompanying sheet : Without accompanying sheet
In this example, I do not need an accompanying sheet. If you need more information on
this, you can check out the SAP Note on Accompanying sheet for a DMEE format .
Here is a screenshot of the FPM SEPA Structure Parameters for SEPA Formats. This
means that later on I can use the components or fields later on when I do mapping for
format purposes.
5. Click on the next tab called “Levels”. Here you will see a Level column and a
Repetition Factor column.
This may be intimidating, but simply think of this as how many times (repetition factor)
the information can be repeated per level.
What is the use of Levels in SAP DMEE?
Consider Scenario 1 above where we said Level 1 will only repeat once and Level 2 can
repeat 9999999 times. Now look at Scenario 1.1. This means that Level 1 details will
only occur once per output file and Level 2 details can occur multiple times in an output
file.
Level now talks about the hierarchy of the data in your output file. Level 1 can serve as
the header or in our example <Document> </Document>.
This time, let us consider Scenario 2 where we added a Level 3 and set the repetition
factor to 9999999. This means that Level 3 can only occur multiple times in a file. If you
notice, <Information> </Information> details are within the <Payment Details></Payment
Details> thus it being Level 3 in the hierarchy.
6. Click on the next tab called “Sort / Key Fields”. Here you will specify what type
of information (structure and field) you can find per level. In our example below,
we are saying that we need some fields from Structure FPAYH and these details
will be found on Level 2.
Since we specified Level 2, that means we expect these details can be repeated multiple
times in one output file.
If you select the Key Field, it means that any change in the value tells SAP that the level
has ended. If you select the No Sorting Field, then there will be no sorting whatsoever
for that field in that specific level.
In our example, DOC1R is a field denoting a payment reference from Structure FPAYH
and we indicated Level 2. In this case, we can expect multiple payment references (up to
9999999 times) to occur in one output file.
7. Click on the next tab called “File Data”. Here you need to specify which
characters you want to allow OR which characters you do not allow.
8. You are now done with the DMEE tree properties. You can now create nodes
according to your needs. As a refresher, below is a Node Legend for you to refer
to. You can always go to Extras > Node Legend for information. Click on the
Information Icon to obtain details for each.
It can be quite technical, but I have added some personal keywords per node. Feel free
to use your own keywords according to how you best understand them.
This won’t show up in the XML file. You can define exit modules / function modules here
Technical Node
or even store values from other nodes here.
To define a mapping rule or more than one mapping rule. You need to display certain
values in one line from different fields. For example, use 3 atoms to output the
Atom
combination of 3 difference numerical codes from diff fields from SAP to make up a one
liner combination like “Field1 + Field2 + Field3” = “AA123BB”
Selected Node
You double clicked the node and have it currently selected. You are viewing this node.
for Detail View
Reference ID of
You have entered details in the Reference ID field in the Node.
Node
Reference to You referenced another Node (by indicating the Reference ID either through mapping
Another Node rules, conditions, or aggregation).
Exists
9. Right click on DMEE tree : properties and Select Create Element. You should
have a New Element as seen in the screenshot below.
Let us analyze our XML file below. We want to show the <Document></Document> tags
in the output file and we need to make sure it only occurs once.
Inside the document tag we have xlmns and xlmns:xsi and their corresponding
information. This means that we can create an XML Attribute to add extra details IN our
<Document> tag.
12. Right click on the 1st element you created (Document) and select Create
Attribute.
You should have the following screen below:
13. Let us create XML Attribute 1. We can expect this XML Attribute to include
details within the <Document> tag.
If you need to change the default value of Atom handling simply select an option.
14. This time, let us create XML Attribute 2. Right click on the 1 st element you
created (Document) again and select Create Attribute. We can also expect this
XML Attribute to include details within the <Document> tag.
Name : xmlns:xsi
Short Description : xmlns:xsi attribute
Mapping Procedure : Own Mapping (Atoms)
You can drag the XML attributes up or down in the tree to arrange them.
By now, hypothetically speaking the XML output would be the image below. We have
the xmlns and xmlns:xsi but we are missing the details for each attribute.
15. On the XML Attribute (xlmns), right click and select Create Atom.
16. Enter the additional details needed for this XML Attribute 1
Name : ISO
Short Description: ISO Details Atom
Length : 70
Type : Character
Mapping Procedure : Constant (This is a fixed value all the time. It will output the
same value)
We declared the length as 70 since our structure FPM_SEPA says the length of XMLNS
is 70. The same approach follows thereafter.
17. Click on the next tab called “Source”. Here will copy paste the constant value
as needed.
Constant : urn:iso:std:iso:20022:tech:xsd:pain.001.001.03
Note that if you need this value to be present ALL the time, you can follow by clicking on
the Conditions tab and specifying the conditions below.
Arg 1-1 reference value that should be checked (our example stated the structure)
Arg 1-2 field value
Type argument type (1 for constant value, 2 for field in source structure, 3 for
reference ID)
Operator logical comparison for the conditions
Arg 2-1 comparison value
Arg 2-2 comparison value field value
Type argument type for comparison value (same as previous Type)
Operator linking operator used if you have several other conditions / lines (AND / OR
values only)
Press F1 button on keyboard to double check further per entry.
18. Enter the additional details needed for this XML Attribute 2
Name : ISO
Short Description: ISO Details Atom
Length : 70
Type : Character
Mapping Procedure : Constant (This is a fixed value all the time. It will output the
same value)
19. Click on the next tab called “Source”. Here will copy paste the constant value
as needed.
Constant : http://www.w3.org/2001/XMLSchema-instance
Now that we are done with our XML attributes in the <Document Tag>, let us level up
our scenario.
20. Consider that within the <Document> </Document> tags, we need to include
payment details as seen in the XML file below. This means that we need to add
<Payment Details> </Payment Details> tags in our tree.
21. Right click on the (Document) element node and select Create Element as
Subnode. We are doing this because we are considering that the Payment Details
go within the Document tags.
22. You should have a sub node element under Document. You can now fill in the
details as seen below.
Name : PaymentDetails
Level : 2 (This means that payment details can occur multiple times in 1 output file)
Mapping Procedure: No Mapping (No mapping It is just a tag we want to output.)
Other Tabs : Leave BLANK
By now you have created the <PaymentDetails> </PaymentDetails> tag within the
<Document> </Document> tag.
23. Now let us add to our scenario and consider that we need several information
within the <PaymentDetails> as seen in our XML file below.
From the file we can see that we need the following information below:
For this example, recall that we can create the xml tags accordingly as Elements (sub
node elements to <PaymentDetails>. From here, I can introduce the concept of
“Mapping Procedure: Structure Field”.
In SAP, we can obtain the needed information from these standard SAP structures.
Consider the breakdown below. Screenshots also provided for the structure and field.
Name : CompanyCode
Short Description : CompanyCode Element
Length : 4 (We just followed the length indicated in the corresponding structure-field)
Type : Character (We just followed the data type indicated in the corresponding
structure-field)
Level : 2 (This means that we can expect multiple instances of this in one output file)
Mapping Procedure : Structure field (We will indicate the corresponding structure-field
in the Source tab)
25. Click on the next tab called “Source”. Here you can specify the corresponding
structure and field for for this node as seen below. Basically, when you generate
the DME output, it should pull the value from the corresponding structure and
specified field.
26. Now you can create the next node. In this case, right click on the
CompanyCode element and select Create Element Same Level. This option is
selected because the next few payment details will be on the same level. There are
no further details within each of these payment details.
You should have the following screen below where you can continue the same approach
up until the last request detail which is Amount.
Follow the same process of creating an element at the same level. Below is the
continuation for BankAcct.
Note: for amount be sure to indicate that it is Type Numerical because we are talking
about a numerical value. You may be confused why Length is “10” instead of what is
specified in the structure but you can consider it as a limitation measure to keep the
amount value to 10 digits only.
The same approach applies where you map the corresponding structure and field.
27. Finally, we are complete with out DME tree. If you have not saved your creation
yet, be sure to hit the Save button where you can save the setup in a Workbench
Request as seen below.
Final Output
Additional Information
It is important to note that the format tree name you create in DMEE has to be the same
as the payment medium format name you enter in OBPM1. Also, don’t forget to indicate
the structure format specified in DMEE in OBPM1 as well.
XSLT Program for Postprocessing
You can specify an XSLT Program for Postprocessing before the DME output file is
finally generated. This can be used to enhance the structure of the format tree. The
program is declared in the “DMEE tree: properties” Format Attributes Tab.
Reference ID of Node and Reference to Another Node Exists
We can assign the a Reference ID to once of our nodes in the DME Tree. In the
screenshot below, you see Reference ID “REFID1” in <CompanyCode>. Notice how the
tree shows the Reference ID’s beside the CompanyCode node.
Let us say I added that Reference ID so I can reuse the information later on. For
example, I create another Element / Node called “Payment Footer”. I then put the
Mapping Procedure as “Reference to tree node”.
In the next tab “Source”, you will see that I entered “REFID1” to the source.
Alternatively, I can also opt to indicate Mapping Procedure “Aggregation” and go to the
Aggregation Tab. This can output the number of occurrences based on the Aggregation
Type selected.
This is of course a trivial example. You can realistically use this approach if you want to
output the number of transactions in an output file etc.
Technical Nodes
You can utilize SAP Formatting Structure FPM_SEPA as mapping for XMLNS and
XLMNS:XSI formatting. Simply create an Atom under the XML Attribute xmlns or
xmlns:xsi and specify the corresponding structure and field. Screenshots below.
XML Attribute xmlns
XML Attribute xmlns:xsi
There are different structures of DME Files depending on the requirements. In the
example below, there are other nodes utilized. Here we see a Root, Header Record,
Total etc. You can freely explore this Format Tree example as it will give you first hand
overview on how it is used.
https://www.youtube.com/watch?v=JzhSgoWq7Wc – PART 1
https://www.youtube.com/watch?v=qOnRwBk3uEc – part 2
Final output in XML OUTPUT file