New EDI data

One day you might be asked to add some additional data to the existing EDI message. There are several rules I’d recommend:

  • Some BAs think that every new data they add should have ZZ(Z) qualifier (Mutually Defined). The best practice here is to try to find appropriate value first. So, you should have the standard specifications.
  • Don’t use the first value you’ve found – try to check the whole list and find the best value that matches your data. Example: my colleagues were asked to add SSCC-18 number to their ASN (X12). If you’ve worked a lot with ASNs you know that usually companies use SSCC-18 with the Application Identifier (i.e. “00” + SSCC-18). And in ASNs (X12) it’s MAN segment with “GM” (SSCC-18 and Application Identifier) qualifier. But the “AA” (SSCC-18) goes first in the list of qualifiers – so, they decided to use “AA” in spite of the actual value was SSCC-18 + AI (i.e. they should’ve used “GM”).
  • Don’t use a qualifier which looks like one you’re looking for – check its description. REF-01 “SN” looks like it might stand for “Store Number” but actually it’s “Seal Number”.
  • Check the data type/length if it matches your values.
  • Try to avoid “structures in structures”. I.e. try not to use any prefixes, separators and so on inside your EDI data. Example: on one project I had to parse REF*ZZ*NAME1//NAME2//NAME3~ structure – BAs didn’t know how to send several values and decided to use pseudo sub-elements in REF-02. On the other hand sometimes you have no choice.
  • Don’t put dates into REF segments (I saw it several times)

Gennady Kim

Advertisements

Alternative way of working with Sybase ECMap

Some times ago I was working on a huge project for the Healthcare industry. HIPPA, 837s P/I/D and so on – hundreds of segments/elements, thousands of mapping rules. We used Sybase ECMap tool for the translation purposes. Some maps contained 6,000+ of ECMap rules – often it might take hours to implement/change/fix just one mapping rule.

One day 🙂 we had to switch from X12 4010 to 5010. One of the necessary changes was to increase the fields length (for example, REF-02 had to be changed from AN30 to AN50). It was a lot of manual work and I decided to try to find a workaround for tasks like this. I found that ECMap stores maps as MS Access database files, so I could use an alternative way of changing the maps – through MS Access interface with using of SQL queries. It took several hours to update the maps instead of days. And I was sure about my changes because I could check all of them in seconds.

The main file is the appfiles.mdb. There are several tables:

  • Filehdr – Application Files
  • FILEREC – links between Application Files and Application Records
  • Mapfile – links between Application Directories and Application Files
  • Mapmem – Memory Variables
  • MAPSYS – System Variables
  • RECFLD – Fields
  • RECHDRS – Application Records

As you can guess, to check/change the fields length you need to use RECFLD table.

I used this alternative way a lot for different purposes.

Gennady Kim

SAP IDoc qualifiers (Details)

Here are some qualifiers for the details data.

E1EDL20 (INCO1)

EXW	EX WORKS
FCA	FREE CARRIER 
FAS	FREE ALONG SHIP 
FOB	FREE ON BOARD 
CFR	COST AND FREIGHT 
CIF	COST, INSURANCE AND FREIGHT 
CPT	CARRIAGE PAID TO 
CIP	CARRIAGE AND INSURANCE PAID TO 
DAF	DELIVERED AT FRONTIER 
DES	DELIVERED EX SHIP 
DEQ	DELIVERED EX QUAY 
DDU	DELIVERED DUTY UNPAID 
DDP	DELIVERED DUTY PAID

Continue reading

GXS AI: Tutorial, lesson 1

Some time ago I taught a group of map developers how to work with different translators,
including Gentran Server for Windows/GIS/Sterling Integrator (SI) and GXS Application Integrator (AI) 4.*/5.*.
I prepared some materials which I’m going to share. They have a form of a step-by-step
instructions or tutorials. So, here is the first “lesson” – how to create a simple
map with GXS AI (appropriate software is supposed to be already installed).

