cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on Dynamic Configuration for creating the directory dynamically

sahithi_moparthi
Contributor
0 Kudos

Hi,

 

  Could anyone explain how to create the Directory Dynamically.

         I chkd the below links but couldn't acheive

http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/03/26/dynamic-configuration-vs-variable...

Please could any one explain me the step by step Procedure for this.

Accepted Solutions (0)

Answers (1)

Answers (1)

zameerf
Contributor
0 Kudos

1)Create a new UDF with input parameter inputDirectory

2)Use the below code

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters()

                  .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

    DynamicConfigurationKey key = DynamicConfigurationKey.create(

                                   "http://sap.com/xi/XI/System/File",

            "Directory");

       conf.put(key,inputDirectory);

       return inputDirectory;

3)Value for inputDirectory(you can set a constant directory path or you can manipulate from the source to produce a value) -> UDF-> Root node of target

4)Enable Adapter Specific Message Attributes in receiver channel, tick the Directory checkbox

5)Just fill a dummy value in TargetDirectory path in receiver channel

6)Activate the objects and test your scenario, directory will be set at runtime

Message was edited by: Zameer Farook

sahithi_moparthi
Contributor
0 Kudos

Hi,

Thanks for your reply.But my req is to create 2 directories using the same Communication channel.Both the directories should be created dynamically

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>But my req is to create 2 directories using the same Communication channel.

AGAIK - this is not possible without using the OS command of the file adapter, 

Regards,

Michal Krawczyk

Former Member
0 Kudos

If you are gonna create folders dynamically using values in ur payload..

Refer this link

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272171407

zameerf
Contributor
0 Kudos

I guess you can achieve your requirement using same communication channel.

By using multi mapping and variable substitution together you can achieve this.

1)Change the occurrence of inbound interface in Messages tab to 0..unbounded

2)You have to determine the directory path in message mapping and set in one of the fields in target.

(Like, check for an input value to be 'A' then set directory as /FirstDirectory/, else /SecondDirectory/ to that target field)

3)Then refer the directory path target field at runtime using variable substitution

The point to note here is if your output is XML file and the directory value cannot be in the output payload, then this will not help. However for flat files you can remove that content using FCC parameters.