Is there a really easy way to handle EDIFACT, like D96A?

We are a modern company using modern technologies, such as XML interfaces, but many of our customers want, for example, electronic bills from us in EDIFACT format, such as D96A.

No, we cannot use existing libraries because they are not written in the C / AL programming language used by our Navision software.

So, in order to parse it in C / AL, I need to understand its specification. But it looks extremely complicated and complicated.

So can someone give me an overview of how to interpret the D96A and how to disassemble it?

+7
source share
4 answers

I know this question is older, but I had to research the client project a bit. There are some good add-ons for Dynamics NAV. For example, look at Anveo EDI Connect , they implemented the import and export of EDIFACT (and many other formats) directly into NAV. Other solutions are available from BMI, Yaveon, Lanham, and several other companies. There are also several service providers that process the data, and you agree with them in a simple XML or file structure.

0
source

EDIFACT parsing is actually not that complicated. Just divide by sytax characters: first in ' to get segments, than in + to get data elements of these segments and : to get individual components. Of course, you need to take care of the evacuated separator characters. The characters used here are only by default, they can be changed at the beginning of the message by an additional UNA segment. In fact, the Wikipedia article on EDIFACT provides a pretty good (but brief) introduction to this. And the format is documented with detailed information on the UN UNECE website (yes, it's a lot and hard to read).

The hard part is to get the information from this and into your application (and check its accuracy, leave it alone, creating good error messages). If you really plan to write a parser compiler from nothing for everything in any language, then: No, there is no easy way to do this. There are also no other flexible data representations. This is a difficult task and will always be.

But here is the idea: if you have so much in XML (or any other "modern technology" as you call it ...). It would be a relatively simple task to write some program that converts EDIFACT messages into some single XML-EDIFACT-Format (which is pretty awful and will most likely go crazy). You can convert each EDIFACT segment into a single XML tag, possibly like this:

 ERC+A7V:1:AMD' IFT+3+NO MORE FLIGHTS' 

In XML:

 <segment qualifier="ERC"> <element> <component>A7V</component> <component>1</component> <component>AMD<component> </element> </segment> <segment qualifier="IFT"> <element> <component>3</component> </element> <element> <component>NO MORE FLIGHTS</component> </element> </segment> 

You can then deploy the power of your XML tools and libraries for validation / evaluation.

You can also do this more specifically, for example:

 <segment_ERC> <element> <component>A7V</component> <component>1</component> <component>AMD<component> </element> </segment_ERC> <segment_IFT> <element> <component>3</component> </element> <element> <component>NO MORE FLIGHTS</component> </element> </segment_IFT> 

This will simplify verification via XSD. In this conversation you can get, of course, what you need, but sooner or later you will get to the point where you will need to put information about the structure of your currently parsed message in the converter (since you don’t know which segments are nested to other segments grouping them, not just UNG , UNH and such, but also some segment groups that you don’t see directly).

However, you will need to create special evaluation programs / schemes / whatevers for the messages you receive in accordance with the EDIFACT directories, which you should receive as documentation.

+10
source

I suggest searching and browsing through the GitHub or SourceForge repositories. Quick search with keywords: + EDIFACT + D96A provided several libraries to choose from. Actually, this looks promising for your case:

You can always evaluate and test Oracle B2B 11g, which is part of Oracle SOA Suite 11gR1: - http://www.oracle.com/technetwork/middleware/soasuite/downloads/downloads-085394.html#11g . It has an OTD UN / EDIFACT ODD library that I think you can use, at least for parsing.

As a rule, it is best to pick up an existing library and either transfer it to NAV, or use the external interface, where the data goes into your NAV database. If you can call the .NET code, then there are many existing libraries, and simply by referencing the assembly you will get there. Since I am not familiar with the development of NAV, but using some kind of REST / JSON, no matter what data call processing mechanism is, where your component B does the hard work and your NAV component pulls the parsed UN / EDIFACT messages through your XML -interface.

There was another similar question and couple answers that might suit you: Is there a good open source EDIFACT parser in Java? .

Hurrah!

+2
source

Sometimes I use Talend Open Studio (TOS), which is a multi-functional ETL tool that allows you to visually create data conversion jobs. Then, when everything works as it should, you can export the work as a .bat or .sh file. The cool thing is that this tool supports EDIFACT out of the box. Thus, you can create a batch file that takes the name of the EDI file as an argument and generates any output that you define.

https://help.talend.com/reader/hCrOzogIwKfuR3mPf~LydA/1qBCcoArBu0cDLAgdrMyMA

0
source

Source: https://habr.com/ru/post/919505/


All Articles