cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Time Stamp in Receiver Adapter's File Naming Schema.

Former Member
0 Kudos

Hi All,

I am working on a ABAP Proxy to File(FTP with FCC) scenario.

I have a requirement to place the file at FTP with naming schema XSP_SUPPLIER_CC_DD_MM_YYYY.csv.

I have checked many blogs which talks about Dynamic Configuration, but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).

But in my case sender side is ABAP proxy.

How can I achieve this??

Please suggest.

Regards,

Sachi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I have checked many blogs which talks about Dynamic Configuration, but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).

>>> You dont need ASMA in your case. ASMA is used when you want to fetch additional message attributes which is not part of the standard payload

For your case use only Variable Substition. It will do the trick.

As suggested by fellow SDN Contributors used UDF to create the name of the file in required format and add variable substition on your reciever File communication channel.

Regards

Ramesh

Former Member
0 Kudos

Thank You all for your replies.

Priyanka,

-- What should be sourceFiledValue(Supplier) in my case?

-- How can I use addtimestamphere(my requirement is DD_MM_YYYY)

Please explain me step wise how should I proceed with applying Dyanamic Configuration and variable substitution.

That would be helpful.

Regards,

Sachi

Former Member
0 Kudos

Hi,

I think, you no need to create the UDF.

1. At target message have a element "Filename"

2. For this Filename field in target map as following

Supplier Number

-


> conCat -


> Filename

DateTrans(Convert current date to DD_MM_YY)

3. Use Filename in your receiver file channel as variable substitution.

For variable substitution you can find various blog on SDN.

Regards

Ramesh

Former Member
0 Kudos

Thanks Ramesh, It worked without UDF.

Former Member
0 Kudos

Hi,

Now I am able to place the file at the receiver FTP server with the naming convention XSP_SUPPLIER_CC_DD_MM_YYYY.csv.

But now the issue which I am facing is that in the csv file due to variable substitution current date is coming as the last field of each line item of the file.

I do not want the date to be placed inside the file with line Items. How can I acheive this??

Also, I am not able to understand that I have not Defined FileName parameter in Item.fieldNames as the last filed.

But still adapter is neither failing nor removing the date from line items end???

Why so??

Former Member
0 Kudos

Hi,

item.fieldnames :field1,field2,filename
item.fieldfixedLengths:5,4,0
item.fixedLengthTooShortHandling:Cut

Use the above settings

regards,

Ramesh

Edited by: Ramesh P on Dec 30, 2011 3:19 PM

Former Member
0 Kudos

>>I do not want the date to be placed inside the file with line Items. How can I acheive this

this is the problem with variable substitution where u bound to have the file name in ur target payload and u have to do some manipulations to eradicate this from the output csv file(already suggested above).....IMO using DC is always the best approach

refer this:

Former Member
0 Kudos

Hi Ramesh,

This is not working.

I have created FIlename as seperate note,instead of putting it in Item node.

The setting I used is as follows:

Recordset Structure: Header,Item,Filename

Header.fieldSeparator: |

Header.endSeparator: 'nl'

Item.fieldSeparator: |

Item.endSeparator: 'nl'

Item.fieldNames: IField1,IField2

Filename.fieldNames: Filename

Filename.fieldFixedLengths: 0

Filename.fixedLengthTooShortHandling: Cut

Output is coming as:

Name|Company

Sachi|Vodafone

Ravi|VISPL

Shashank|VF

30_12_2011

Please suggest.

Former Member
0 Kudos

Try the following,

I am not sure it will work!

1. Disable the Filename node (I doubt it will work or not). In this case dont handle it in FCC parameters

2. Dont mention/handle the Fielname node in FCC at all remove it from recordset and related FCC parameters.

Let me know

Regards

Ramesh

Former Member
0 Kudos

Thanks for the reply,

But we got it now

Former Member
0 Kudos

Hi,

We are facing same issue of date field.

Can you please let me know what solution you have used?

Regards,

Neha A

Answers (2)

Answers (2)

PriyankaAnagani
Active Contributor
0 Kudos

Hi,

>> but here the naming schema we fetch is from sender file adapter's ASMA(Adapeter Specific Message Attributes).But in my case sender side is ABAP proxy.

You can use dynamic configuration to not only fetch values from message header you can use it to put values to message heade also.....you can write UDF (code will look like below) and in the UDF you can create string with required filename and concatinate it with the timestamp...

try {

String filename = "";

String timestamp = "";

DynamicConfiguration conf1 = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

filename = "XSP_SUPPLIER_CC_"sourceFiledValue(Supplier)addtimestamphere+".csv";

conf1.put(key1,filename);

return filename;

}

catch(Exception e)

{

String exception = e.toString();

return exception;

}

Supplier>UDF>TargetMessage

In the file receiver communication channel check the ASMA property target filename.

Regards,

Priyanka

former_member191435
Contributor
0 Kudos

Hi,

U can go for variable substitution on replacement pf ASMA.

Can you please create a variable in target side and assign currentdate to that field and used that variable in filename scheme.

Thanks,

Enivass