cancel
Showing results for 
Search instead for 
Did you mean: 

Data appending to file and data deletion from file

Former Member
0 Kudos

Hi All,

I am doing a FTP to FTP scenario in which my requirement is as follows:

1. PI picks up file from FTP n clears the content of file. (Here file is not deleted only the file content are deleted)

2. When PI puts data to destination it appends the data to existing file.

Can anybody plz suggest how to handle this data clearing part of file and appending of data to file?

Thanks in advance.

Regards,

Rohan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi rohan,

This can be achieved by using Java Mapping between the interfaces. Use one of the Parser method to play with the XML payload.

/people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs

/people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

regards

Ramesh P

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>> PI picks up file from FTP n clears the content of file. (Here file is not deleted only the file content are deleted)

It is not possible round the way can do as Aamir mentioned

>>When PI puts data to destination it appends the data to existing file.

Append option will help you

Regards

Agasthuri Doss

Former Member
0 Kudos

Hey

its not possible to just delete the data and not delete the file with XI,you need to delete the whole file.or may be use OS scripts on the sender file adapter

for the second option,give the <i>File construction mode</i> as append in the Receiver file communication channel.but this append will work only if you are using FCC on receiver side,if you are appending XML structures one after another,then the resulting XML wont be valid(more than one root node)

hence use the append mode with caution

Thanx

Aamir

Former Member
0 Kudos

Hi Aamir,

Thanks for ur reply.

Can you explain more on "OS scripts on sender file adaptor" ?

Any links for same will be more helpful.

Regards,

R G

Former Member
0 Kudos

Hey

you need to write a script (Perl,Unix etc)and save it on some XI server directory(for e.g /XIScenarios/scripts) then give this path under the <i>Run Operating system command after message processing</i> in the sender file adapter,once the file is picked the script will be executed and the file will be cleaned.

/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi

also there are more blogs on SDN regarding scripts,please search them

Thanx

Aamir