cancel
Showing results for 
Search instead for 
Did you mean: 

How to send file to FTP on conditional basis.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

working fine

Former Member
0 Kudos

>>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 "";

Former Member
0 Kudos

I have tried this one as well but the file is not generating in the particular directory.

Is there anything else I need to do in ID.

I need to generate the file in the specific folder i.e.

systemname then /xx/yy/filename.

DGE008/xyz/abc/filename.xml

where do I need to mentioned about the other folders.

VijayKonam
Active Contributor
0 Kudos

Use multi mapping and add multiple entries in your interface determination. Thus, you can create separate communication channel for each FTP file.

VJ

Former Member
0 Kudos

I don't think multi mapping is a good idea because if i have 50 sender than I have to create 50 comms channels which I believe is not an ideal solution.

I am pretty sure it can easily be done through dynamic configuration

Former Member
0 Kudos

Did u checked the Advance->adapter specific option->directory in the channel?

Regards

Ramg

Former Member
0 Kudos

Off course I did.

I have done the following in Int Rep.

Step 1,

Create an udf for dynamic configuration and mapped it with the MT

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 "";

Steps in Int Dir

Target Directory: /

File Name: filename.xml

Use Adapter Specific Message Attribute = checked

Fail if Adapter Specific Message Attribute missing = checked

Directory = checked

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 HELP ME IN THIS MATTER.

Former Member
0 Kudos

>>I need to generate the file in the specific folder i.e.systemname then /xx/yy/filename. DGE008/xyz/abc/filename.xml. where do I need to mentioned about the other folders.

I dont understand this. What do you mean by other folders?

Can you post the DynamicConfiguration node content after Request Message Mapping in the pipeline from XSMB_MONI?

Refrain posting some thing in CAPS.

Edited by: Jaishankar on Jul 12, 2010 4:18 PM

Former Member
0 Kudos

Hi Jaishankar,

Thanks for your quick reply.

I have mentioned all the steps which I was doing but it's not working.

basically I need to put the file in the DGE008/xyz/abc/filename.xml

but depends on the systemname i.e. DGE008 or DGE006 or S8E009 and then the file should be created in the folder called

DGE008 or DGE006 or S8E009 /xyz/abc/filename.

I hope this will give you bit clear picture.

Former Member
0 Kudos

Modify the code as the blow and see!. yuo have to assing the SNDPRN values instead of "DGE006" for populating dynamically.


String MyDirName= "DGE006/XX/YY/";

VijayKonam
Active Contributor
0 Kudos

First of all, in SXMB_MONI, check in the leftside nodes if you are getting the Dynamic Configuration node getting populated with the values you mention in the mapping. If it is not, then the problem is with the code that you are using in the mapping.

VJ

Former Member
0 Kudos

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,