A
A
Andrey2018-03-02 17:26:29
Programming
Andrey, 2018-03-02 17:26:29

EDI EDIFACT. Who can advise in Specifications (at least theory)?

Brief essence of the task. The PHP language used, but it is not necessary to become attached to the language, I just want to capture the essence of the mechanism.
There are 10 companies that will send EDI files. They have different standards (however they provided specifications). Industry: freight forwarding. We didn’t have EDI and I haven’t worked with EDI before, so I ask for at least some tips. Thanks in advance.
I want to register classes with an abstract factory so that I can send them a file, and it chewed it and parsed everything correctly. And here is a small list of questions =)
Regarding the EDI file itself.
1) UNH (this is like the beginning of an envelope, as far as I understand). And so some companies throw off everything in one UNH (info about each cargo), while others throw off each cargo in a separate UNH - UNT.
2) There is a "Position" field in the specification, but I still don't fully understand how best to work with it. The fact that it is responsible for the order of the fields - I understood, but many fields are skipped (Conditional) ...
3) How to find out exactly which group-segments this line (data segment) belongs to. Also interested in nested groups of segments.
Regarding the code
Since not all companies use EDIFACT, there is still a standard (I did not find a normal name) which has a structure in the style:
18AAAA1234567 7229932 2H000386CTNS
0000000752200006.86 , then it was written on the knee ...
The idea was in the style:
There is a class, inside it there is an array "specification", in which arrays by codes

$this->specification['18'] = array();
$this->specification['18'][] = array('column_range_start' => 2, 'column_range_end' => 16);
$this->specification['18'][] = array('column_range_start' => 17, 'column_range_end' => 31);

and so on for each specification code. Then they went through each line, took the first 2 characters (code) and got where to get info from.
When asked to add for EDIFACT, all with the same burning deadlines and all on the same knee.
$this->specification['RFF'] = array('callback'=>'parseMblHblUML');

Well, when iterating line by line, we simply called this method and got all the necessary values ​​​​through regular expressions.
I do not need a 100% universal solution for all occasions. I would just like to hear the opinions and advice of professionals who can tell you how best to work with these EDI files. For I did not find normal literature. Is it somehow clear to me what EDI is and what it is eaten with
"A GXS TUTORIAL
EDIFACT Standards Overview Tutorial."
Thank you for reading to the end =)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question