cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic configuration filename counter

0 Kudos

Hi All,

Regarding the counter in dynamic configuration filename.

Requirment is to get the filename as "ENURESYYYYMMDD00" where ENUS isthe constant YYYYMMDD is the current date and NN is file number for that day 01 to 99

If the date changes then the file number should be start from 00.

EX: first file triggered on 20120530 then the filename should be as "ENURES2012053001"

     second file triggered on 20120530 then the filename should be as "ENURES2012053002" etc

and if the file triggered on date 20120531 then the filename should be as "ENURES2012053101".

please provide if there is any way to acheive the above solution.

Thanks,

Sabitha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sabitha,

               If you are using  transport protocol NFS, then we have standard functionality to add counter in File construction mode in the Processing tab. But this functionality is not available for FTP. In that case you can use RFC look up.

The below blog by Raja Sekhar Reddy  will help you.

http://scn.sap.com/people/rajasekhar.reddy14/blog/2012/02/15/how-to-maintain-counter-sequence-to-fil...

Thanks & Regards,

Samir


0 Kudos

Hi Samir,

We can add the counter using the addcounter in Fileconstruction mode, but the scenario here is the counter should reset to 01 when the date changes.

former_member184681
Active Contributor
0 Kudos

Hi,

Have a look at SAP Help for Add Counter option, it answers your doubts:

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Based on the description, set:

Format = 01 (01 will be the first value set for each date, leading zeros will be added to match two digits)

Mode = After First File (the counter will start over from 01 for each "constant" file name, so for each equal ENURESYYYYMMDD part, so for each day as well )

Regards,

Greg

Former Member
0 Kudos

We can cachive this by writing a shell script..

0 Kudos

Hi,

I have tested the scenario using the Add counter option in FIle channel.

Output :

Tested yesterday the filename was created accordingly with counter ENUS2012053001 and ENUS2012053002 but when tested the same today the filename is created as ENUS2012053102 where  the filename should be created as ENUS2012053101.

Regards,

Sabitha.

0 Kudos

Could you please provide the script to acheive the above dynamic filename with counter for date change.

Please provide the steps to implement in PI 7.1

Former Member
0 Kudos

Hi Sabitha,

  Were you able to achive this requirement as i have same type of requirement and it would be very helpful if you would provide me with your approch to achive this.

Its quire urgent please help.

Regards

Sikha Kayal

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sabitha,

As said by Greg, if you are trying to place the file using the NFS then you can using the std functionality of NFS.

But if you are trying doing on FTP, then you need to add the counter and its condition in the Synamic configuration UDF in order to achive the requirement.

Former Member
0 Kudos

Hi Sabitha,

Please follow the following link for dynamically ccreating the file name -

1) http://scn.sap.com/message/3714311#3714311

2) http://www.saptechnical.com/Tips/XI/ASMA/Index.htm

Thanks,

former_member184681
Active Contributor
0 Kudos

Hi Sabitha,

For inserting timestamp to the file name, use Dynamic Configuration or Variable Substitution, as described here:

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

For the counter, it depends on whether you connect via NFS or FTP protocol. For NFS, you can use the native functionality of the receiver file communication channel: File Construction Mode = Add Counter

Unfortunately, this is only available with NFS, not for FTP, so the question is whether it matches your scenario.

Regards,

Greg