cancel
Showing results for 
Search instead for 
Did you mean: 

XI Receiver file adapter : Dyanmic File PATH

Former Member
0 Kudos

Hi,

Appreciate if someone could help me on the issue below:

I have a receiver File adapter with a dynamic target directory as per below:

Target directory: /test/YYYY/MM/DD

the value for YYYY (Year) , MM (Month) and DD (Date) will be the date when the file being transfered from the sender.

Appreciate if someone could help me to achieve this. I know we can use the variable substitution however it doesn't allow us to set a systems field such as sy-datum.

Cheers,

ZAB

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

sorry i mistype the sample code

<b>String valueOld = conf.get(directory);</b>

it should be

<b>String valueOld = conf.get(key);</b>

hopefully someone could help me to solve this problem. Or otherwise could someone show me how can I locate the method 'put' of Dynamic Configuration class, so that I could see how the code looks like.

Zubair

moorthy
Active Contributor
0 Kudos

Hi,

I did not understand , what is the purpose this user deifined function here..

Your requirement is to get the Dynamic Folder Name with Required Date Format..

FOr this , use small Java Function to get the System date (XI system Date) and pass this date in required format to the Ouput Payload. And then use Dynamic Variable Substitution feature of File REceiver Adapter and substitute this date value from the Payload..

My understanding may be wrong here

According to your current post I think you are looking into this part -

http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

Hope this helps,

REgards,

Moorthy

Former Member
0 Kudos

Hi,

I've tried the XI SP 14 technic which provide by Michal to solve my issue with the dynamic filepath. However, it didn't work when I even tried to hardcode the path within the user defined function:

Below is my sample code:

<b>>>>>> UDF

DynamicConfiguration conf = (DynamicConfiguration)container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String valueOld = conf.get(directory);

String valueNew =''/usr/sap/interface/PDI/201/openbooks/in/2006/05'';

conf.put(key, valueNew);

>>>>> UDF</b>

As per the code above it seems like the 'conf.put(key, valueNew)' failed to register the path which I've assigned to it.

Appreciate if someone could help me on this. As for the background of what I've done I follow exactly as per weblog by Michal. Even I've checked the file and it seems like the adapter working fine however it didn't move the file to the folder in valueNew.

Cheers,

Zubair

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Populate this value in your payload , and then use Dynamic File Name concept of File Adapter.

The dynamic filename generation concept is as follows.

In your filename field. just give a variable with % symbols. (eg: %file% ).

Now, under the option Variable Name Substitution, you can give how the value has to be created.

It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.

For the former, your give

message:interface_name ,etc

and for the payload part you give,

Payload: "your element root which u wanna acecss"

Just check this link out,

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

And read the contents under variable substitution and it will help you understand the concepts better.

If you have any clarifications, do get back,

Regards,

bhavesh

moorthy
Active Contributor
0 Kudos

Hi,

If you want to have that type of date format, it is better to pass required value thru the field in the Mapping.

http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

Hope this helps,

Regards,

Moorthy

MichalKrawczyk
Active Contributor
0 Kudos

hi,

try using adapter specifi identifier for a directory:

/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions

technical name: Directory

adapter namespace: http://sap.com/xi/XI/System/File

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>