Last Revision: 26th July 2019
Now that we have explored all types of nodes, lets use real examples to understand the possibilities we have to build new formats with this app.
Going back to the example of the payment method, the requirement is a node that can have values CHK or TRF depending on whether we are using Check or Transfer. Let’s look at this step by step.
Step 1 – Create node of type element with the following attributes:
Name: PmtMtd(in xml the name is a shown in the media file as the tag of the xml. The opposite happens in flat files, only the content of the element will appear)
Status can be left as standard, meaning that the node is always output to the target file. If the node does not have a value, because no mapping rule was assigned, for example, then the node appears empty in the file.
Length should be 3 considering the possible output will be CHK or TRF.
Type should be Character.
The Source of this element will be Own Mapping. And every time you use atoms, this will be the source. It also means that no actual source is defined for this node but it will be derived from the atoms.
To handle the atoms, we can take over the values into the element or concatenate the values of the atoms in the element.
In our example, we will take over the value with a fixed offset.
Step 2 – Create Atom CHK
This atom will have as a source for the Mapping Procedure a constant value of CHK and we will assign a condition.
We have mentioned before DDIC structures. In this example, we will use the FPAYHX structure that stores information on the payment run. In this case, we will use the field FPAYHX – XSCHK which is an indicator that tells us if a check is created in this payment Method.
Step 3 – Create Atom TRF
The logic will be the same, but the condition differs. If the FPAYHX – XSCHK is empty, then output of the atom will have the value TRF.
Requirement: one node that has a unique identifier that can identify this specific payment.
This can be a common requirement with many solutions. So what can easily identify a document? We chose the concatenation of posting date and the reference.
So we need to create 3 nodes. A top node and below 2 atoms to store the Posting Date and the Reference Document.
1) Step 1 – create top node
Create a node and give it a name. The most important point here is the source information. The Mapping Procedure must be Own mapping and the atom handling Concatenate values in element.
This top node will output the concatenation of the below atoms.
1) Step 2 – create atom for posting date
Create an atom as a subnode to the previously created element.
p Give it a name and in the Conversion Function select the format of the date. In this case, the date will be displayed in the format MMDDYYY.
There are several options of format in the conversion function. And not only for date. Currency and Character Sting are also available.
In the source, we are going to use again our structures. In the Mapping Procedure, select Structure Field and in the structure field search for the Posting date.
In this screen, you can easily see all the fields available for use.
No conditions are required.
Step 3 – create an atom below the first element
Create a second atom below the first element and give it a name.
This atom should have as Mapping Procedure a structure field and search for the field FPAYP-XBLNR – Reference Document Number.
In one payment file, it is possible to have payments related to multiple invoices. The requirement is to have 1 node with the sum amount of all invoices being payed.
So we need one node for the line items with that amount, and a second node that will read the amount in these nodes and summarize them. In this example, we will use a reference to a node and also an aggregation.
Step 1 – create node for the net amount to be payed
Create a node of type element and give it a name.
In the Attributes tab, in the reference ID put an identification of this node.
The mapping procedure will be a field from the structure FPAYH – Amount payed in transaction currency.
Step 2 – create a second node
Create a second node of type element and give it a name. Use the conversion function to select the appropriate output of the amount – some banks may have specific formats for this information.
The mapping procedure here will be Aggregation.
We will aggregate the amount in the node we created in the previous step.
The examples above cover the most common techniques used for the creation of new payment formats to cover bank requirements.
Other Blogs in the series