Mention should be made that I (as almost all of my collegues) don’t use WorkBench for creating the maps – I use my text editor instead. But I used WorkBench to teach my guys because it was easier to explain them the structures. Later I showed them how to switch to using a text editor instead – we will discuss it in one of the lessons.

First simple map

As the first step we’ll try to create a simple translation map between two positional
documents. During this step we’ll learn the following terms/elements of GXS AI:

  • access models
  • data models
  • data types
  • records
  • fields

Also, we’ll learn how to describe the source and target structures, create simple
links and write a simple code.

Continue reading

A good format for bridges/crosswalks/designs/MRGs/…

If you work in the map development field (as a developer or a business analyst), you know that a good bridge document (crosswalk, design, MRG and so on – document which describes how to translate source structure into target) is very important. There are several ways to create a bridge document and I use several rules to create a good one.

First of all, design document should be based on the target structure, not the source. I.e. if you need to describe SAP IDoc to EDIFACT translation, you should start with the EDIFACT structure, not the IDoc.

“Incorrect”:

DELVRY03
   IDOC
      E1EDL20
         VBELN -> BGM-02

“Correct”:

BGM-02 <- DELVRY03/IDOC/E1EDL20/VBELN

Next, your bridge should contain the following information about elements, records and groups/loops:

  • Optional/Mandatory/Conditional
  • Entity’s name. PID-05 is not as clear as “Product/Item Description”
  • Elements: data type, data length, format
  • Records and groups/loops: Repeatable/Non-repeatable
  • Records and groups/loops: Relation to the parent entity (if exists)

Then, the mapping rules of course. There are two main type of the mapping rules – hardcoded values and values which come from the source data.

Hardcoded values
Hardcoded values are self-explaining. However, you should try to avoid rules like “Hardcode ‘BM'” – it’s really not clear why a map developer should hardcode ‘BM’, especially if she/he doesn’t know the format well. A better way is to give more details: “Hardcode ‘BM’ (BM = Bill of Lading)”

Values from the source data
I prefer to use the full path to avoid possible misunderstanding (some business analysts don’t know that there might be the REF segments at the different levels in X12 for example) – i.e. DELVRY03/IDOC/E1EDL20/VBELN or ST/LIN/REF/REF-02 instead of E1EDL20/VBELN or REF/REF-02. Also, I found it useful to use XPath-style paths like:

ST/LIN/REF[REF-01 = ‘BM’]/REF-02

If there are more complex condition, you should describe them in the “Comments” column.
If there are some conversion rules, for example Unit -> C62, I use a comment ” + Conversion:” and describe every conversion pair (and description of every value, see above).

Last, there should be “Comments” section for every structure entity.

Usually I use MS Excel for creating such bridges. There should be the main sheet + change log sheet. During the testing my maps I mark “implemented” rules with yellow background, “implemented and tested” with green and “questions/doubts” with pink.

In addition to the bridge I really like to have: input/output data examples and the original specifications for the output and input.

Example:
bridge

Gennady Kim

EDI (X12/EDIFACT) notation format for segments/elements

I prefer to use the following style/notation for EDI segments/elements:

{SEGMENT NAME}-{ELEMENT POSITION}<‘C'{ELEMENT SUB POSITION}>

For example:
REF-01 (X12, Segment name: REF, element position: 1)
RFF-01C02 (EDIFACT, Segment name: RFF, element position: 1, sub-position: 2).

This approach gives me ability to check EDI data easily. I don’t like EDIFACT-style notations like RFF C506 1154 because it requires to use the standard along with the specification/bridge/design.

Gennady Kim

EDIFACT specification

There are some links to the EDIFACT specifications by versions:

… and so on. Or even easier to use a link to the parent directory: http://www.unece.org/trade/untdid/

UPDATE (01 Jun 2015): they’ve changed the structure recently, so now you should use this link (there will be a menu on the left) http://www.unece.org/tradewelcome/un-centre-for-trade-facilitation-and-e-business-uncefact/outputs/standards/unedifact/directories/1995-1999.html

Gennady Kim