|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQSI v2.1 using ESQL with SAP IDOCS |
« View previous topic :: View next topic » |
Author |
Message
|
sebastian |
Posted: Thu Apr 08, 2004 5:28 am Post subject: MQSI v2.1 using ESQL with SAP IDOCS |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
Our company is using MQSI v2.1. When we translate any SAP IDOC messages,we use the Neon transform nodes. I am trying to be able to perform this transformation using ESQL instead. I have been able to define individual IDOC segments with message maps and transform these from input text line to xml but the challenge seems to be how in ESQL to determine whether the next segment transformed is a repeat of the last segment, a new segment (that will use a new message map) or a new segment that skips an optional segment.
I am relatively new to SAP IDOCs but the way I understand them is that a message is comprised of groups of 1030 byte segments. Some segments are mandatory and some are optional. Some may be repeated and others will not be but the overall segment order is consistent. For example, if I have segments A (mandatory, not repeating), segment B ( optional, repeating) and segment C (optional not repeating), valid message combinations would be; ABC, ABBC, AC, and A. The segments could not be sent out of order, for example CBA would not be valid.
I am assuming what I am looking for is an ESQL if statement that will judge the incoming segment type and then branch to the appropriate mapping subroutine. Do you have any example of something like this or can you point me in the right direction for how I can do this in ESQL? Thank you,
Sebastian _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 08, 2004 5:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So, what you're saying is that the different segments come in a fixed sequence, with optional and repeating fields?
So you'd want a message that contained an element of a Complex Type with a Type Composition of Sequence, and contained optional and repeating elements of Complex Types that described each segment. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sebastian |
Posted: Mon Apr 12, 2004 8:55 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
That sounds right. Can this be done in ESQL? Have you done this or seen this done before?
What would help me is seeing an example of how to use an if condition against the input and then branch out to the appropriate mapping logic in ESQL.
Any input is appreciated,
Seb _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 12, 2004 9:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sebastian wrote: |
That sounds right. Can this be done in ESQL? Have you done this or seen this done before? |
It can be done by modelling your data into a message set, and then accessing the appropriate fields in the message tree using ESQL, yes.
And yes, I've done something similar before, but not with IDocs.
sebastian wrote: |
What would help me is seeing an example of how to use an if condition against the input and then branch out to the appropriate mapping logic in ESQL. |
Well, really you're just asking about the syntax of the IF statement, or the syntax of the CASE statement, or about how to use the RouteToLabel/Label nodes.
All those are in the documentation, including examples. Any examples I could give would be just as generic as those without knowing what your message model would look like or what processing on each segment type you'd need to do. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sebastian |
Posted: Mon Apr 12, 2004 9:31 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
I know I am just sort of jumping into this, but what confuses me is how to define the message set. Would you define a separate message set for each segment and then determine the type of message set to used by an if at the beginning of the message?
When the message first comes into MQSI, it could be any length that is a multiple of 1030 so how do I hold this in storage to check the value of the message to then apply it to a message set? Do I blob it in and somehow apply a message set to the beginning of the data?
I will dig through the documentation as you suggested. Perhaps then it will become more clear.
thanks for the input,
Seb _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 12, 2004 9:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sebastian wrote: |
I know I am just sort of jumping into this, but what confuses me is how to define the message set. Would you define a separate message set for each segment and then determine the type of message set to used by an if at the beginning of the message? |
Not personally, no.
If your logical message consists of a set of different records, then I would put the definitions for all records in a single message set, and have as many actual messages as I needed to model each unique assembly of records. But that's not saying that if you have a logical message consisting of A, B, C, D and E records - and it's valid to have AAB, AAABBBBBC, and etc, that I would make a message for each of those. As long as you've got optional and repeating elements, keep one message. If you get into situations where you have exclusions - AAABCD is valid but only if it doesn't include E, but ABBBBCDE is valid (i.e., A can only repeat if the set doesn't include E) - then I would start defining different messages.
If your records are in any way identifiable by content - either by something that acts as a tag or a field delimiter, or by something that can be matched by a regular expression, then the MRM can identify your different records for you ("resolve the choice") if you model your data as a TDS message.
Where you have to get into parsing BLOB data is when you have to decide what type of record you've got based on field type - like "if bits ten through 20 are a valid integer and not a string, then I've got record A". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sebastian |
Posted: Mon Apr 12, 2004 10:14 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
I am trying to learn more by creating my own test data in a miniature SAP IDOC form.
I have 3 segment types, each is 8 bytes long:
SEG1AAAA (mandatory, flat)
SEG2BBBB (optional, repeating)
SEG3CCCC (optional, repeating)
physical message = SEG1AAAASEG2BBBBSEG3CCCC
Message set definition
IDOC_test
SEG1 STRING - 4 bytes
DATA1 STRING - 4 bytes
SEG2 STRING - 4 bytes
DATA2 STRING - 4 bytes
SEG3 STRING - 4 bytes
DATA3 STRING - 4 bytes
Are you saying that you would define a message set that appears as above? What if the message had a repeating third segment? How would you judge the last segment value?
still researching,
Seb _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 12, 2004 10:26 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, again, your message should be an element of a custom defined complex type.
That type should have a type composition of Sequence where elements are tag delimited (I forget how version 2.1 specifies this), and contain three elements.
Each of those elements should also be of custom defined types. In your very simple example, each of those types are going to only contain your DATAx strings. The properties of the elements of those types, within the Complex type of the message structure, will indicate that the Tag for the element is the appropriate 'SEGx' string (and the tag length for the outer type will indicate that the tag is 4 chars long). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fschofer |
Posted: Tue Apr 13, 2004 2:33 pm Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|