cancel
Showing results for 
Search instead for 
Did you mean: 

File Header Line

Former Member
0 Kudos

Hi All,

I have a few hundred messages coming in XML format and I need to send all of them as a single

CSV file with one Header line .

I want to write all the messages to the file in append mode in the receiver CC but how do I have

a single header line in the receiver file in "append mode".

I am using StrictXml2PlainBean for FCC on the receiver side.

Thanks for your time ,

KLK

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

Let me try to clarify the requirement once again ,

XI receives say 100 xml messages at one time and XI has to append all the messages to a single CSV file and post the file out to the receiver.

Suhail , how do I make sure the 1 scenario runs only once. Since I have more than one application instance there fore XI can pick up more than 1 file at a time.

The CSV file should have a single HEADER LINE followed by all the messages. Apart from external script file before FTP is there a better solution.

Please let me know your thoughts.

Thanks,

KLK

Edited by: K.L.K on Nov 12, 2008 10:12 AM

Former Member
0 Kudos

> XI receives say 100 xml messages at one time and XI has to append all the messages to a single CSV file and post the file out to the receiver.

I need a little more information and then I can think about a solution..

1. Is all incoming xml message having the same header message (same content)?

2. Do you have particular place in header message where the value is changing every time in each new message.

Regards,

Sarvesh

Former Member
0 Kudos

Thanks Sarvesh,

All the incoming XML have same the structure i.e ., Master Data details

there is no header record , while writing the CSV file XI has to create this header coulmns for all

the fields in the message and the Receiver File CC will work in Append mode till the end of the day

There is an external schedular to move the file on a daily basis.

Message 1 :

Ex : <XML Message>

<FIELD1>a<FIELD1>

<FIELD2>b<FIELD2>

<FIELD3>c<FIELD3>

<XML Message>

Message 2 :

Ex : <XML Message>

<FIELD1>qq<FIELD1>

<FIELD3>cc<FIELD3>

<XML Message>

-


O/P CSV File :

FIELD1 FIELD2 FIELD3

a b c

qq cc

Former Member
0 Kudos

One solution I can see for this is that if you use a RFC Lookup Function then it will work.

How?

Well, in R3 create on Ztable with a field "Count" which will have an initial value as 1, now as in your mapping when you are creating the header just use the lookup function to see if the value in Ztable is 1, if you get ans as "Y" then create the header and at the same time when you are fetching the data from RFC lookup just increment the value by 1, so that next time you will get and ans as "N".

Apart from this you have to schedule the program to make the counter 1 at the end of the day.

There could be other better alternatives for this, but for the moment I can see only this as an solution.

Regards,

Sarvesh

Former Member
0 Kudos

hi ,

you can achieve this by using three communication channel

1.create a File Receiver cc in NFS mode

and in processing parameters choose append,and do the necessary content conversion if required.say these files are saved in initial folder

2.create a file sender cc.

Scheduling of this is done in CommunicationChannel monitoring, The channel needs to be under automatic control

3.now create another file recvr cc in ftp mode at the directory final and in create mode

Former Member
0 Kudos

Hi,

Can you re-phrase your all points with reason. I didn't get your approach.

Regards,

Sarvesh

Former Member
0 Kudos

Thanks Sarvesh and Robin ,

Robin I see what you say but my incoming load is about 9K XML files now passing them through

so by the send of first scenario we would end up with a 200 MB file and routing it through XI

again would be an Issue !! also processing the same data twice is round .Thanks for the input .

Sarvesh ,

RFC approach will have the same issue as Global parameter ( Amir mentioned ) it will be tricky

if multiple messages are getting processed in IE at the same time then the control is lost.

I have 3 load balanced XI nodes .. I will have to test the Global parameter option but it has to be

static value through out the day and has to be set next day ...

thanks for your valuable time .

KLK

Former Member
0 Kudos

> I have 3 load balanced XI nodes .. I will have to test the Global parameter option but it has to be

> static value through out the day and has to be set next day ...

Hmmm... I don't think the Global Parameter will keep the value as static. As per my understanding It will hold the value only for a particular mapping. So when your next file will go through the mapping you will find the value of Global Variable as original.

Well, I also really need to test this, to clearify my doubts..

Regards,

Sarvesh

Former Member
0 Kudos

Yes , Sarvesh.

The Global parameters are for one instance of mapping program when the next message comes this

vaules are getting initialised again.

Regards,

KLK

Former Member
0 Kudos

Thanks for the confirmation.. meanwhile I aslo tested it and it holds only for single instance of mapping.

Regards,

Sarvesh

Former Member
0 Kudos

Hi

How about bypassing the receiver File adapter and try with Java Proxy. Use the Date time function in java itself to calculate the timings when the program was first executed. It will append all the records and generate output at EOD.

Any thoughts?

Thanks

Gaurav

Former Member
0 Kudos

There are multiple ways in which you can achieve this.

1) Have 2 separate scenario,first scenario will be executed only once and will do the header mapping.after this run the second scenario which will keep on appending files to the files generated from scenario 1,scenario 2 will not have any header level mapping,it will only have item level mapping,this second scenario can run on regular basis.

2)make use of Global declaration section in Message mapping and declare a variable "counter=1",this will check for the first run of the interface and will do the header mapping only if the "counter" is 1.It can get a bit tricky though.

Thanx

Aamir