GXS AI: How to debug maps

I believe every GXS AI map developer knows how hard it might be to debug maps. I’m using SEND_SMSG function when I need to debug a piece of code

First of all, I’m using .bat files to run my maps

otrun -at %MAP_NAME%S.att -cs %OT_QUEUEID% -DLOCALE="English_UnitedStates.Latin1@Binary" -DINPUT_FILE=%BASE_PATH%__in.txt -DOUTPUT_FILE=%BASE_PATH%__out.txt -tl 1023 -lg _log.txt -I

this key “-lg _log.txt” tells the translator to use _log.txt for the translation session output. So, every time I’m using SEND_SMSG it writes it’s 1+ params into _log.txt. For example:

...
SEND_SMSG(1, STRCAT("GID_21_BALQTE_BSD_02_02_2002: ", VAR->GID_21_BALQTE_BSD_02_02_2002_T))
...

And in _log.txt:

Session [003407] Started: at: Sat Jul 25 09:03:04 2012
--GID_21_BALQTE_BSD_02_02_2002: AAA
--GID_21_BALQTE_BSD_02_02_2002: BBB
Session [003407] ended: err: 0 at: Sat Jul 25 09:03:04 2012

…As always, just an idea 🙂

Gennady Kim

Notepad++ and GXS AI models

As you probably know, often GXS AI developer use 3rd party editors when working with the models (instead of Workbench). My colleagues use Notepad++ with a “plugin” (User Defined Language) developed by Igor Nechaev:

notepad plus gxs ai

it highlights used constructions, allows to to collapse/expand blocks of code, helps you to comment/uncomment blocks of code and so on.

Here is the code of this “plugin” (User Defined Language):
Continue reading

Typical X12/EDIFACT/SAP IDoc mapping: Date/Time

Free-Form Text – DTM in X12, DTM in EDIFACT and E1EDK03 (or E1EDP03) in ORDERS05 IDoc

Examples:
X12:

DTM*002*20141210~

EDIFACT:

DTM+2:20141210220000:204'

SAP IDoc:

<E1EDK03 SEGMENT="1">
	<IDDAT>002</IDDAT>
	<DATUM>20141210</DATUM>
	<UZEIT>220000</UZEIT>
</E1EDK03>
Entity X12 (4010) EDIFACT (D96A) SAP IDoc (ORDERS05)
Date/Time DTM segment DTM segment E1EDK03 record
  Type DTM-01 (374), Date/Time qualifier DTM-01C01 (2005), Date/time/period qualifier E1EDK03 / IDDAT, Qualifier for IDOC date segment
  Date DTM-02 (373), Date DTM-01C02 (2380), Date/time/period. Both date and time might be included into this sub-element. The format depends on DTM-01C03 (2379) E1EDK03 / DATUM, Date
  Time DTM-03 (337), Time DTM-01C02 (2380), Date/time/period. Both date and time might be included into this sub-element. The format depends on DTM-01C03 (2379) E1EDK03 / UZEIT, Time

Gennady Kim

Typical X12/EDIFACT/SAP IDoc mapping: Free-Form Text

Free-Form Text – N9+MSG in X12, FTX in EDIFACT and E1EDKT1+E1EDKT2 (or E1EDPT1+E1EDPT2) in ORDERS05 IDoc

Examples:
X12:

N9*ZZ*Header Text~
MSG*TEXT LINE1~
MSG*TEXT LINE2~
MSG*TEXT LINE3~
MSG*TEXT LINE4~

EDIFACT:

FTX+ZZZ+++TEXT LINE1:TEXT LINE2:TEXT LINE3:TEXT LINE4:TEXT LINE5'

SAP IDoc:

<E1EDKT1 SEGMENT="1">
	<TDID>001</TDID>
	<E1EDKT2 SEGMENT="1">
		<TDLINE>TEXT LINE1</TDLINE>
	</E1EDKT2>
	<E1EDKT2 SEGMENT="1">
		<TDLINE>TEXT LINE2</TDLINE>
	</E1EDKT2>
	<E1EDKT2 SEGMENT="1">
		<TDLINE>TEXT LINE3</TDLINE>
	</E1EDKT2>
	<E1EDKT2 SEGMENT="1">
		<TDLINE>TEXT LINE4</TDLINE>
	</E1EDKT2>
	<E1EDKT2 SEGMENT="1">
		<TDLINE>TEXT LINE5</TDLINE>
	</E1EDKT2>
</E1EDKT1>
Entity X12 (4010) EDIFACT (D96A) SAP IDoc (ORDERS05)
Free-Form Text N9 group FTX segment E1EDKT1+E1EDKT2 records
  Type N9-01 (128), Reference Ident Qual FTX-01 (4451), Text subj qualifier E1EDKT1 / TDID, Text ID
  Text MSG-01 (933), Free-form Message Text FTX-04C01, 04C02, 04C03, 04C04 and 04C01 (C108 / 4440), Free Text E1EDKT2 / TDLINE, Text line

Gennady Kim

Typical X12/EDIFACT/SAP IDoc mapping: Reference Information

