cancel
Showing results for 
Search instead for 
Did you mean: 

Generating File name as versions

Former Member
0 Kudos

Hi,

I have a scenario where in my output file should be generated in versions or sequence.

order_00.xml and nest file as order01.xml so on for every file posted ..

My receiver is a 3rd party system and we are using FTP not NFS..

Any help in achieving this would be appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

It would be better to have the timestamp in the receiver filename to identify easily and would be convinient to check in Moni with the time frame.

Thanks,

Former Member
0 Kudos

Hi hareen,

no not that way. Lemme rephrase it.

there are 5 orders to be sent every week abt the status to a 3rd party system.(IDoc-File)

first file created should be created with name as Order_00 for the first idoc and next file as Order_01 for the next idoc.

For NFs we can use Add counter in Processing parameters.. but for FTP how to acheive this?

Edited by: katakoti on Jan 21, 2011 6:38 AM

Former Member
0 Kudos

Hi,

Instead of going with the sequence number, it would be better to go with the IDOC number.

Here is the code:

public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
try
{
	DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
	DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
	String filename = "Prefix_" + docnum + ".txt";
	conf.put(key, filename);
	return docnum;
}
catch (Exception e)
{
	return docnum;
}

you can add a counter function to thiis code to achieve the requirement.

Thanks,

Former Member
0 Kudos

Hi,

I Don't think that is possible because every time, a file is generated i.e. orders_00 how will SAP XI/PI come to know that it has to name Order_01 for next file. since there is no buffer/status or memory which can be used for naming and keeping the track of files generated.

Every time the scenario runs it generates a file irrespective of what name the previous file was named, And as suggested you can add time stamp.

Regards,

Sainath Chutke