cancel
Showing results for 
Search instead for 
Did you mean: 

How to give a dynamic File Name for Receiver File/FTP Adapter.

Former Member
0 Kudos

Hi Experts,

I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out" & in File Consturction mode i have given as "Add Time Stamp".

therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out

where as my requirement is only to to add Time & not the Date. (NThhmmss.out)

How to do this ?

for your info we are using ABAP Mapping.

Pl help me

Regards,

Umesh

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Not answered... Closing forcefully

Shabarish_Nair
Active Contributor
0 Kudos

/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

towards the end of the blog u will find a link where u can find code for using dynamic configuration in ABAP mapping.

this should help you.

Former Member
0 Kudos

Hi Umesh,

Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.

And refer the below weblogs for Variable Subtiutuion File Name Scheme

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2

Hope this way would be solve u r problem.

Cheers

Veera

>>>Reward points, if it is needful

aashish_sinha
Active Contributor
0 Kudos

Hi Umesh,

please check out this blog for Step to Step Configuration of Dynamic filename.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hi Umesh,

U can try out this way

Get the date from java function SimpleDateFormat("HHmmssS");

Date date = new Date();

java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("HHmmssS");

String timeStamp = formatter.format(date);

String rcvrFile = "timeStamp.txt";

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

conf.put(key, rcvrFile);

return value;

Regards,

Anoop

Former Member
0 Kudos

Hi Anoop,

where can i write this ? it it UDF. But since i am using ABAP mapping How can i use this?

Regards,

Umesh

udo_martens
Active Contributor
0 Kudos

Hi Umesh,

define a field (directly under root would be most easy), which you fill during ABAP mapping with sy-uzeit. Then use variable substitution (dynamic filename) like described in the link i posted to you.

Regards, Udo

Former Member
0 Kudos

HI Udo,

Can u pl. elaborate this. where exactly i should add one more filed in Data Type ?

my code is exactly like the way it is given in guide ( IDoc-XML structure to a

flat file and vice versa in XI 3.0 ).

so in that code how can i filled the value of Sy-uziet.

I am new to XI. So pl. explain me in detailed.

if you want i can pass on to u my code & & data type (XSD).

pl. reply back.

Regards,

Umesh

udo_martens
Active Contributor
0 Kudos

Hi Umesh,

read in the link and in the posted weblogs. You need to have a filename by variable, to define a variable by givin a path and create that field in the path. In the file adapter ignore that field for content creation. Just read the library documentation or the weblogs.

Regards, Udo

udo_martens
Active Contributor
0 Kudos

Hi Umesh,

you can use dynamic file naming (see <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm">Configuring the Receiver File/FTP Adapter</a> ). Get the current time in Abap mapping from sy-uzeit.

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

How to do this. Where exactly i need to write this. Do you have any example.

pl. help me.

Regards,

Umesh

aashish_sinha
Active Contributor
0 Kudos

Hi,

i hav provided you one example.. can you please chek 'em and let me know if that is working fine? Try simpler one first and the try for advance thing.

Regards