cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion- complex data structure

Former Member
0 Kudos

I am creating a scenario from IDOC to File. Output file id fixed length file. Here is the file format

Header

REC1

REC2

REC1

REC2

REC1

REC2

....

Note that REC1 and REC2 pair is repeated. File receiver adpater can only handle flat data structure i.e for the above example it will create a file which will look like

Header, REC1, REC1.... REC2, REC2, REC2...

Is there a way to handle such type of data structe in file adapter (fixed length)

Thanks

Kunal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Tyr this way consider Rec1 as header and rec 2 as item and map the item lavel of ur ido to the header so that the header would be written as many time the item is written and make some more twiking i the mapping using the oneasmany functions

this will work as i am handlling the same scenario with 3 levels.

let me knwo if you need any more clarification.

Shree

Former Member
0 Kudos

Is there a way to store a line feed/new line in a constant field in mapping? My output file format is

Header

REC1

REC2

REC1

REC2

REC1

REC2

but rcvr file adapter cannot handle this structure, It can only handle something like this, Header, REC1, REC1,REC1.. REC2, REC2 ...

As a aworkaround I am trying to create a data structure with combine fields of REC1 and REC2 and a constant field which will mark record separator. Ex.

Data Type

HDR

RECORD (fields= REC1 fields... , Separator, REC2 fields)

I am trying to set the separator field to new line so that fiel adapter can write carriage return in the file.

I cannot use recordSeparator property in file becuase of the output file format..

any suggestions on how to get new line feed in this format?

moorthy
Active Contributor
0 Kudos

hi,

<i>

As a aworkaround I am trying to create a data structure with combine fields of REC1 and REC2 and a constant field which will mark record separator. Ex</i>

>>File Adapter will apply the rules based on the segment/node level. Not based on the field level.

In your case, if you combine both then you will get

Header

REC1REC2 like this..

Did you try as i mentioned in my ealier post ?

If you are comfortable with XSLT mappping , then go with that.. Just read the input xml, and get the output as it is ..

REgards,

Moorthy

moorthy
Active Contributor
0 Kudos

Hi,

You can handle this with the help of Context Handling (i.e Remove Context etc)and the some of the user defined functions liek UseonetoMany etc.

Have a look into these- give some idea

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

/people/riyaz.sayyad/blog/2006/04/23/introduction-to-context-handling-in-message-mapping

Regards,

Moorthy