cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Header Lines in Flat-File read by FileSenderAdapter

Former Member
0 Kudos

Hello XI and File Sender Adapter Species

We have the following file with fixed file lengths:

#H1 F1

#H2 F1

#H3 F1

#H4 F1

#H5 F1

#H6 F1

#D1 Field1 - Fieldn

#D2 Field1 - Fieldm

#D2 Field1 - Fieldm

#D1 Field1 - Fieldn

#D2 Field1 - Fieldm

#D2 Field1 - Fieldm

….

#F F1

Concrete example as follows:

#H1 150

#H2 ECH150_20070709_026745152.dat

#H3 20070709_1600

#H4 9.0

#H5 8712423010208

#H6 8712423009202

#MDDTD3 146307732 146202845 871687940006178374E70871687910000219120200707090032B 040235031 Noordkant 28 SINT ANTHONIS 5845EW 8716879000004871242300920287124230091962007070909550113533533 8716948000010501000L

#MDDTD4 59664 E10

#MDDTD4 30180 E11

#MDDTD3 146309776 146202839 871694840030212726E70871694830000000309200707090031B 0411 8 Flierakkers 21 VROOMSHOOP 7681XV 8716948000003871242300920287124230091962007070909590113533515 8716948000010503000L

#MDDTD4 3562 E10

#MDDTD4 2422 E11

….

#F6

This File Should be read via the File Sender Adapter and afterwards mapped into the following idoc structure:

IDOC-Type

ZUECH_010

Header Segment: H1, H2, H3, H4 , H5 ,H6

Detail1Segment: Field1, Field2 …. Fieldn

Detail2Segment: Field1, Field2 …. Fieldm

Detail2Segment: Field1, Field2 …. Fieldm

Detail1Segment: Field1, Field2 …. Fieldn

Detail2Segment: Field1, Field2 …. Fieldm

Detail2Segment: Field1, Field2 …. Fieldm

….

FooterSegment: Field1

Now my Questions:

1. As far as I know it is not possible to configure in the filesender adapter 2 different Record sets? We need two record sets, one for the header lines whose occurrences are once per File and one for the detail lines? Does anybody know if this is possible?

2. Any other ideas for a simple solution?

Thanks for a soon answer.

Regards Marlies

Accepted Solutions (1)

Accepted Solutions (1)

prabhu_s2
Active Contributor
0 Kudos

first read it into a strucutre and then use two mapping programs for separating into two different recorset and process for idocs are per requirement

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Marlies !!

You can use the file content conversion option of the file adapter sender to detect for example 2 different types of records, header and detail. Why do you need 2 types of recordsets??

You could use and advanced UDF that receives the whole queue of the header type records, and process them as a whole and then output the one or more values for the target structure. Does each source H# maps to exactly one target H# (e.g. H1->H1, etc. or H1H2H3..H6 = IDOC Header?)

Check this thread:

Please explain a little more of the target structure or how do you need to map.

Regards,

Matias.

Former Member
0 Kudos

I think specifying the record set structure with variable occurrences should work

H1,, H2,,H3,*etc

coz this will handle the case where a record type may not appear at all in a record set

I'm not sure though..I've to try out..

praveen

Former Member
0 Kudos

Thanks all very much for your answers:

The hint from Praveen was very helpful.

If possible we need a solution with the graphical mapping tool and as far as possible without UDF, because at the moment there is no java developer.

The file adapter now produces the following xml structure:

<ZUECH_0150>

<recordset>

<H1>

<KH1>#H1</KH1>

<H1>150</H1>

</H1>

<H2>

<KH2>#H2</KH2>

<H2>ECH150_20070709_026745152.dat</H2>

</H2>

<H3>

<KH3>#H3</KH3>

<H3>20070709_1600</H3>

</H3>

<H4>

<KH4>#H4</KH4>

<H4>9.0</H4>

</H4>

<H5>

<KH5>#H5</KH5>

<H5>8712423010208</H5>

</H5>

<H6>

<KH6>#H6</KH6>

<H6>8712423009202</H6>

</H6>

<MDDTD3>

<KMDDTD3>#MDDTD3</KMDDTD3>

<MDDTD3>146307732 146202845 </MDDTD3>

</MDDTD3>

<MDDTD4>

<KMDDTD4>#MDDTD4</KMDDTD4>

<MDDTD4>59664 E10</MDDTD4>

</MDDTD4>

<MDDTD4>

