Is there a really simple way to process EDIFACT for example D96A?
Asked Answered
W

4

8

We are a modern company using modern technology like XML interfaces, but many of our customers want for example electronic invoices from us in an EDIFACT format like D96A.

No we cannot use already existing libraries, as they are not written in the C/AL programming language our Navision software uses.

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

So can someone give me an overview how to interpret say D96A and how to parse it?

Woorali answered 2/7, 2012 at 14:20 Comment(1)
No! There is NO simple way! LOL...Dichlamydeous
D
0

I know that this question is older, but I had to do a little research for a customer's project. There are several good add-ons for Dynamics NAV. Have for example a look at Anveo EDI Connect they implemented the import and export of EDIFACT (and many more formats) directly in 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 on a simple XML or file based structure.

Derma answered 8/6, 2014 at 12:45 Comment(0)
I
16

Parsing EDIFACT is actually not that complicated. Just split at the sytax chars: first at ' to get the segments, than at + to get data elements of that segments and at : to get the individual components. You need to take care of escaped seperator chars, of course. The chars used here are only the default, they can be changed at the beginning of the message by the optional UNA-segment. Actually the wikipedia article on EDIFACT gives a pretty good (but brief) introduction to that. And the format is documented with detail on the UN's UNECE site (yes, that's a lot and hard to read).

The tricky part is to get the information out of that and into your application (and verifying it's valid, leave alone creating good error messages). If you really plan to write a comlete parser out of nothing for all that in any language, then: No, there is no easy way to do this. Nor is there for any other flexible data representation. That is a difficult task and always will be.

But here's an idea: if you are into XML that much (or any other "modern technology" as you like to call it...). It would be a relatively easy task to write some program that converts EDIFACT messages into some unified XML-EDIFACT-Format (which is a pretty horrible thing and would most likely freak me out). You can convert every EDIFACT segment into one XML tag, maybe 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>

Then you can unleash the power of your XML tools and libraries on it to validate/evaluate it.

You could also do it more specific, like this:

<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 could make validation via XSD easier. You can get of course as specific as you want with this conversation, but you would sooner or later come to a point, where you would need to put information on the structure of your currently parsed message into the converter (since it is not trivial to know which segments are nested into other segments grouping them. There's not just UNG, UNH and such, but also some segment groups that you don't see directly).

Still, you will have to create specific evaluation programs/schemas/whatevers for the messages you receive, according to the EDIFACT-handbooks you should get as documentation.

Interrogate answered 24/10, 2012 at 13:22 Comment(0)
C
2

I suggest searching and perusing through GitHub or SourceForge repos. A quick search with keywords: +EDIFACT +D96A provided several libraries to choose from. In fact this looks promising for your case:

You could always evaluate and check out 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 UN/EDIFACT OTD library which I guess you could use at least for parsing.

Generally your best bet is to pick up existing library and either port it to NAV or use through external interface where data flows into your NAV database. If you're able to call .NET code then a plethora of existing libraries should exist and simply by referencing assembly gets you there. As it I'm not familiar with NAV development but using some sort of REST/JSON whatever your data transfer object calling mechanism is should be possible - where your component B does the heavy job and your NAV component pulls parsed UN/EDIFACT messages through your XML interface.

There was another similar question and couple answers as well that could suit you as well: Is there any good open source EDIFACT parser in Java?.

Cheers!

Christoperchristoph answered 31/7, 2012 at 4:32 Comment(1)
We dived into BOTS EDI, and it is a paaaaaaaaaaainnnnn. Not BOTS itself, but the fact you still have to manually decipher an EDI and create a Mapping file for BOTS to use as a Translator... ARrrggghhhh... WHY IS THE WORLD STILL USING EDI!!!??Dichlamydeous
D
0

I know that this question is older, but I had to do a little research for a customer's project. There are several good add-ons for Dynamics NAV. Have for example a look at Anveo EDI Connect they implemented the import and export of EDIFACT (and many more formats) directly in 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 on a simple XML or file based structure.

Derma answered 8/6, 2014 at 12:45 Comment(0)
B
0

I have been using Talend Open Studio(TOS) occasionally which is a feature rich ETL tool that allows you to build data conversion jobs visually. Then when everything works as desired you can export the job as a .bat or .sh file. The cool thing is that this tool supports EDIFACT out of the box. So you can build a batchfile that takes an EDI filename as an argument and generates whatever output you have defined.

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

Billingsgate answered 26/6, 2019 at 11:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.