Author |
Message
|
Naga |
Posted: Mon Sep 19, 2011 9:22 am Post subject: Problem in IDOC data parsing with repeating Tag name |
|
|
Newbie
Joined: 19 Sep 2011 Posts: 4
|
HI,
struggling in parsing IDOC message.
Message structure:-(PS-parent segment CS-child segment)
Occurance MIN MAX shown in ()
controldataparsing corectly(length 524) (1 1)
PS.Ctype000(length 1030) (0 -1)
|-CS.Ctype000 (1 1)
|-PS.C2t000000(lenth 1030) (0 1)
|CS.C2t000000 (1 -1)
PS.Ctype001(length 1030) (0 -1)
|----CS.Ctype001 (1 1)
+----PS.C2t000001(lenth 1030) (0 1)
|---CS.C2t000001 (1 -1)
PS.Ctype002(length 1030) (0 -1)
|----CS.Ctype002 (1 1)
+----PS.C2t000002(lenth 1030) (0 1)
|----CS.C2t000002 (1 -1)
data:-
Ctype000 xxxxxxxxxxxx0000xxxxxxxxxxxxxxxxxxxxxxx
C2t0000000 aaaaaaaa0000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaax
Ctype000 yyyyyyyyyyyy0001yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
C2t0000001 bbbbbbbb0001bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Ctype000 zzzzzzzzzzzz0002zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzx
C2t0000002 cccccccc0002ccccccccccccccccccccccccccccccccccccccccccc
excepted Output:-
Ctype0000
a1 xxxx
a2 xxxx
a3 0000
a4 xxxx
C2t0000000
a1 aaaa
a2 aaaa
a3 0000
a4 aaaa
Ctype0001
a1 yyyy
a2 yyyy
a3 0001
a4 yyyy
C2t0000001
a1 bbbb
a2 bbbb
a3 0001
a4 bbbb
Ctype0002
a1 zzzz
a2 zzzz
a3 0002
a4 zzzz
C2t0000002
a1 zzzz
a2 zzzz
a3 0002
a4 zzzz
Tag length=15 and all elements are of "fixed length".
"Ctype0000","Ctype0001","Ctype0002" referce to "SAME" Type Ctype0000(in the data also)
and All C2t00000X refers RESPECTIVE" Complex type C2t000000X
Tag length=15
only difference in data is
Ctype0000.a3=0000,C2t0000000.a3=0000
Ctype0001.a3=0001,C2t0000001.a3=0001
Ctype0002.a3=0002,C2t0000002.a3=0002
I have used "tagged fixed length" with "sequence" not able to parse correctly.
please guide on this.
Thank you |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 19, 2011 9:36 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
Naga |
Posted: Mon Sep 19, 2011 10:04 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2011 Posts: 4
|
Under Tag[Ctype000] there are about 20 fields including the filler/padding.
and for Tag[C2t000000] there are 33 fields including the filler/padding.
to understand i have shorten the structure. |
|
Back to top |
|
 |
Naga |
Posted: Mon Sep 19, 2011 10:27 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2011 Posts: 4
|
controldataparsing corectly(length 524) (1 1)
PS.Ctype000(length 1030) (0 -1)
|---CS.Ctype000 (1 1)
+---PS.C2t000000(lenth 1030) (0 1)
|--------CS.C2t000000 (1 -1)
PS.Ctype001(length 1030) (0 -1)
|----CS.Ctype001 (1 1)
+----PS.C2t000001(lenth 1030) (0 1)
|---------CS.C2t000001 (1 -1)
PS.Ctype002(length 1030) (0 -1)
|----CS.Ctype002 (1 1)
+----PS.C2t000002(lenth 1030) (0 1)
|---------CS.C2t000002 (1 -1)
In the data part i was not able to find any delimiter, between the Segment name's, but all the segment has Filler data(which is space's) as last element. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Sep 19, 2011 10:28 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Do you understand? Edit your first post. When you paste in code, put [c o d e] tags around the pasted code.
Like this:
Code: |
|----CS.Ctype001 (1 1)
+----PS.C2t000001(lenth 1030) (0 1)
|---CS.C2t000001 (1 -1)
|
_________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Naga |
Posted: Mon Sep 19, 2011 10:44 am Post subject: |
|
|
Newbie
Joined: 19 Sep 2011 Posts: 4
|
Code: |
controldataparsing corectly (1 1) [length 524]
PS.Ctype000 (0 -1) [length 1030]
|---CS.Ctype000 (1 1)
+---PS.C2t000000 (0 1) [length 1030]
|--------CS.C2t000000 (1 -1)
PS.Ctype001 (0 -1) [length 1030]
|----CS.Ctype001 (1 1)
+----PS.C2t000001 (0 1) [length 1030]
|---------CS.C2t000001 (1 -1)
PS.Ctype002 (0 -1) [length 1030]
|----CS.Ctype002 (1 1)
+----PS.C2t000002 (0 1) [length 1030]
|---------CS.C2t000002 (1 -1) |
Only delimiter are the fixed spaces between Ctype000 and C2t000000. |
|
Back to top |
|
 |
|