Skip to Content
0

SFTP - PGP encryption - Dynamic file naming not working

Dec 21, 2016 at 05:53 AM

85

avatar image

Dear Experts,

Interface Flow: IDOC to SFTP (Using PGP encryption) PI version is 7.5 AEX (Java Only)

Problem Facing:

PO number is coming in IDOC, where in we need to send this PO number appended with date & time as a file name to the target server. Output file will be in PGP encrypted way.

Having option of variable substitution & Dynamic UDF code, I tried with dynamic UDF with below code:

****************

public String DynamicUDF(String variablePart, Container container) throws StreamTransformationException{

String filename = new String(""); DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName"); filename = "Vendor" + variablePart + ".xml"; conf1.put(key1,filename);

return variablePart;

*******************************

In SFTP receiver adapter below ASMA is made active:

But when I see the output directory the file naming's are appearing as: %FileName%

Can you please throw some light on where I am wrong.

Thanks,

--Sai


asma.png (4.7 kB)
filename.png (4.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Manoj K Dec 21, 2016 at 06:35 AM
1

Sai,

The namespace mentioned in UDF and channel is different it should be same :

in Channel make the namespace as : http://sap.com/xi/XI/System/File

Br,

Manoj

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Dec 21, 2016 at 06:04 AM
0

Hi Sai!

Try to use any file name in adapter settings without "%" sign since this sign is used for Variable substitution.

Also check if your ASMA attribute was successfully set by observing Dynamic Configuration section in message monitoring.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
sai krishna Dec 21, 2016 at 11:15 AM
0

Thanks Manoj! its resolved after correcting namespace

Share
10 |10000 characters needed characters left characters exceeded