cancel
Showing results for 
Search instead for 
Did you mean: 

Need UDF Help

Former Member
0 Kudos

Hi All,

I am working on IDoc to File interface, I have to place file with sequence number in the FTP server.

Could any one help me with this please..?

Thanks & Regards,

AK

Accepted Solutions (0)

Answers (2)

Answers (2)

RaghuVamseedhar
Active Contributor
0 Kudos

If you are using NFS, you can set Add Counter in receiver file adapter.

Configuring the Receiver File Adapter

Former Member
0 Kudos

Hi Raghu,

Thanks for your reply.

Here I am using FTP not NFS.

RaghuVamseedhar
Active Contributor
0 Kudos

Just a thought.

You can split the interface into 2 interfaces. IDoc - PI - NFS and NFS - PI - FTP.

First interface, write file to temporary NFS PI location with "Add Counter". Second interface pass-through with 'adapter specific message attributes' set for file name.

iaki_vila
Active Contributor
0 Kudos

Hi Ak,

Check this link http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/503e9bea-ea09-2e10-ec8a-cdf369de9...

Later you can use dynamic configuration to use those numbers to create name of the file.

Regards.

Former Member
0 Kudos

Hi Inaki,

Thanks for your reply,

I am not able to get that Jar file,could you please help me with that.

iaki_vila
Active Contributor
0 Kudos

Hi Ak,

If you notice the class getSequenceNumber the trick is to have a file with the last number, then each time a message mapping access to this file, it gets the number and set the next number for the next time.

Regards.

Former Member
0 Kudos

so simply by adding that class to import archive it will work right?

iaki_vila
Active Contributor
0 Kudos

Hi Ak,

You should have access to create a file in one directory of the PI system.

Regards,

Former Member
0 Kudos

Hi Inaki,

I didn't get you,could you please explain it more clearly?

iaki_vila
Active Contributor
0 Kudos

Hi Ak,

If you check the code first try to access to this file


File propertiesfile = new File("Sequence.properties");

....

properties.load(new FileInputStream(propertiesfile));

Later try to get the current sequence number:


String number = properties.getProperty(formatName);

And finally with the variable "counter", increment the file number value and to return this value.

You need to have a directory with you can read/write and to change the first sentence that i wrote, for example: "File propertiesfile = new File("/usr/sap/trans/Sequence.properties");". Ask to your basis if there is a directory with these premises.

Hope this helps.

Regards.