cancel
Showing results for 
Search instead for 
Did you mean: 

File name generation with sequence number

Former Member
0 Kudos

Hi All,

My scenario is, File to File. I need to generate the filenames at the target side like File1.xml, File2.xml..File9999.xml for each file triggered from source system. The interface tiggesrs multiple times in a day.

For example, for the first time, 5 files triggered, need to generate File1.xml,File2.xml..File5.xml. After some time the interface might trigger with 10 files, then need to generate files as File6.xml,File7.xml....File15.xml . Once the file count reaches 9999 then need to generate the files from 1 (File1.xml)again.

Could you please suggest me the possible solutions. For this any Lookups required?

Regards,

Praveen Kumar

Accepted Solutions (1)

Accepted Solutions (1)

SudhirT
Active Contributor
0 Kudos

Hi,.

Probably you can create a Ztable in R3 and each times your scenario runs can retrieve the values from table via an RFC lookup in UDF in MApping and can use it in Dynamic Configuration FileName function or variable substitution.

Thanks!

Former Member
0 Kudos

Hi Sudhir Tiwari ,

Yeah, Thanks for your reply. This might work but I'm looking for simpler soultion. Any soultion using existing mapping functions? or UDF?

Regards,

Praveen Kumar

SudhirT
Active Contributor
0 Kudos

Yes, solution by Sushil could work in case you need to edit the file name within one complete run of the scenario, but once the scenario is executed how will its variable keep track of the sequence thats why I suggested the solution of using R3 system to store the sequence values.

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Praveen,

Case 1: If a field in source data carries the information regarding the sequence.

You can map this value ( Directly .. or using some transformation ) in some temporary field in the target and then use a Variable substitution at the receiver communication channel.

Case 2. If the source file name carries the sequence information. then you can enable the Adapter specific settings in the Sender communication channel , and then get the information of the source file name using the Container object in the mapping. Then assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.

Case 3 : If Case 1 and Case 2 are not applicable ... then you have to use a Ztable to store the sequence number , a function module to fetch the number , and then use a UDF in which you will implement the RFC call logic.Then the same process .... assign the sequence number to a field in the target , use a Variable substitution at the receiver communication channel.

BR,

Sushil.