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 » Message length invalid for IDOC format

Post new topic  Reply to topic
 Message length invalid for IDOC format « View previous topic :: View next topic » 
Author Message
Gibbs00
PostPosted: Tue Sep 11, 2007 12:27 am    Post subject: Message length invalid for IDOC format Reply with quote

Novice

Joined: 06 Sep 2007
Posts: 14

Hi there,

I am trying to rewrite our current flows in version 6.

I am currently writing a test flow for messages going into SAP in IDoc format. I am getting the following
Error when the message goes into R\3 Link:

The length of the inbound message is invalid for an IDoc.
A message was put to the bad message queue. Bad message type 1, reason 4109.


I use the following esql in my compute node:

CREATE COMPUTE MODULE IDOC_MSG_FLOW_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

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;

DECLARE SLine CHARACTER;
DECLARE PadSLine CHARACTER;
DECLARE SLinelen INTEGER;

SET OutputRoot.MQSAPH.StrucId = 'SAPH';
SET OutputRoot.MQSAPH.Version = CAST('1' AS INTEGER);
SET OutputRoot.MQSAPH.StrucLength = CAST('108' AS INTEGER);
SET OutputRoot.MQSAPH.Encoding = CAST('546' AS INTEGER);
SET OutputRoot.MQSAPH.CodedCharSetId = CAST('437' AS INTEGER);
SET OutputRoot.MQSAPH.Format = 'MQSTR';
SET OutputRoot.MQSAPH.Flags = CAST('0' AS INTEGER);
SET OutputRoot.MQSAPH.Language = 'E';
SET OutputRoot.MQSAPH.UserId = ' ';
SET OutputRoot.MQSAPH.Password = ' ';
SET OutputRoot.MQSAPH.Reserved = CAST(X'2020' AS BLOB);
SET OutputRoot.MQSAPH.HostName = ' ';
SET OutputRoot.MQSAPH.SystemNumber = ' ';

-- EDIDD Segment count
SET OutputRoot.IDOC.DC.TABNAM = 'EDI_DC40';
SET OutputRoot.IDOC.DC.MANDT = ' ';
SET OutputRoot.IDOC.DC.DOCNUM = ' ';
SET OutputRoot.IDOC.DC.DOCREL = ' ';
SET OutputRoot.IDOC.DC.STATUS = ' ';
SET OutputRoot.IDOC.DC.DIRECT = '2';
SET OutputRoot.IDOC.DC.OUTMOD = ' ';
SET OutputRoot.IDOC.DC.EXPRSS = ' ';
SET OutputRoot.IDOC.DC.TEST = ' ';
SET OutputRoot.IDOC.DC.IDOCTP = 'ZASD021';
SET OutputRoot.IDOC.DC.CIMTYP = ' ';
SET OutputRoot.IDOC.DC.MESTYP = 'ZASCAGT101';
SET OutputRoot.IDOC.DC.MESCOD = ' ';
SET OutputRoot.IDOC.DC.MESFCT = ' ';
SET OutputRoot.IDOC.DC.STD = ' ';
SET OutputRoot.IDOC.DC.STDVRS = ' ';
SET OutputRoot.IDOC.DC.STDMES = ' ';
SET OutputRoot.IDOC.DC.SNDPOR = ' ';
SET OutputRoot.IDOC.DC.SNDPRT = 'LS';
SET OutputRoot.IDOC.DC.SNDPFC = ' ';
SET OutputRoot.IDOC.DC.SNDPRN = 'MQR3LINK';
SET OutputRoot.IDOC.DC.SNDSAD = ' ';
SET OutputRoot.IDOC.DC.SNDLAD = ' ';
SET OutputRoot.IDOC.DC.RCVPOR = ' ';
SET OutputRoot.IDOC.DC.RCVPRT = 'LS';
SET OutputRoot.IDOC.DC.RCVPFC = ' ';
SET OutputRoot.IDOC.DC.RCVPRN = 'MQR3LINK';
SET OutputRoot.IDOC.DC.RCVSAD = ' ';
SET OutputRoot.IDOC.DC.RCVLAD = ' ';
SET OutputRoot.IDOC.DC.CREDAT = ' ';
SET OutputRoot.IDOC.DC.CRETIM = ' ';
SET OutputRoot.IDOC.DC.REFINT = ' ';
SET OutputRoot.IDOC.DC.REFGRP = ' ';
SET OutputRoot.IDOC.DC.REFMES = ' ';
SET OutputRoot.IDOC.DC.ARCKEY = ' ';
SET OutputRoot.IDOC.DC.SERIAL = ' ';

-- Set up data records for EDIDD --
SET OutputRoot.IDOC.DD[1].SEGNAM = 'Z1ASD021';
SET OutputRoot.IDOC.DD[1].MANDT2 = ' ';
SET OutputRoot.IDOC.DD[1].DOCNUM2 = ' ';
SET OutputRoot.IDOC.DD[1].SEGNUM = '1';
SET OutputRoot.IDOC.DD[1].PSGNUM = '000000';
SET OutputRoot.IDOC.DD[1].HLEVEL = '01';
SET OutputRoot.IDOC.DD[1].sdatatag = 'XML SDATA PART';

-- Set the message format to MRM
SET OutputRoot.MQMD.Format = 'MQSTR';
SET OutputRoot.Properties.MessageFormat = 'CWF1';
SET OutputRoot.Properties.MessageSet = 'MMQM67C002001';
SET OutputRoot.Properties.MessageType = 'IDoc';
RETURN TRUE;
END;

END MODULE;


I used the built in IDoc message definition. I didn’t use the ‘local complex type’
as type for the sdatatag element but assigned a length of a 1000 in its simple type
restriction.

My flow only consist of the MQInput, MQOutput and the Compute node.

Is this the correct way to do it?

Thank you,
Shaun
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Sep 11, 2007 2:30 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

The EDI_DD40 must have a total length of 1063 char. You might want to check if the target system takes unicode or not.
Anyways MQ-Link for R3 will check the IDOC.
YOu specify that you allocate just 1000 char for the sdata section.
This will only work if you have a correctly formated segment to plop in.
MQ-Link will check the sdata section and if not coherent with the segment tag it will reject the IDOC as being malformed.
It will also check the sequence and level of segments. If not coherent with the Idoc definition as given in the EDI_DC40, it will reject the Idoc as being malformed...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message length invalid for IDOC format
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.