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.
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...
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