cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for getting File Name and updating in target as reference value

Former Member
0 Kudos

Dear All,

I am working on File-PI-RFC interface. In one of the columns of RFC, I need to pass the File Name as reference.

Kindly guide me on which UDF can be used for this requirement.

Regards,

NJ

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Nishu Jain,

Basically my requirement to get Filename in idoc segments in order to validate the posting at month end.


Its an File to idoc scenario- GL Posting.


Please check attached UDF and it gives error. Kindly help. Thanks

Former Member
0 Kudos

Hello,

Prerequisite: ASMA parameter 'FILE NAME' in file adapter checked

And UDF code:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

Refer to /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

BR,

Dzmitry

Former Member
0 Kudos

Hi DZMITRY,

Basically my requirement to get Filename in idoc segments in order to validate the posting at month end.


Its an File to idoc scenario- GL Posting.


Please check attached UDF and it gives error. Kindly help. Thanks

former_member200962
Active Contributor
0 Kudos

The dynamic configuration UDF (with ASMA checked for FileName in Sender File Channel) to get filename can be used here.

The UDF should have a valid return statement....valid means that return filename; ...... where filename is the parameter holding the actual name of the file.....Michal's blog (on Same file name in sender and receiver is what you should lookt at)

Normally we have return "":

Regards,

Abhishek.