<KMDDTD4>#MDDTD4</KMDDTD4>

<MDDTD4>30180 E11</MDDTD4>

</MDDTD4>

</recordset>

</ ZUECH_0150>

I would prefer the following structure, because it fits exactly to the structure of the idoc.

That means the mapping is very simple:

<ZUECH_0150>

<HEADER>

<H1>150</H1>

<H2> ECH150_20070709_026745152.dat</H1>

…..

</HEADER>

<MDDTD3>

<KMDDTD3></KMDDTD3>

<MDDTD3>146307732 146202845</MDDTD3>

<MDDTD4>

<KMDDTD4>#MDDTD4</KMDDTD4>

<MDDTD4>59664 E10</MDDTD4>

</MDDTD4>

<MDDTD4>

<KMDDTD4>#MDDTD4</KMDDTD4>

<MDDTD4>30180 E11</MDDTD4>

</MDDTD4>

</MDDTD3>

</ZUECH_0150>

Now my new questions:

1. Is it possible to configure the file adapter to produce a xml structure which afterwards can be mapped with a simple graphical mapping into the idoc structure?

(I can live with the suggestion from Praveen, that the header information is in each recordset but only has content in the first one.)

2. What about the MDDTD4? It is a substructure from MDDTD3. Is it possible to configure this in the file adapter?

Thanks a lot for your help and a soon answer.

Regards Marlies

Message was edited by:

Marlies Nowotka

Message was edited by:

Marlies Nowotka

Former Member
0 Kudos

Sorry I pressed to fast the post button. Is there the possibility to undo?

How can I include xml code into the post?

Former Member
0 Kudos

Now I got it. Please forget my last post. Here a more readable one:

The hint from Praveen was very helpful.

If possible we need a solution with the graphical mapping tool and as far as possible without UDF, because at the moment there is no java developer.

At the moment the file adapter produces the following xml structure:


<ZUECH_0150>
<recordset>
		<H1>
			<KH1>#H1</KH1>
			<H1>150</H1>
		</H1>
		<H2>
			<KH2>#H2</KH2>
			<H2>ECH150_20070709_026745152.dat</H2>
		</H2>
		<H3>
			<KH3>#H3</KH3>
			<H3>20070709_1600</H3>
		</H3>
		<H4>
			<KH4>#H4</KH4>
			<H4>9.0</H4>
		</H4>
		<H5>
			<KH5>#H5</KH5>
			<H5>8712423010208</H5>
		</H5>
		<H6>
			<KH6>#H6</KH6>
			<H6>8712423009202</H6>
		</H6>
		<MDDTD3>
			<KMDDTD3>#MDDTD3</KMDDTD3>
			<MDDTD3>146307732 146202845 </MDDTD3>
		</MDDTD3>
		<MDDTD4>
			<KMDDTD4>#MDDTD4</KMDDTD4>
			<MDDTD4>59664          E10</MDDTD4>
		</MDDTD4>
		<MDDTD4>
			<KMDDTD4>#MDDTD4</KMDDTD4>
			<MDDTD4>30180          E11</MDDTD4>
		</MDDTD4>
	</recordset>
</ ZUECH_0150>

I would prefer the following structure, because it fits exactly to the structure of the idoc.

That means the mapping is very simple:


<ZUECH_0150>
      <HEADER>
              <H1>150</H1>
              <H2> ECH150_20070709_026745152.dat</H1>
                …..
      </HEADER>
      <MDDTD3>
             <KMDDTD3>#MDDTD3</KMDDTD3>
             <MDDTD3>146307732 146202845</MDDTD3>
                 <MDDTD4>
			<KMDDTD4>#MDDTD4</KMDDTD4>
			<MDDTD4>59664          E10</MDDTD4>
		</MDDTD4>
		<MDDTD4>
			<KMDDTD4>#MDDTD4</KMDDTD4>
			<MDDTD4>30180          E11</MDDTD4>
		</MDDTD4>

      </MDDTD3>
</ZUECH_0150>

Now my new questions:

1. Is it possible to configure the file adapter to produce a xml structure which afterwards can be mapped with a simple graphical mapping into the idoc structure?

(I can live the suggestion from Praveen, that the header information is in each recordset but only has content in the first one.)

2. What about the MDDTD4? It is a substructure from MDDTD3. Is it possible to configure this in the file adapter?

Thanks a lot for your help and a soon answer.

Regards Marlies