ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Seeking mrm help on message transformation XML -> SAP IDO

Post new topic  Reply to topic
 Seeking mrm help on message transformation XML -> SAP IDO « View previous topic :: View next topic » 
Author Message
smeunier
PostPosted: Fri Dec 03, 2004 8:04 am    Post subject: Seeking mrm help on message transformation XML -> SAP IDO Reply with quote

Partisan

Joined: 19 Aug 2002
Posts: 305
Location: Green Mountains of Vermont

I have been working this problem for a couple of weeks and have decided, I'm might be missing something basic, either in my ESQL or understanding. I'm converting(trying) a Business Object xml format from the mySAP.com WBI adapter, which for all intensive purposes, is just XML and would like to convert this to a SAP IDOC structure. The message parsing works fine and the output of my trace produces what looks like an accurate representation of an output message. However, an exception is thrown, pointing to a mismatch.The Message Set Types were built on a C header input. Below is the error message:

Code:

 See the following messages for details of the error.
2004-12-03 09:52:33.791999     3668   ParserException  BIP5286E: Message Translation Interface Writing Errors have occurred: 
                                       Message Set Name  : 'IE_ZCPAOR01_IDOC' 
                                       Message Set Level : '1' 
                                       Message Format    : 'CWF' 
                                       Message Type Path : 'z2cokor'
                                       Review further error messages for an indication to the cause of the errors.
2004-12-03 09:52:33.791999     3668   ParserException  BIP5167E: Custom Wire Format error while parsing/writing message 'z2cokor'.
2004-12-03 09:52:33.791999     3668   ParserException  BIP5350E: Custom Wire Format writing error. While writing the message quoted above, the CWF writer encountered an error. 
                                       The error occurred during or after the writing of element '/z2cokor/pad722'.
                                       Check that you have built the message correctly. 
                                       See following messages for more details.
2004-12-03 09:52:33.791999     3668   ParserException  BIP5344E: CWF Output: Mismatch between logical definition and message tree. 
                                       Message         : z2cokor 
                                       Element         : aufnr
                                       The CWF writer has been given a message tree which does not match the logical message definition. 
                                       The elements may have been added to the message tree in the wrong order, or there may be elements missing from the message tree. 
                                       The message type or message set may be incorrect.
                                       If the output message was assembled in a Compute node, check that the elements were added to the message in the order specified in the logical message definition. 
                                       Check that the output message contains all the elements in the logical message definition (perhaps you need to copy the entire input message to the output tree before modifying it) 
                                       Check that the output message has the correct message set and message type properties. 
                                       Check that the output message does not contain self-defining elements. 


Here is ESQL:

Code:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
   SET OutputRoot.*[I] = InputRoot.*[I];
   SET I=I+1;
END WHILE;
-- Enter SQL below this line.  SQL above this line might be regenerated, causing any modifications to be lost.

DECLARE EventMsg CHARACTER;
DECLARE IDOC_Name CHARACTER;

DECLARE RefToCtrl REFERENCE TO InputBody.Control_record."MD_SAP_BO_sap_idoccontrol:MD_SAP_BO_sap_idoccontrol";   
DECLARE RefToLvl1 REFERENCE TO InputBody.Data_record."MD_SAP_BO_zcpaor01_cwdata:MD_SAP_BO_zcpaor01_cwdata"."MD_SAP_BO_zcpaor01_cwdata:MD_SAP_BO_zcpaor01_z2cokor"."MD_SAP_BO_zcpaor01_z2cokor:MD_SAP_BO_zcpaor01_z2cokor";
DECLARE RefToLvl2 REFERENCE TO InputBody.Data_record."MD_SAP_BO_zcpaor01_cwdata:MD_SAP_BO_zcpaor01_cwdata"."MD_SAP_BO_zcpaor01_cwdata:MD_SAP_BO_zcpaor01_z2cokor"."MD_SAP_BO_zcpaor01_z2cokor:MD_SAP_BO_zcpaor01_z2cokor"."MD_SAP_BO_zcpaor01_z2cokor:MD_SAP_BO_zcpaor01_z2copor"."MD_SAP_BO_zcpaor01_z2copor:MD_SAP_BO_zcpaor01_z2copor";

