Skip to Content
Technical Articles
Author's profile photo Marek Turczynski

How to create your own DMEE/X Tree Type? Part 1 of 2

Introduction

Almost every SAP consultant in Finance area associates DMEE transaction with building own DME Trees for payment using the most commonly used Tree Type PAYD.

In some countries consultants also see that other tree types are used like DSLH / UMS1/ ASLD etc. for providing VAT statements/ EC Sales list etc.

It looks like DME could be used to build any type of XML based on any information. This leads to searching on internet questions like ‘how to create your own DME tree type’ and to be honest this is also what I was trying to look for. This question remains mostly unanswered because there is nowhere a description on how to create/ customize and most of all – successfully run your own tree type.

Curiosity pushed me to investigate on that matter and having successfully created an own DME Tree Type I would like to share this knowledge so that all fellow consultants can get this low hanging fruit and use it in their future ideas how to handle both legal and non-legal requirements of XML file creation.

An Idea

Extensible Mark-up Language – XML – is the abbreviation that currently all tax and financial authorities are focused on in Europe (and not only). Country by country, type by type everything needs to be shared by each company with authorities so that big data analysis and easier fraud detection can be conducted.

Every ERP system must be able to produce XMLs with required data otherwise huge penalties threaten. This includes SAP – so SAP developed a tool called eDocument to extract / map / receive information. This tool is offered in Basic and Full version. It is paid by package of documents and requires additional licences and fees for the SAP Cloud Integration with financial authorities. This is quite a handy tool but it cannot handle all information like for example extracts of simple FI documents which were not created by means of SD document.

Therefore quite some number of SAP Partners developed additional tools to produce the files in desired format and interface them with tax authorities.

Standard Audit File requested by countries like Poland, Portugal and some others is another example of Tax data to be delivered – unfortunately not in every country SAP is delivering solution in standard – for example in Poland it is an add-on that needs to be purchased additionally and undergoes a separate license fee.

All that resulted in companies taking over the development and building own solutions. This requires some extraction tables/ reports and XML creation. Developers would probably tend to use XML transformation which is quite an uncomplicated tool but then the whole mapping logic/ conditions would need to done in the extraction reports making it less flexible to adjustments (as practice shows – almost each year authorities adjust the file structure).

How to start

DMEE tree definition is not complicated but there are some rules to follow which will be presented further.

The definition created for usage of this blog will be an extraction of invoice data – lines, header and deliveries.

Create communication structure

At first the communication structure should be defined – there could be in total 3 different structures:

  1. Main communication structure
  2. Additional information structure
  3. Format specific structure

The structures defined here will be structured in following way:

  1. Main communication structure:
    1. Data from VBRK
    2. Data from VBRP
    3. Data from LIKP and LIPS
  2. Additional information structure:
    1. Company Code Data

Format specific structure will not be used in this example in data creation.

Main communication structure

This structure is normally used as main comfort DME file that contains header/ item etc. information and is used to build XML structure based on delivered items.

Here 3 structures were created:

ZDMEE_INVOICE_HEADER – containing some of the VBRK fields

ZDMEE_INVOICE_LINE – containing some of the VBRP fields

ZDMEE_DELIVERY_LINE – containing mix of field from LIKP and LIPS

These will be used to pass information to DME Tree for items creation.

As there will be 3 data sources for main communication structure there must be a data type (here ZDMEE_INVOICE_DATA) that groups them:

Pay attention to component naming because it must have the same name as the type! The reason for that is that DME Tool tries to dynamically create the structure based on the component name and fields included in the corresponding type.

If component names would vary from the component type, like in example below:

Then during execution of DME Engine a dump would be generated that the type is unknow.

Additional information structure

This structure is normally used to pass additional information that is not changeable based on items – like company data / analysis period etc.

 

In this example we will pass company code data using structure ZDMEE_ADD_PARAMS:

That use underlying structure ZDMEE_INVOICE_ADD_DATA where communication fields were entered:

DME configuration allows to create 2 additional communication structures – second is for example used in PAYM Tree to pass Note To Payee data (DMEE_PAYM_IF_TAB).

In our example we will not use a second communication structure as it is not needed for the tree type presented.

Create own DME Tree Type

Having prepared communication structures we are ready to create own DME Tree Type in customizing.

There is no IMG access to this customizing so direct table maintenance via SM30 is required. View used for definition of DME Tree Types is V_DMEE_TREE_TYPE:

Pay attention while doing changes in this table that the standard delivery provided by SAP is not changed – otherwise existing DME Trees will stop working.

For usage of this blog DME Tree Type ‘ZZIV” will be created – start names of your types either with Z or Y or with / – these are unused by SAP. It will be foreseen only for outgoing information.

Add new entry in the table with specification of interface types:

In this case the sequence of interface types is as stated above main communication structure followed by first and second additional communication structure.

In next fields specify the description of your type:

As additional information specify:

The documentation object- default is DMEE_TREE_TEMPLATE but pay attention that this is mainly foreseen for Tree Type PAYM.

In addition each DME Tree that will be created using this type can have own documentation specified.  These texts are stored in SE61 under type ‘TX’ (General text).

Also authorization group for maintenance of DME can be specified.

As last information that the key fields do not need to be sorted in the output can be specified. This controls the usage of field ‘No Sorting’ in DME Parameters:

The DME Tree Type created can be saved afterwards – from this moment on it is possible to use it.

Create own DMEE Tree

As a last step in DME creation a specific tree should be created – for this use DMEE transaction and specify your Tree Type:

Then just give it a name and create a new tree.

In this example following XML tree will be created:

All the fields defined in communication structures are available:

The DMEE Tree presented in this blog is now available on Githib for free download:

File: INVOICE_DATA.xml

 

Save the file as XML and upload using DMEE / DMEEX Transaction.

File was generated with ‘Target-release 4.6C’ to ensure that everyone can upload the file into own system.

This concludes the customizing steps for creation of own DMEE Tree Type.

In second part of own DMEE Tree Type handling I present how to call it in simple custom program and get an proper output.

Thank you for reading,

Marek Turczyński

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Ashfaq Attar
      Ashfaq Attar

      Excellent presentation

      Author's profile photo Marek Turczynski
      Marek Turczynski
      Blog Post Author

      Thanks,

      I genuinely hope that using own DMEE will be used as alternative to XML transformations which are not that easy to adjust and handle as DMEE (+ DMEEX in S4/HANA).

      Marek

      Author's profile photo Former Member
      Former Member

      Hi Marek,

      hope so, too, but we may start seeing more JSON formats replacing XML.

      no inside info, just a hunch to where the financial services industry is headed.

      Cheers,

      greg

      Author's profile photo Philippe Gauthier
      Philippe Gauthier

      Thanks Marek Turczynski,

      Your posts are very explicit, like you said in Finance we are using a lot, and like you I use it for outbound interface simple to implement, flexible in DMEE (by adding some code direct in DMEE) and easy to use. thank a lot, I keep it in my favorite

      Author's profile photo Marek Turczynski
      Marek Turczynski
      Blog Post Author

      Thank you Philippe Gauthier

      I am glad to hear that I am not the only one who is using it actively. You mentioned custom code directly done in DMEE - this is another great part of DMEE usage where you can make country/ company/ any specific adjustments without changing source code of the calling report.

      Author's profile photo Nishant Kumar
      Nishant Kumar

      Thank you Marek Turczynski, , very well articulated

      Author's profile photo Wouter van Heddeghem
      Wouter van Heddeghem

      Great blog Marek ! Thank you !