Author |
Message
|
BrisVegas |
Posted: Wed May 13, 2009 8:51 pm Post subject: TDS Fixed Length - Ignore absent elements at end of record? |
|
|
Novice
Joined: 05 Aug 2004 Posts: 14 Location: Brisbane, Australia
|
Hi folks,
I'm receiving a flat file in Tagged Fixed Length format. Is there a way to ignore absent elements at the end of a record and use the delimter/Group Terminator to tell the parser that the record has ended??
TDS model:
Outer level - Tagged Delimited, tag length 30, delimter <CR><LF>
Inner records - Fixed Length, each field has field length defined.
eg. (SAP Idoc)
E1EDK01 000 NZD 0.0000000
E1EDKA1 AG 1234 JOE'S BAR
E1EDP01 1 0049 5.000 EA
etc
My model parses everything fine as long as all the fields are there, but the customer is not sending the empty ones at the ends of records....
As always, help is greatly appreciated.
BV |
|
Back to top |
|
 |
MQEnthu |
Posted: Wed May 13, 2009 9:55 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
I understand that yours is tagged FIXED LENGTH message. Delimiter is to seperate the records. There is no delimiter between the fields in a record. And sending system is not sending the empty fields.
AFAIK, fields can not be excluded when it is fixed length.  _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
kimbert |
Posted: Thu May 14, 2009 1:07 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please provide
- an example of a fully-populated record
- an example of a truncated record
- a correct description of your TDS model ( I don't believe Tag Length="30" is correct! )
Your example has spaces between the records. Did you insert those for readability, or are they really there in the input?
When you post again, please put [code] tags around your examples - it really helps those of us who have to read what you post. |
|
Back to top |
|
 |
BrisVegas |
Posted: Thu May 14, 2009 2:44 pm Post subject: |
|
|
Novice
Joined: 05 Aug 2004 Posts: 14 Location: Brisbane, Australia
|
Thanks kimbert & MQEnthu!
I trimmed the record so it would be readable, the IDOC records are massive. I was hoping my description would be enough for someone to chime in and say "oh, that's easy, you got this bit wrong blah blah.." !! So anyway, here's more information. Thanks in advance.
There are spaces in the records as it is fixed length, ie a 12 character field must be 12 characters, even if there is only 5 chars of data. The records parse ok up to the point where unpopulated fields at the end of the record are just not provided, ie. not space-filled. Does that make sense?
The tag length is 30. In the example below it is
The first record is ok, as NZD is the last field. The second record is 23 chars too short, as they obviously did not sent a currency (NZD) for this amount.
Code: |
E1EDS01 20200000000000422170000670000000 ZFR0.00 NZD
E1EDS01 20200000000000422170000680000000 0011
|
1. Overall message structure INVOIC02
I broke it into two sections, as the Control section record had a tag length of 10, whereas the main IDOC seciton had a tag length of 30. ie.
Code: |
EDI_DC40 2020000000000042217640 3022 INVOIC02
E1EDK01 20200000000000422170000010000000 NZDNZD1.00000
E1EDKA1 20200000000000422170000020000000 RS 0000000496
|
2. INVOIC02 settings
3. IDOC settings (CONTROL is the same except tag length is 10)
4. A sample record (E1EDKA1) as they're all the same.
 |
|
Back to top |
|
 |
BrisVegas |
Posted: Thu May 14, 2009 2:46 pm Post subject: |
|
|
Novice
Joined: 05 Aug 2004 Posts: 14 Location: Brisbane, Australia
|
kimbert - thanks for the tip about formatting
That's very handy! |
|
Back to top |
|
 |
MQEnthu |
Posted: Thu May 14, 2009 9:54 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Is there any field which indicates the length of the record, or may length of the last field which may come or may not. Suppose if it is not coming, field indicating the length is zero. If you have some thing like this, then you can acheive by using length reference...
Otherwise AFAIK, it is not possible to exclude the fields when the complex type is of fixed length... _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
BrisVegas |
Posted: Sun May 17, 2009 5:59 pm Post subject: |
|
|
Novice
Joined: 05 Aug 2004 Posts: 14 Location: Brisbane, Australia
|
no, there's nothing of that sort. the total length for each record is derived by adding up the field lenths (done automatically by the TDS parser). |
|
Back to top |
|
 |
kimbert |
Posted: Mon May 18, 2009 1:49 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The only way to parse this is to change from Fixed Length to Use Data Pattern. Let me know if you want to try it, and need some guidance. |
|
Back to top |
|
 |
|