Use of conditions in DMEE-tree
Hello, SAPers!
Quite recently I worked on implementation of budget payment orders (taxes, social payments etc.) for our Client. First of all, I compared the structures of ordinary and budget payment orders and found out that there is a dozen of extra fields in budget payment order that are not supported in an ordinary payment order. So the task boiled down to add these extra fields to the existing DMEE-tree (for ordinary payments), however output them only when certain conditions are met. I decided to implement this requirement using conditions in DMEE-tree. As it turned out, this functionality is quite simple, but when you try to use it for the first time it will take some time to understand the mechanics behind it. Let’s take a closer look at this functionality.
Condition technique is a standard functionality in DMEE that enables you to control whether a node would be processed during the generation of payment orders or not. Basically, if the condition for a separate node is not fulfilled then the node will not be processed and hence not displayed in the file with payment orders. The conditions can be configured for any node type. If the condition should apply to several fields, you can apply it to a composite node () or a segment (
) that contain these fields.
For configuration of conditions you can reference either the field values in source structures (i.e. FPAYH, FPAYHX and FPAYP) or the values in another nodes of DMEE-tree. We will consider the implementation of both cases. The following are typical fields used in configuration of conditions:
– Arg.1-1 contains reference value that should be checked (reference node, source structure (FPAYH, FPAYHX and FPAYP) or a constant value);
– Arg.1-2 contains the field of the source structure or a node attribute that should be checked (e.g. 1A – contents in internal format; 1 – contents in output format if some conversion was applied etc.). The list of all options can be checked via help options (F1). In case you specified the constant value in Arg.1-1, this column should be empty.
– Type contains the reference to an argument type of reference value (1 – constant value, 2 – field in source structure, 3 – reference ID).
– Operator specifies which logical comparison should be applied to the reference value in order to fulfill condition criteria.
– Arg.2-1 contains the comparison value against which the reference value should be compared (the same possible values as for Arg.1-1).
– Arg.2-2 contains the attributes of the value (the same possible values as for Arg.1-2);
– Type for the comparison value serves the same purpose as for the reference value.
– Operator contains the linking operator and is used in case of several conditions (AND – if both conditions should be met; OR – if some of the conditions should be met).
1.1 Condition via Reference to another Node of DMEE-Tree
Case: for foreign vendors additional field with information on house bank SWIFT code should be displayed.
First of all, you have to configure the reference node. You can use the existing fields of the DMEE-tree or you can define technical nodes () to store reference values that should not be displayed in payment order. If there are several technical nodes, you can create separate segment to group them together. In this example a segment with technical node will be used. In any case, specify meaningful reference ID for the node whose value should be checked e.g. VEND_COUNTRY. You can use all standard mapping options to fill this field. In this case a field from the source structure will be used (FPAYH-ZLAND). Example of reference node can be found below.
Remark: DMEE-tree for this example uses segment with two elements LABEL and VALUE. Label element is mapped to a constant text value (tag) that by default equals to the name of the segment e.g. “CLN_BANK_SWIFT=”. Value element contains the actual value of the payment order tag. Typical example can be found below:
Condition will be applied on segment level, thus it will effect both elements. In order to meet stated requirements, the following condition was configured:
This solution might be good if you use the DMEE only for a specific country (e.g. Ukraine in my case). But if you want to configure it more flexibly in order to use across several countries you will have to modify and check whether vendor country equals the country of company code. This data is available in source structure (FPAYHX-LAND1). The condition should be configured the following way:
Alternatively, you can use complex condition containing the list of specific countries for which the condition applies e.g.:
In any case, the result would be the same (except the third option): there would be additional line with house bank SWIFT code for the second payment (payment to a foreign vendor).
1.2 Condition via Fields of Source of Structure
Let’s consider another case building on a previous one. Suppose you want to display IBAN number for a foreign vendor (if it is configured in master record). For a local vendor, bank account number should be displayed instead (if there is no IBAN number).
The first complex condition checks whether the country of vendor is the same as the country of company code and there is no IBAN in master record. If both of these conditions are met, the segment will be processed and bank number will be output (source: FPAYH-ZBNKN). If one of them is not met, the segment will not be processed.
The second condition checks whether the country of vendor differs from the country of company code and there is IBAN in master record. Similarly, if both conditions are met the segment will be processed and IBAN number will be output in file (source: FPAYH-ZIBAN).
As can be seen from the attached screenshot, bank number of the local vendor is displayed in tag RCPT_ACCOUNT and IBAN number for a foreign vendor in tag RCPN_IBAN.
I hope you will find this information useful if you are interested in topics around payment medium workbench and DMEE-trees.
All suggestions are welcome!
Best regards,
The Wirtschaftsmann
P.S. Disclaimer.
All sensitive information (bank accounts, company names etc.) used in this example is invented by my own. If there is some coincidence with real-life companies, it is a purely accidental one. The structure of the DMEE-tree represents a real-life example alghouth I modified it for the purposes of this blog post.
P.S. This post can also be found on Medium platform under the following link.
Hi The Wirtschaftsmann,
Nice document. Thank you for sharing with us 🙂
Regards,
Prasad
Hello Prasad,
Thank you for feed-back.
Hi,
that is a nice explanation. However I am facing an issue with conditions that use reference ID. In my particular instance I want to set the condition: If the reference field (which is exit module) is empty...I get a message that reference ID CHRG cannot be used. The condition looks like this:
Any ideas what might be the case? Are there any limits what can and cannot be referenced?
Thanks a lot.
Regards,
Ondrej
Hi Ondrej,
Could you please provide me some more details about the problem so that I might help you with the issue.
Best Regards,
Ayush
Hi Ayush,
thanks for you reply. I solved it somehow - I am not sure how 🙂 . I think the problem was that the Node level was not the same.
Regards,
Ondrej
Thank you very much for the description.
Could you give some more information regarding using constants in the condition ?
I am facing in a existing DMEE and do not know what the following set up actually does:
Arg1-1 Arg1-2 Type Operator Arg2-1 Arg2-2 Type Operator
1 1 = 2 1
and in another case
1 1 = 1 1
Thanks
Alex
Hello Alexandra,
Sorry for late response. Your conditions look quite complex and the reason for that is that at first look it's not clear what '1' in the field Arg1-1 stands for. But my first impression is that you just compare two constants '1' and '2' / '1' and '1', which to say the truth doesn't make any sence for me.
If, on the other hand, you have some node that has reference ID '1' and you would like to compare it's value against constant, I would suggest the following:
- to reconsider the naming conventions for reference IDs (just for convenience sake when you customize conditions you know for sure what business information reference ID represents).
- second to configure the condition as follows:
Arg1-1 Arg1-2 Type Operator Arg2-1 Arg2-2 Type Operator
1 1 3 = 2 1
This condition will have the following meaning: compare if the value of node with reference ID '1' in output format (Arg1-2) equals (=) constant value '2'.
Alternatively, if you want to compare a structure field against a constant, you should configure it the following way:
Arg1-1 Arg1-2 Type Operator Arg2-1 Arg2-2 Type Operator
FPAYH ZIBAN 2 = 2 1
In this case, put the name of the structure in the Arg1-1 field, and the name of the structure component into Arg1-2 field. The condition means: compare if value of structure component (FPAYH-ZIBAN) equals constant value '2'.
Hope this should help you!
Best regards,
The Wirtschaftsmann
Thank you for the reply.
The DMEE is a standard DMEE created by SAP - very strange. I know from regular coding things like "check 1 = 2" if you want to exit a loop etc. But it does not really make sence here.
Hi Bohdan Petrushchak
Nice document.
Thanks for sharing.
Keep up the good Work 🙂 🙂
Regards,
Eugene
Hello Ranu,
Thank you for feed-back!
Regards,
The Wirtschaftsmann
Hi Bodhan
Is it possible to use complex conditions on the nodes? For example
Argument 1-1 = 'Value1' AND Argument 1-1 = 'Value2' OR
Argument 1-1 = 'Value3' AND Agrument 1-1 = 'Value4'
So that it is processed as:
( Argument 1-1 = 'Value1' AND Argument 1-1 = 'Value2' ) OR
(Argument 1-1 = 'Value3' AND Agrument 1-1 = 'Value4' )
rather than processed as
( Argument 1-1 = 'Value1' AND Argument 1-1 = 'Value2' OR
(Argument 1-1 = 'Value3' AND Argument 1-1 = 'Value4' )
Thank you
Hi The Wirtschaftsmann,
Very nice document. It's been very useful. However, I'm with a problem that I have not solved yet. Maybe you can help me.
https://answers.sap.com/questions/341886/pmw-conditions-in-dmee-tree.html
Thank you,
Best Regards,
Alexandre Marques Folgado
Hi Michael Ryan,
I have the same question as you had. Is there a possibility to use complex conditions for DME nodes? Could you get any further information here?
Thanks in advance.
Best regards
Fabian
Hi Bohdan,
Thank you for the nice document and detailed explanation. Does anyone has a step by step configuration document of DME for US banks with detailed conditions mapping for various method?
Thanks,
Nick
Hello Bohdan,
I have a specific requirement for configuring conditions which goes as follows:
If FPAYHX-UBWAE=CAD, then number X
if FPAYHX-UBWAE=USD, then number Y
How can I put above in logic. I tried but it didn't worked for us.
Hi Ajay,
You can configure it as follows: create two identical nodes with mapping using constants - one of them containing "X", another - "Y". Setup condition for the first node as: FPAYHX UBWAE 2 = "CAD" 1; condition for the second node would the same just with "USD".
Hope it will help you!
Regards,
Bohdan
P.S. You should check this blog post more carefully again, it has all the tips necessary to make your conditions work:)
Hello Wirtschaftsmann,
I need to have a constant populated in a file based on a Date Day. So if the Date is 7/19/18 then Date Day = 19, and I want to use a constant value of 'VCA01'.
This is for a Virtual Credit Card Process where we need to alternate Virtual Credit Card Billing Cards to keep from going over the credit limit of each card.
So I have a System Date Structure Field formatted to DD with Reference ID of SYSDAY.
I have an Atom that is set for Constant with a Constant value of 'VCA01'
The Condition on this Atom is as follows:
Arg1-1 Arg1-2 Type Operator Arg2-1 Arg2-2 Type
SYSDAY 1A 3 = '19' 1
Instead of getting the Constant value on the Atom of 'VCA01' I am getting the Arg2-1 Value of '19'. Even when I say Operator >=15 I still get '19' in the file.
Any suggestions would be great!
Thanks,
Mary
Hi Mary,
Let me see if I understand your requirements correctly:
1) you've created a node with reference ID SYSDAY that stores a system date formated to DD?
2) you're trying to set up a condition for atom with constant value "VCA01": this atom should be displayed only if the day is equal to 19?
3) do you have several nodes for the same purpose with different values? Say - one node will display constant "VCA01", another will displayed another constant and so on, or do you have just one condition?
If the answer to 1) and 2) is yes, then I would suggest you to change Arg1-2 to "1". Argument 1A is used to check the date in internal format i.e. in case with date you'll compare fixed value 19 against a date in internal SAP format YYYYMMDD, which doesn't make sense. You should check against the value of SYSDAY-node in output format (i.e. after conversion routine for DD has been applied).
I'm not sure why you get "19" in your file. But if you have several atoms - might be that one of them has this value as constant.
Regards,
Bohdan
Hello Bohdan,
Thanks so much for your help! The answer to all 3 questions was yes. I changed the Arg1-2 to '1' and this corrected my issues. I will create additional atoms for Day ranges for the month.
I have another question, since you seem to be the expert!
I need to put 4 in a field on my DME Tree if the files is generated from my Quality Control environment and a 5 when the file is generated from my Production Environment.
I see that under Technical Fields --> ABAP System Fields there is are fields called Logical Database of Current Program - DBNAM or Central Database System - DBSYS. Is there any way to use these as a condition on an Atom? If so, how?
Thank you!
Mary
Hello Bohdan Petrushchak
Your explanations are very detailed and very useful on how to use DMEE condition types. Thank you very much for that. I have a situation as follows in trying to use condition types and error DMEE_ABA305 pops up. I would appreciate very much, if you can let me know about where I am going wrong in my condition definition.
DMEE tree is as follows
Parent node A – Just a tag printed in the xml file . No mapping
Child Node B – Value is constant EMAL
Child Node B.1 – Structure field – nothing shows in the output
Child Node C – Value is email address procured from Vendor Master via “User exit:” – Created “Reference Id” = EMAIL_ADD” (Source tab = FPAYHX-SMTP_ADDR plus user exit function ZXXX)
Business case:
Condition type definition at Parent Node A level
Arg 1-1 Arg 1-2 Type Oper Arg 2-1 Arg 2-2 Type
EMAIL_ADD 1 3 <> " 1
After Saving the above and trying to execute the "Check" button, system gives the above error message. Basically it is not able to identify the "ref id EMAIl_ADD" for whatever reason
Error in conditions for node RltdRmtInf: reference ID EMAIL_ADD is not permitted
Message no. DMEE_ABA305
Diagnosis
You have specified type 3 in the conditions, meaning that the argument is a reference ID. Your entry in the argument field, however, is not an existing reference ID.
Questions: Is it because we are using a user exit at the lowest level and trying to reference it at a parent level
I will wait for your analysis and reply. Thanks in advance
Regards,
Suraesh Bala
suraesh_bala@discovery.com
Hi All,
The above issue has been resolved. We added a Technical node above PARENT Node A at the same level and it was replica of child node C to get the value. The conditions remained the same at PARENT node A level and it worked.
Regards,
Suraesh Bala
The issue related to invoice data is resolved. Thanks a lot. Very Helpful :):):)
Hi Bohdan,
It is nice document. I have following requirement can you please help how to configure. I think, this can be achieved with concatenate 3 atoms with no space between 1 and 2 atom, with space between 2nd and 3rd atom. ( But how to include space in between atoms)
Can you please help, how to configure this with suitable conditions (One of the EU Paying company codes, paying 'foreign currency' to Vendors from some other EU country?
If you give multiple conditions in Main and sub nodes as well as in Atoms, will it impact the performance of the the system?
Regards,
Sunil
Hi,
I am looking to exclude the Vendor number range I have got the mapping for Vendor number but with condition I can only add one vendor not Range . Any fix for this issue .
Hi Bohdan,
Your article is really nice and informative.
I need your help for use of Condition for Payment Method.
My requirement is "In the charges, I need to enter a condition that says if payment method J has instruction key 02 then it should show BEN otherwise, it should be left empty". Instruction key 02 already created for payment method J.
I am new to DMEE. So, earlier I made "BEN" as a constant value but it will not work because it will always show up.
Would you please guide on that what should I enter in conditions (Arg1-1, Arg1-2, Logical Operator, Arg2-1, Arg2-2, Type of Argument for a condition, Linking Operator)
Thanks in advance.
Hi Tarak Nafade,
I can propose you the technical details for your requirement, but I'll not do that. The purpose of this blog is to explain how this functionality works, so that you can read it carefully, understand how it works and use it in future. Therefore I suggest you to spend a bit more time on reading / analysis and I'm sure you'll experience more pleasure in understanding yourself how it works:-)
Regards,
Bohdan
Доброго дня. Наверняка не по теме, но все же DMEE... может встречали и знаете решение.
имеется дерево, первоначальная структура с уровнями
узлы первого уровня
...
-<DohodyInUrLiz1_v3_l3i xmlns=""> (уровень 2)
-<DohodyInUrLiz1_v3_l3i_t002> (уровень 2)
-<DohodyInUrLiz1_v3_l3i_t002_ri> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric2> </DohodyInUrLiz1_v3_l3i_t002_ric2> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric3> </DohodyInUrLiz1_v3_l3i_t002_ric3> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric4> </DohodyInUrLiz1_v3_l3i_t002_ric4> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric5> </DohodyInUrLiz1_v3_l3i_t002_ric5> (уровень 3)
</DohodyInUrLiz1_v3_l3i_t002>
</DohodyInUrLiz1_v3_l3i_t002_ri>
</DohodyInUrLiz1_v3_l3i>
...
в узел <DohodyInUrLiz1_v3_l3i xmlns=""> добавляем группу -<DohodyInUrLiz1_v3_l3i_t007>, расставляем уровни в соответствии с -<DohodyInUrLiz1_v3_l3i_t002> (уровень 2). в абап-структуру дерева добавились новые поля которые будут выводится.
дерево приобрело такой вид:
-<DohodyInUrLiz1_v3_l3i xmlns=""> (уровень 2)
-<DohodyInUrLiz1_v3_l3i_t002> (уровень 2)
-<DohodyInUrLiz1_v3_l3i_t002_ri> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric2> </DohodyInUrLiz1_v3_l3i_t002_ric2> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric3> </DohodyInUrLiz1_v3_l3i_t002_ric3> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric4> </DohodyInUrLiz1_v3_l3i_t002_ric4> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t002_ric5> </DohodyInUrLiz1_v3_l3i_t002_ric5> (уровень 3)
</DohodyInUrLiz1_v3_l3i_t002>
</DohodyInUrLiz1_v3_l3i_t002_ri>
-<DohodyInUrLiz1_v3_l3i_t007> (уровень 2)
-<DohodyInUrLiz1_v3_l3i_t007_ri> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric1>2 </DohodyInUrLiz1_v3_l3i_t007_ric1> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric2> </DohodyInUrLiz1_v3_l3i_t007_ric2> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric3> </DohodyInUrLiz1_v3_l3i_t007_ric3> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric4> </DohodyInUrLiz1_v3_l3i_t007_ric4> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric5> </DohodyInUrLiz1_v3_l3i_t007_ric5> (уровень 3)
<DohodyInUrLiz1_v3_l3i_t007_ric6> </DohodyInUrLiz1_v3_l3i_t007_ric6> (уровень 3)
</DohodyInUrLiz1_v3_l3i_t007_ri>
</DohodyInUrLiz1_v3_l3i_t007>
</DohodyInUrLiz1_v3_l3i>
но получаю ошибку при активации:
Ошибоч.присвоение уровня в узле DohodyInUrLiz1_v3_l3i_t007_ri: уровень 003 следует за узлом 002
№ сообщения DMEE_ABA307
в чем может быть дело?
Hie Bohdan
I want to set up conditions for the DME tree :
1. if my vendor has a bank control Key 1 the DMEE should pick the Swift code which is a constant but if the bank control key is 2 it should pick a bank account number.
How do I set that up in conditions?
Regards
SK
Hi Bohdan,
we are working on DMEE structure to populate the fields on certain conditions.
Please suggest the condition to be used to
CdtrAgt/FinInstnId/ClrSysMmbId/MbmId
If the vendor is US then only we need to populate the 'MbmId' tag and value.
Thanks,
Ravi
Hi all,
I was wondering if someone here could kindly please help me out.
According to Sweden Regulation, if a vendor has a BIC in the Master Data, this should display in PMW Data (DTA Dateien) which are sent to bank.
If on the other hands, the vendor does not have a BIC, it should display IBAN instead.
Meaning, both BIC and IBAN should not be displayed at the same time.
Please how do I set up this requirement the right way?
I have tried to follow the instruction as stated above, but I still does not get it right.
Your help will be highly appreciated.
Best regards,
Samuel