cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a sequence number in the name of a flat file?

malika_boubguel
Explorer
0 Kudos

Hi folks,

Does somebody know how to generate a sequence number for the name of a flat file?

Here is the scenario:

An IDOC is sent from ERP through XI to an FTP server (some mapping and conversion are done and everything is fine).

The name of the file has a specific format SSSSNNNN.RCV, where:

- SSSS represents a store number (problem solved)

- NNNN any sequence number.

I need to generate a sequence number when the file is created. Any number but each time it has to be different.

Any idea is very much appreciated.

Thank you in advance.

Malika.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Malika

I am also facing the same issue.could you please tell me how to solve the problem.what was the solution to store number

Regards,

prajna

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you have XI SP14 or above you can

use adapter spefific attributes

to se the filename in the mapping

and there you can define any name you wish

with a simple java user defined funciton

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

Regards,

michal

malika_boubguel
Explorer
0 Kudos

Hi Michal,

Thank you for the quick answer.

More background of the question:

The sequence number as I already mentioned should be a 4 character long and it must be unique ( as we might send this file many times a day, the name should be different). We can reuse the same number after the file is processed by an external application but we should ensure the uniqueness at least for a timeframe of 5 days.

I thought about appending to the file but again the content is complex, it contains a header and a detail section.

Another idea was that I can take the time of a day but I cannot guarantee that the file will be sent in different times…

For your information, I also I use XI 7.0, FTP and file adapter.

Thank you and best regards.

Malika.

henrique_pinto
Active Contributor
0 Kudos

Create a table in ABAP which holds this 4-char number and create a RFC which reads this value, increments it, updates the table and returns it to you. So, you'll have unique numbers (since you will always increment it by 1) which you can then use in a Dynamic Configuration of the filename.

Regards,

Henrique.