Tuesday, April 28, 2020

#764 OIC - B2B Document Management

OIC B2B support also includes Document and Schema Management- 

Note the new menu option - B2B -

The B2B schema editor allows one to customize EDI data formats. Ok, EDI is a standard but each
EDI enabled trading partner has unique requirements e.g. codes specific to a trading partner, or maybe field lengths that do not map well into the EDI specification.
Net net, trading partners often vary the format of a transaction set to meet their specific requirements so OIC B2B needs to support this.

Click B2B Documents -

Click Create -

That's my doc created, now to the schema it will use.

Now I can create a schema that will include my changes.

Click B2B Schemas -

Click Create -

Now I can edit the schema -

Here I can delete sections e.g. BEG or individual fields -

I can also edit individual fields by clicking on the view symbol -

So what do we have here?

My company, Hare of the Dog Inc., has the rule - Purchase order number is 8 chars.

That was easy - now what else can I do here?

Code List - doesn't make much sense for a PO Nr, but you get the idea -

Let's do this for another field CUR02 - currency -

One can also import lists from a csv -

Changes are highlighted in the list -

Now I apply this schema to my doc - My850PO -

Now to my integration - I can now select my document definition -

Monday, April 27, 2020

#763 OIC - B2B - EDI Translation support

Another compelling new feature for OIC - EDI X12 support.

For those who never heard of X12 - think of it as a set of standard docs allowing companys to do business with each other, e.g. Company A sends an X12 850(Purchase Order) to Company B.

You can see the full list of X12 docs here

So nothing like a simple example to illustrate our X12 support -
Let's begin with an Inbound X12 example -

In this case, I receive a PO in EDI 850 format. I need to process this and post it to Netsuite, for example.

Processing X12 PO in OIC

Here is my X12 850 input -

So what does the above mean?

ISA - Interchange Control Header
GS - Functional Group Header
ST - Transaction Set Header
BEG - Beginning Segment for Purchase Order
CUR - Currency
REF - Reference Information
FOB - The acronym FOB, which stands for "Free On Board" or "Freight On Board," is a shipping term used in retail to indicate who is responsible for paying transportation charges. It is the location where ownership of the merchandise transfers from seller to buyer.
The value PC stands for - pre-paid but charged to customer.
ITD - Terms of Sale
DTM - Date/Time Reference
TD5 - Carrier Details
N1 - Party Identification - BT represents the Buying Party
N2 - Additional Name information
N3 -Party Location 
N4 - Party geographic location
PER - Administrative Communications Contact
PO1 - Item data 
PID - Item Description
CTT - Transaction Totals

and so on...

So what do I mean by EDI Translation? Essentially translating the incoming EDI doc into a format OIC can process. As you know, OIC using XML under the hood, all mappings are XSLT. So the newly available EDI Translate action creates an XML representation of the EDI 850 doc.

So here in the simple example integration -

The Trigger - Receive-EDI - is a REST Trigger.
Configuration as follows -

EDI-Translate is configured as follows -

Document Version is set to 4010 - this refers to EDI Version 4 Release 1

Naturally, other versions are supported -

Document Definition defaults to Standard

EDI Character Encoding - here I select UTF8.
Other options include -

Now to the final Mapping - Map to Receive-EDI -

Check out the XML representation of the EDI doc -

Great stuff!
All I need to do now is map this to my Netsuite PO, but I'll spare you the steps these;
after all, we are focusing on EDI here.

Now to Outbound - here I have a PO that I need to put into EDI 850 format.

Creating an X12 PO in OIC

Stating point is my order.xsd -

created in that tool of tools - JDeveloper.

I then create an XML doc, based on the xsd -

Now to the OIC Integration - use case is I read in the above xml order and then create an EDI order, based on it.

So I use a REST trigger with XML based payload.
The Response is also XML based -

Now I add the new EDI-Translate action -

and configure as follows -

Now to the Mapping -

The first fields I set are in the interchange-ctrl section -

Here I specify sender / receiver e.g. customer / supplier.

e.g. sender-id is set to Hare of the Dog Inc.
receiver-id is set to Commiskey Inc.

Nw to the next section - group -

e.g. app-senders-code is set to Hare of the Dog Inc.
app-receivers-code is set to Commiskey Inc.

That's the Headers taken care of, now to the Transaction data -

BEG01 - Transaction Set Purpose Code set to 00

00 = original PO, 01 = cancellation
Here is a list of valid codes

BEG02 - Purchase Order Type Code set to NE
NE= New Order
Here is a list of valid codes

BEG03 - Purchase Order Nr is set to the source PO Nr.

The above 3 fields are mandatory.

I set BEG05 to today's date in the format CCYYMMDD - 20200403.

Now to the mapping of the line items to Baseline Item Data -

Now to CTT-Transaction Totals

CTT01 - set to count(lineItems)
CTT02 Hash Total set to totalAmount

Now to mapping the integration response -


Now all I need to do is Activate and Test.

I test with the order xml shown earlier -

My response in Postman is as follows -

I love errors, the only way to learn, in this case EDI.

ISA05 max 2 characters.
I google and see that ZZ - Mutually defined is a valid value.

I correct and re-test

Alles Gut!

Finally, a more realistic Use Case... thanks to my colleague Michael M.

B2B Use Case

Company A sends a PO (X12 850) to its supplier, Company B.

Company B responds with a Functional Acknowledgement (X12 997).
The functional ack confirms delivery of the PO and can report any errors etc.

Company B does the business and then sends an Invoice to Company A.
This leverages the X12 810 format.

Company B sends an Advance Ship Notice (X12 856) to Company A.
This describes shipment and packing.

The above can be easily implemented now in OIC.

Documentation is available here