Author |
Message
|
LARO |
Posted: Thu Mar 31, 2005 10:09 am Post subject: URGENT !!!! SAP IDOC to XML and vice versa help needed |
|
|
Newbie
Joined: 31 Mar 2005 Posts: 5
|
We are using MQ 5.3 and MB 5.0. I am looking for a sample message set and message flow that transforms an SAP IDOC (we are using the mq r/3 link) to xml and vice versa.
Any assistance that you can provide would be greatly appreciated. I need this information urgently ( today if possible). |
|
Back to top |
|
 |
Tibor |
Posted: Fri Apr 01, 2005 12:48 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
You have to make a CWF message for segments and its identifier have to be same as IDOC segment name (in DD section).
A very simple code snippet (only segment tree copy):
Code: |
-- IDOC -> XML
SET OutputRoot.XML.idocdata = InputRoot.IDOC.DD[1].sdatatag.MRM;
-- XML -> IDOC
SET OutputRoot.IDOC.DD[1].sdatatag.MRM = InputRoot.XML.idocdata;
|
And recommended to look this site Websphere infocenter: IDOC parser structures.
This is a complex example from mqseries.net forums (search="IDOC AND XML").
Tibor |
|
Back to top |
|
 |
LARO |
Posted: Fri Apr 01, 2005 3:40 am Post subject: |
|
|
Newbie
Joined: 31 Mar 2005 Posts: 5
|
I created a small flow (XML to IDOC).
Code: |
SET OutputRoot.Properties.MessageDomain = 'MRM';
SET OutputRoot.Properties.MessageSet = 'PMFK4RK002001';
SET OutputRoot.Properties.MessageType = 'z2ddrrt000';
SET OutputRoot.Properties.MessageFormat='CWF';
SET OutputRoot.MQMD.Format = 'MQSTR';
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.fn_code = InputBody.EAI_HEADER.CODE;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.order_nmbr = InputBody.CREATE.ORDER_NMBR;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.d_num = InputBody.CREATE.D_NMBR;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.ad_nmbr = ' ';
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.ad_flag = InputBody.CREATE.FLAG;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.email = InputBody.CREATE.EMAIL;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.error_code = InputBody.EAI_HEADER.RESULT_CODE;
SET OutputRoot.IDOC.DD[1].sdatatag.MRM.pad906 = ' '; |
I received the following error :
Quote: |
The input node 'XML_TO_IDOC_RESPONSE.MQInput' detected an error whilst processing a message. The message flow has been rolled-back and, if the message was being processed in a unit of work, it will remain on the input queue to be processed again. Following messages will indicate the cause of this exception.
Check the error messages which follow to determine why the exception was generated, and take action as described by those messages.
2005-04-01 06:28:05.827385 1516 RecoverableException BIP2230E: Error detected whilst processing a message in node 'XML_TO_IDOC_RESPONSE.OUT1'.
The message broker detected an error whilst processing a message in node 'XML_TO_IDOC_RESPONSE.OUT1'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2005-04-01 06:28:05.827531 1516 ParserException BIP5134E: Message identifier is not valid.
When parsing an MRM message the broker requires a valid message identifier.
Record the full details provided with this message and contact your IBM support center. |
Thats all the the information that the error provides. I have verified that the message set and type are correct. This error apprears to be refering to the MSGID. (I am copying the message headers.) Any ideas? Perhaps I am missing something.
Does anyone have a sample message set that I can see? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 01, 2005 4:19 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Check that your format name 'CWF' is correct. v5.0 uses 'CWF1' by default. |
|
Back to top |
|
 |
LARO |
Posted: Fri Apr 01, 2005 4:39 am Post subject: |
|
|
Newbie
Joined: 31 Mar 2005 Posts: 5
|
'CWF' is the wire format for my message set. |
|
Back to top |
|
 |
Tibor |
Posted: Fri Apr 01, 2005 4:51 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Quote: |
Message identifier is not valid. |
You missed to fill up the DD header. This is very important because DD segnam describes which model the MRM uses.
Tibor |
|
Back to top |
|
 |
LARO |
Posted: Fri Apr 01, 2005 5:10 am Post subject: |
|
|
Newbie
Joined: 31 Mar 2005 Posts: 5
|
Tibor,
Thank you for your assistance. That worked!!!! |
|
Back to top |
|
 |
LARO |
Posted: Fri Apr 01, 2005 10:42 am Post subject: |
|
|
Newbie
Joined: 31 Mar 2005 Posts: 5
|
I have another question. I am working on an IDOC to XML flow. When the IDOC message is parsed on the input node I receive the following error:
Quote: |
ParserException BIP6118E: The remaining bitstream is too small to contain the indicated structure.
The bitstream, as presented to the 'IDOC' parser, is too small to contain the 'IDOC' structure. The length of this structure as given in the structure header is '1695'. The message appears to have been truncated. |
I have confirmed with the SAP team that the data that they are sending me matches the metadata file that they sent me.
Any Ideas? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Apr 01, 2005 4:15 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Your model is wrong.
You are not correctly handling repeating data structures.
It appears to think that you have received another instance of a repeating data structure that is actually larger than the remaining portion of the data. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Tibor |
Posted: Mon Apr 04, 2005 12:24 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
LARO,
An IDOC structure contains 1 DC segment and more DD segments. Length of DC is 524 bytes and all DDs are 1063 bytes. The length of your message structure (referenced by DD.segnam) must be 1000 byte.
OK, but why 1695 bytes? When you get a simple IDOC from SAP it is 1695 bytes long because:
- MQSAPH - 108
- DC - 524
- DD - 1063
But when you get an IDOC with more segments only DD is repeating.
Tibor |
|
Back to top |
|
 |
|