DECLARE Level1_CTR INTEGER;
DECLARE Level2_CTR INTEGER;
DECLARE Level2_CNT INTEGER;
DECLARE Total_Segment_CTR INTEGER;


SET IDOC_Name = 'ZCPAOR01';
SET Total_Segment_CTR = 0;
SET Level1_CTR = 1;
SET Level2_CTR = 1;

SET Level2_CNT = CARDINALITY(RefToLvl2);

-- Create transformed WBIA IDOC BO to Z_SAP_ACTIVITY_REPORT XML

SET OutputRoot.Properties.MessageSet = 'E1JJC3K0A0001';
SET OutputRoot.Properties.MessageType = 'z2cokor';
SET OutputRoot.Properties.MessageFormat='CWF';
SET OutputRoot.Properties.MessageDomain = 'MRM';

SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQMD.Format = 'MQSTR   ';

-- Remove MQRFH2 Header as it is not needed
SET OutputRoot.MQRFH2 = NULL;


-- Create IDOC Control Record
SET OutputRoot.IDOC.DC.tabnam  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Name_of_table_structure";
SET OutputRoot.IDOC.DC.mandt   = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Client";
SET OutputRoot.IDOC.DC.docnum  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_number";
SET OutputRoot.IDOC.DC.docrel  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:SAP_Release_for_IDoc";
SET OutputRoot.IDOC.DC.status  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Status_of_IDoc";
SET OutputRoot.IDOC.DC.direct  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Direction_for_IDoc_transmission";
SET OutputRoot.IDOC.DC.outmod  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Output_mode";
SET OutputRoot.IDOC.DC.exprss  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Overriding_in_inbound_processing";
SET OutputRoot.IDOC.DC.test    = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Test_flag";
SET OutputRoot.IDOC.DC.idoctyp = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Name_of_basic_type";
SET OutputRoot.IDOC.DC.clmtyp  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Extension";
SET OutputRoot.IDOC.DC.mestyp  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Logical_message_type";
SET OutputRoot.IDOC.DC.mescod  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Logical_message_code";
SET OutputRoot.IDOC.DC.mesfct  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Logical_message_function";
SET OutputRoot.IDOC.DC.std     = RefToCtrl."MD_SAP_BO_sap_idoccontrol:EDI_standard";
SET OutputRoot.IDOC.DC.stdvrs  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Version_of_EDI_standard";
SET OutputRoot.IDOC.DC.stdmes  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:EDI_message_type";
SET OutputRoot.IDOC.DC.sndpor = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Sender_port";
SET OutputRoot.IDOC.DC.sndprt = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_type_of_sender";
SET OutputRoot.IDOC.DC.sndpfc = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_function_of_sender";
SET OutputRoot.IDOC.DC.sndprn = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_number_of_sender";
SET OutputRoot.IDOC.DC.sndsad = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_SADR_fields_in_total_Sender";
SET OutputRoot.IDOC.DC.sndlad = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Logical_address_of_sender";
SET OutputRoot.IDOC.DC.rcvpor = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Receiver_port";
SET OutputRoot.IDOC.DC.rcvprt = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_type_of_recipient";
SET OutputRoot.IDOC.DC.rcvpfc = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_function_of_recipient";
SET OutputRoot.IDOC.DC.rcvprn = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Partner_number_of_recipient";
SET OutputRoot.IDOC.DC.rcvsad = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_SADR_fields_in_total";
SET OutputRoot.IDOC.DC.rcvlad = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Logical_address_of_recipient";
SET OutputRoot.IDOC.DC.credat = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_creation_date";
SET OutputRoot.IDOC.DC.cretim = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_creation_time";
SET OutputRoot.IDOC.DC.refint = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Reference_to_interchange_file";
SET OutputRoot.IDOC.DC.refgrp = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Reference_to_message_group";
SET OutputRoot.IDOC.DC.refmes = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Reference_to_message";
SET OutputRoot.IDOC.DC.arckey = RefToCtrl."MD_SAP_BO_sap_idoccontrol:EDI_archive_key";
SET OutputRoot.IDOC.DC.serial = RefToCtrl."MD_SAP_BO_sap_idoccontrol:EDI_ALE_Serialization_field";

