Author |
Message
|
WBI_user |
Posted: Thu Sep 13, 2007 3:21 pm Post subject: variable length message |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I have a message like
headerRecord1Record2Record3...Record9
The headers is fixed length 350 bytes. The Record1 to Record9 are fixed length but not the same.(i.e. Record1 is 280 and Reocrd2 is 340...). Each record type can occur 0 to N times.(i.e. the smallest message is just the header and the largest message can be up to header + Reord1xN + Record2 xN and so on. What 's the best way t model this message ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 13, 2007 4:10 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There may not be more than one way to model this message.
You haven't provided enough information to tell. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WBI_user |
Posted: Thu Sep 13, 2007 6:56 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I have modeled this message before in V21 using MRM. V21 does not support repeat Record that does not exists. So basically I have to insert dummy record for records that does not exists and also add repeat counts for every record type that repeats (i.e. record repeats 1 - N times instead of 0 to N times). But things has changed since V21. SO I am looking for other ways (or best practice) to handle this type of message. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 13, 2007 7:45 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
TDS in 2.1 could handle this message, if there's enough information in the message for TDS can handle this message.
CWF, even in 2.1, could handle this message, if there's enough information in the message for CWF to handle this message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WBI_user |
Posted: Fri Sep 14, 2007 4:42 am Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
The only additional information is there is an record ID for each record type.
Here is an example of the message (much simplified).
HEADER 5 BYTES - HD001
RECORD1 6 bYTES - R1AAAA (can repeat 0 - N times)
RECORD2 7 bYTES - R1BBBBB (can repeat 0 - N times)
So a message can be
HD001 OR
HD001R1AAAAR2BBBBB OR
HD001R1AAAAR1AAAA...R2BBBBB.... (There is no information on how many repeats until you scan the message)
I tried a MRM CWF definition
HEADER Fixed length 5 bytes
RECORD1 Fixed length 6 bytes ( minoccurs 0, maxoccurs -1)
RECORD2 Fixed length 7 bytes ( minoccurs 0, maxoccurs -1)
The parser will fail with message tooo short if the message is missing Record1 or it'll map the data wrong because it does not know if the data is Record1 or record2.
I guess I should change my question to how to handle repeating record which may not occur. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 14, 2007 5:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
is the Record ID for each type a) fixed, and b) different for each type... that is, does it uniquely identify RECORD1 or RECORD2?
Then it's a tag, and you can do this as TDS tagged fixed-length. And could do it as tagged fixed-length in 2.1. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WBI_user |
Posted: Fri Sep 14, 2007 3:14 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
Thanks, I'll do it in TDS. |
|
Back to top |
|
 |
christian witschel |
Posted: Sun Sep 16, 2007 4:44 am Post subject: |
|
|
Apprentice
Joined: 07 Dec 2005 Posts: 27
|
let me guess you are trying to parse / create SAP Struktures?
Because that is typical SAP behaviour to have the strukture name at the beginning and then the values. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Sep 16, 2007 10:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
christian witschel wrote: |
let me guess you are trying to parse / create SAP Struktures?
Because that is typical SAP behaviour to have the strukture name at the beginning and then the values. |
In that case you should be using the IDOC parser...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|