Skip to Content
avatar image
Former Member

How to send file to FTP on conditional basis.

Hi SAP Guru's,

Can somebody please tell me how to create a file on conditional basis in FTP.

My requirement is that I have to create a file in different directory according to the sender port field.

Interface

IDOC -


> XI -


> File

SNDPRN(DGE008,DGE006,..............) now I need to create the file according to the SNDPRN field.

Example

SNDPRN (DGE006)----


> Target (DGE006/xyz/abc/filename.xml)

SNDPRN (DGE008)----


> Target(DGE008/xyz/abc/filename.xml)

Also how do I send the data to the specific directory because I only get the SNDPRN(DGE008) from the idoc but how to send the data to /xyz/abc/ directory.

I have tried dynamic configuration but it is not working.

DynamicConfiguration conf = (DynamicConfiguration)

container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String MyDirName=DirName;

String ourSourceFileName = conf.put(key,MyDirName);

return "";

Error in Adapter Monitoring

Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header

CAN SOMEBODY PLEASE HELP ME.

Edited by: Muhammad iqbal on Jul 12, 2010 3:04 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jul 12, 2010 at 02:20 PM

    >>String ourSourceFileName = conf.put(key,MyDirName);

    What are you trying to do in this statement? Do you want to set just the directory or directory and file name?

    If it is just directory try this

    DynamicConfiguration conf = (DynamicConfiguration)

    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

    String MyDirName=DirName;

    conf.put(key,MyDirName);

    return "";

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Vijayashankar Konam

      Hi VJ,

      Unfortunately It is not populating on the Dynamic Configuration.

      Could you please check if the code is ok because I have mentioned all the steps which I am following above.

      Thanks,

  • avatar image
    Former Member
    Jul 13, 2010 at 09:03 AM

    working fine

    Add comment
    10|10000 characters needed characters exceeded