cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence Number in File Name

Former Member
0 Kudos

Hi All,

I have a requirment where the Output file name should be appeneded with a sequence number which needs to be in sync with the number of records processed.

Each time this sequence has to be started from the previous number where it ended.

The soultion at the moment we have used it to store each time this counter in a file and read is back and update when done. Other solution is to meke use of the Tabe on ECC side

Is there any solution with in the map it self to maintain this number.

Any help will be appreciated.

Thanks

-Kulwant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

You can use RFC lookup to call an RFC to get the count of no. of entries in table and accordingly you may use that number.

You need to maintain this number somewhere, or may be atleast need to pass the previous count as part of inout payload.

Thanks

Swarup

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kulwant,

Within Mapping you cannot save the counter as container and even global variables are flushed once the mapping is executed for the message, so i think we cannot do it using mapping.

Also, dont know if you have tried OS commands feature provided by SAP for file adapter explained in link below:

[/people/santhosh.kumarv/blog/2008/07/27/glimpse-at-os-command-yet-another-scenario]

We can first create the file on some temporary location of the application server and then execute a batch file which would contain the code to fetch previous count(variables in OS commands can hold this value) and increment the same and copy the flie thus created by communication channel by appending the count to file name and also delete the file created by communication channel.

Hope this helps !

Regards,

Amit

Former Member
0 Kudos

Hi Bhatia,

There is no standard way for this requirement. Best thing would be to take care of this sequence in sap itself. I dont know how you are sending data to xi. If you are using idoc or rfc then extend this with this functionality so that it would not be a problem in xi side, else if you try to use this functionality in xi you may run into issues like while sending the sequence number to ecc if ecc sends in the same time you will have issues.

So better to maintain this functionality in sap itself.

Regards,

---Satish