cancel
Showing results for 
Search instead for 
Did you mean: 

PI / HCI SFTP add file counter to output file

former_member207428
Participant
0 Kudos

Hello everyone,

after our mapping steps, we write an xml output file to an sftp server. Works fine, but ... we have the requirement to 'number' the output files.

Example :

First file is 01_xxxx, second file 02_xxxx, etc.

What is the best way to achieve this ? In case the server is restarted or the project redeployed (due to an update), the number can't restart from 0, but should continue numbering where it ended.

Right now, via an oData call we write a variable to a back-end system field, but if it can be achieved in a better way, yes please

Thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

vicky20691
Active Contributor
0 Kudos

HI Kevin,

In case of any kind of J2ee engine restart the counter will reset.

i could suggest you to write an RFC program to perform RFC lookup to increment the counter for file name but even in this case if the RFC program execute and then while response to PI it fails you will face problem.

The best way I see for your scenario is to have a file lookup.

Regards,

Vikas

former_member182412
Active Contributor
0 Kudos

Hi Kevin,

Who is the sender? if it is ERP system you can use number range in ERP to generate sequence number and send it in the message and then by using variable substitution you can generate the receiver file.

Regards,

Praveen.

former_member207428
Participant
0 Kudos

Hi Praveen,

the sender is SuccessFactors, we are using the CompoundEmployee interface.

Thanks & best regards,

Kevin

former_member182412
Active Contributor
0 Kudos

Hi Kevin,

Only way to store the sequence number in the database or file, check below links.

Using JDBC lookup:

Storing sequnce number in file system:

If you have B2B add on:

Regards,

Praveen.