SET Total_Segment_CTR = Total_Segment_CTR + 1;
-- Build Control RecordHeader XML Node
SET OutputRoot.IDOC.DD[Total_Segment_CTR].segnam = 'z2cokor';
SET OutputRoot.IDOC.DD[Total_Segment_CTR].mandt  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Client";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].docnum = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_number";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].segnum = '000001';
SET OutputRoot.IDOC.DD[Total_Segment_CTR].psgnum = '000000';
SET OutputRoot.IDOC.DD[Total_Segment_CTR].hlevel = '01';
                                                       
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.aufnr = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:AUFNR";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.ordertype = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:ORDERTYPE";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.plant = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PLANT";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.productid = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PRODUCTID";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.ec = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:EC";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.lotlabel = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LOTLABEL";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.other_lot_label1 = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:OTHER_LOT_LABEL1";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.orderqty = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:ORDERQTY";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.customercd = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:CUSTOMERCD";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.srcevendor = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:SRCEVENDOR";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.waferid = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:WAFERID";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.lotowner = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LOTOWNER";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.lottype = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LOTTYPE";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.prty = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PRTY";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.planstart = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PLANSTART";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.planfinish = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PLANFINISH";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.linecodejc = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LINECODEJC";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.qualitycod = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:QUALITYCOD";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.poi = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:POI";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.poi_text = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:POI_TEXT";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.cot = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:COT";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.cot_text = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:COT_TEXT";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.lotprodtyp = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LOTPRODTYP";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.productcd = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:PRODUCTCD";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.familycd = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:FAMILYCD";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.lot_cmmnt = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:LOT_CMMNT";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.devassem = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:DEVASSEM";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.devassemtx = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:DEVASSEMTX";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.numdevices = RefToLvl1."MD_SAP_BO_zcpaor01_z2cokor:NUMDEVICES";
SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.pad722 = ' ';





-- Build Detail XML Node
WHILE Level2_CTR <= Level2_CNT DO
  SET Total_Segment_CTR = Total_Segment_CTR + 1;
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].segnam = 'z2copor';
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].mandt  = RefToCtrl."MD_SAP_BO_sap_idoccontrol:Client";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].docnum = RefToCtrl."MD_SAP_BO_sap_idoccontrol:IDoc_number";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].segnum = '000001';
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].psgnum = '000000';
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].hlevel = '01';
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.SOURCELOT = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:SOURCELOT";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.SRCEPRODID = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:SRCEPRODID";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.ec = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:EC";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.qty = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:QTY";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.srcevendor = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:SRCEVENDOR";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.waferid = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:WAFERID";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.linecodejc = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:LINECODEJC";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.qualitycod = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:QUALITYCOD";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.devpoi = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:DEVPOI";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.devpoitxt = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:DEVPOITXT";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.date_of_mfg = RefToLvl2."MD_SAP_BO_zcpaor01_z2copor:DATE_OF_MFG";
  SET OutputRoot.IDOC.DD[Total_Segment_CTR].sdatatag.MRM.pad859 = '';


  SET Level2_CTR = Level2_CTR + 1;
 
END WHILE; 

-- Send message to ASMView for processing via label node
SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = IDOC_Name;
PROPAGATE;


[/img]
Back to top
View user's profile Send private message
fschofer
PostPosted: Fri Dec 03, 2004 8:22 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,

you cannot model a CWF message for a c-header based Idoc,
because the Idoc contains a variable number of segments
and sub segments.

You have to use TDS or the IDoc parser.

If you want to use TDS you have to add it as an additional
physical structure to your message set.

And no the ugly stuff you have to manually add the length
of each field in the TDS tab and do some other additional
modications to your message set.

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
shanson
PostPosted: Mon Dec 06, 2004 10:00 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Quote:
you cannot model a CWF message for a c-header based Idoc,
because the Idoc contains a variable number of segments
and sub segments.


Not quite true. The IDOC parser supplied with V2.1/V5 handles the variable number of segments and delegates the fixed content of each segment to MRM CWF. That looks to be what smeunier is doing.

The BIP5344 message indicates a mismatch between the message tree and the message set model. All I can suggest is to check that the fields are defined in the same order as the EQSL assignments (or alternatively use composition 'unorderedSet'); that any missing fields have default values defined in the message set; and that any fields that are short have the CWF padding character property set appropriately.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Seeking mrm help on message transformation XML -> SAP IDO
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.