Reference Information – REF in X12, RFF (+DTM) in EDIFACT and E1EDK02 in ORDERS05 IDoc

Entity X12 (4010) EDIFACT (D96A) SAP IDoc (ORDERS05)
Reference Information REF segment RFF group E1EDK02 record
  Type REF-01 (128), Reference Ident Qual RFF-01C01 (C506 / 1153), Reference qualifier E1EDK02 / QUALF, IDOC qualifier reference document
  Reference value REF-02 (127), Reference Ident RFF-01C02 (C506 / 1154), Reference number E1EDK02 / BELNR, IDOC document number
  Item Number RFF-01C03 (C506 / 1156), Line number E1EDK02 / POSNR, Item number
  Reference Date DTM segment in RFF group E1EDK02 / DATUM, IDOC: Date
E1EDK02 / UZEIT, IDOC: Time

Gennady Kim

Typical X12/EDIFACT/SAP IDoc mapping: Partners

I’m going to share information about some typical relationships between X12, EDIFACT and SAP IDoc. As always, it’s just to give you an idea. Let start with Partners – N1 group in X12, NAD in EDIFACT and E1EDKA1 in ORDERS05 IDoc

Entity X12 (4010) EDIFACT (D96A) SAP IDoc (ORDERS05)
Trading Partner N1 group NAD group E1EDKA1 record
  Type N1-01 (98), Entity ID Code
——
BY = Buyer, SE = Seller, ST = ShipTo, SF = ShipFrom, etc
NAD-01 (3035), Party qualifier
——
BY = Buyer, SE = Seller, ST = ShipTo, SF = ShipFrom, etc
E1EDKA1 / PARVW, Partner function
——
AG = Buyer, LF = Seller, WE = ShipTo, etc
  Name N1-02 (93), Name NAD-04C01 (C080 / 3036), Party Name E1EDKA1 / NAME1
  Additional Name N2-01 (93), Name
N2-02 (93), Name
NAD-04C02, 04C03, 04C04 and 04C05 (C080 / 3036), Party Name E1EDKA1 / NAME2
E1EDKA1 / NAME3
E1EDKA1 / NAME4
  Partner ID Type N1-03 (66), ID Code Qualifier
——
1 = DUNS, 91 = Assigned by Seller, 92 = Assigned by Buyer, etc
NAD-02C03 (C082 / 3055), Code list resp agency
——
16 = DUNS, 91 = Assigned by Seller, 92 = Assigned by Buyer, etc
  Partner ID N1-04 (67), ID Code NAD-02C01 (C082 / 3039), Party id. ID E1EDKA1 / PARTN, Partner number
-or-
E1EDKA1 / LIFNR, Vendor number at customer location
  Address Line N3-01 (166), Address Information
N3-02 (166), Address Information
NAD-05C01, 05C02, 05C03 and 05C04 (C059 / 3042), Street and num/po box E1EDKA1 / STRAS, Street and house number 1
E1EDKA1 / STRS2, Street and house number 2
  City N4-01 (19), City Name NAD-06 (3164), City name E1EDKA1 / ORT01, City
  State/Province N4-02 (156), State or Province Code NAD-07 (3229), Country sub entity ID E1EDKA1 / REGIO, Region
  Postal Code N4-03 (116), Postal Code NAD-08 (3251), Postcode ID E1EDKA1 / PSTLZ, Postal code
E1EDKA1 / PSTL2 (P.O. Box postal code)
  Country N4-04 (26), Country Code NAD-09 (3207), Country, coded E1EDKA1 / LAND1, Country Key
  Contact PER segment CTA segment
    Contact Type PER-01 (366), Contact Funct Code
——
IC = Information contact, etc
CTA-01 (3139), Cont funct coded
——
PD = Buyer Name or Department (Purchasing contact), etc
    Contact Name PER-02 (93), Name CTA-02C02 (C056 / 3412), Department or employee E1EDKA1 / BNAME
    Phone PER-04, 06 or 08 (364), Comm Number
where appropriate PER-03, 05 or 07 (365), Comm Number Qualifier = TE (Telephone)
COM-01C01 (C076 / 3148), Comm number
where appropriate COM-01C02 (C076 / 3155), Comm chan qualifier = TE (Telephone)
E1EDKA1 / TELF1, 1st telephone number of contact person
E1EDKA1 / TELF2, 2nd telephone number of contact person
    Fax PER-04, 06 or 08 (364), Comm Number
where appropriate PER-03, 05 or 07 (365), Comm Number Qualifier = FX (Fax)
COM-01C01 (C076 / 3148), Comm number
where appropriate COM-01C02 (C076 / 3155), Comm chan qualifier = FX (Fax)
E1EDKA1 / TELFX, Fax number
    Email PER-04, 06 or 08 (364), Comm Number
where appropriate PER-03, 05 or 07 (365), Comm Number Qualifier = EM (Email)
COM-01C01 (C076 / 3148), Comm number
where appropriate COM-01C02 (C076 / 3155), Comm chan qualifier = EM (Email)

Gennady Kim