IBM Sterling map editor: is there a way to sort OID in 204 EDI I need some help/ideas on how to do this
This is the input file
ISA*...
GS*...
...
S5*2*CU*34140*L~
G62*68*20220531~
AT8*G*L*34140*4437~
PLD*27~
N1*ST*COSTCO STORE AAAA*93*0000000761~
N3*1013 HOMER STREET ~
N4*CITY*CA*90210~
OID*SO1241*135020070**PC*1*L*0~
L5**Certificate Of Sale~
AT8*G*L*0*1~
OID*SO1241*135020070**PC*24*L*0~
L5**AIRBAG~
AT8*G*L*0*24~
OID*SO1157*135020014**PC*1*L*0~
L5**Certificate Of Sale~
AT8*G*L*0*1~
OID*SO1241*135020070**PC*1080*L*30720~
L5**APPLES 2 lb~
AT8*G*L*30720*3840~
OID*SO1157*135020014**PC*1070*L*3420~
L5**ORANGES 12 oz~
AT8*G*L*3420*570~
OID*SO1241*135020070**PC*1*L*0~
L5**GPS TRACKER~
AT8*G*L*0*1~
L3*...
SE*...
GE*...
IEA*...
And this is the output file I want to get, EDI to POSITIONAL
HDR1: PO 135020070
ITEM: Certificate Of Sale,QTY 1
ITEM: AIRBAG,QTY 24
ITEM: APPLES 2 lb,QTY 1080
ITEM: GPS TRACKER,QTY 1
HDR1: PO 135020014
ITEM: Certificate Of Sale,QTY 1
ITEM: ORANGES 12 oz,QTY 1070
Currently this is what my MAP is doing
HDR1: PO 135020070
ITEM: Certificate Of Sale,QTY 1
ITEM: AIRBAG,QTY 24
HDR1: PO 135020014
ITEM: Certificate Of Sale,QTY 1
HDR1: PO 135020070
ITEM: APPLES 2 lb,QTY 1080
HDR1: PO 135020014
ITEM: ORANGES 12 oz,QTY 1070
HDR1: PO 135020070
ITEM: GPS TRACKER,QTY 1
This is my current code (extended rule on OID), that produce the map above
if sPONum = "" | (sPONum != "" & sPONum != #0324) then
begin
//CREATE PO HEADER
sPONum = #0324;
iCU = iCU + 1;
$POGroup[iCU].#TEMP_DUNS = sDUNS;
$POGroup[iCU].#PONumber = #0324;
//CREATE ITEM LINE
//RESET ITEM LINE FOR EACH PO
iItem = 0;
iItem = iItem + 1;
iOID = iOID + 1;
$TEMP_ITEM[iCU][iItem].#TEMP_Qty = #0380:4;
$TEMP_ITEM[iCU][iItem].#TEMP_Description = $0320_L5[iS5][iOID][1].#0079:2;
end
else
begin
iItem = iItem + 1;
iOID = iOID + 1;
$TEMP_ITEM[iCU][iItem].#TEMP_Qty = #0380:4;
$TEMP_ITEM[iCU][iItem].#TEMP_Description = $0320_L5[iS5][iOID][1].#0079:2;
end
Any tips and pointers for master of map editor out there greatly appreciative of your help
Cheers
the spaghetti code that I come up with. I am sure there is a more efficient way. Anyone may suggest to make this more elegant.
It is not the best , but it work for my purpose. Thanks