Skip to Content
avatar image
Former Member

SFTP - PGP encryption - Dynamic file naming not working

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 21, 2016 at 06:35 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 21, 2016 at 06:04 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 21, 2016 at 11:15 AM

    Thanks Manoj! its resolved after correcting namespace

    Add comment
    10|10000 characters needed characters exceeded