Customizing Time Stamp In Receiver File Adapter
Hi,
I am working in a XI to file adapter scenario.
The default time stamp in receiver file adapter is yyyyMMdd-HHmmss-SSS.
I want to time stamp as "ABC_MM_DD_YYYY_HH_MM_SS".
i searched SDN,but not getting an end to end approach.
Like...I developed a UDF ,but when I map it to receiver root node..I am getting error.
Please help.
Just request for a step by step procedure.
Also,ASMA is not v clear to me......
Plzzzzzzzzzzzz help!!
Regards.
Hi sriparna,
The timestamp used by the File Receiver Adapter is a default pattern, to achieve that you have to use a UDF in the middle of the MM and set the receiver file name with the ASMA, read this for further information:
´´´´ Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name
/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
It really helps,
regards,
Juan.
Similar Messages
-
Add time Stamp format in File Adapter
Is it possible to change Add Time Stamp format ??
If so please let me know the procedure to chnage it..
It is scenario with no mapping so i cant go either Dynamic configuration or Variable substitotion.
Thanks & Regards,
PolasHi,
I think you need to assign it dynamically as you cannot change the format for Add TimeStamp
See the below links:
File Adapter: Dynamic file name
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm
Thanks,
Tiny -
Scheduling Receiver File Adapter
Hi All,
I would like to know if "Planning Availability Times" works for receiver file adapter (communication channel).
My scenario is IDoc to file. The IDoc from SAP end might be sent to XI at anytime but XI has to create the target file at a specific time on a day (say 9 pm). I'm just wondering if I can use "Planning Availability Times" to schedule the receiver cc.
Thanks in advance.
Regards,
Joe.Hi,
Reffer these
Polling based upon availability
http://help.sap.com/saphelp_nw04/helpdata/en/45/06bd029da31122e10000000a11466f/frameset.htm
/people/shabarish.vijayakumar/blog/2006/11/26/adapter-scheduling--hail-sp-19-
Regards
Seshagiri -
Receiver file adapter posts multiples for singel source files
Hi,
I am using wild character in my input source ftp adapter but my receiver file adapter is creating multiple duplicate files. I am not sure why this happens as QOS is set to "Exactly Once" with archive processing mode. I tried with delete mode and the same error occurs. We had no problems testing it in our Dev environment but in QA its acting so strangely...Any advise is appreciated..
-TeresaHi,
2. Homany files you posted at oubound directory?
1. You said duplicate files at receiver side, is the files having time stamp? if so those are not duplicate files.
Thanks,
Satish. -
Date and time stamp for the file
Hi Experts,
My Requirement is to create a csv file with the name testfile_date×tamp.
If i select add time stamp in the receiver file communication channel the file be as testfile_yyyymmdd_hhmmss_XXX.
The XXX is message id which comes by default by selecting add timestamp option.
but, i don't want the message id displayed in the file name.As i know from the blogs we can reach this requirement as per Michels blog
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
I am not clear in the mapping. after writing the udf, to which filed i need to map with that udf.
can you please tell me stel by step how how to do mapping and how to achieve the requirement. request you to send the code forthe udf.
Thanks
RahulHi,
you can wirte udf and map it to root element of the target message type. u just need to execute the udf.
UDF:
// UDF havs one input parameter - timestamp
Code:
DynamicConfiguration conf = (DynamicConfiguration) container .getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String OldFileName = conf.get(key);
String newFileName = "";
if (OldFileName != null) {
newFileName = "testfile_" +timestamp ;
conf.put(key, newFileName);
return newFileName;
Mapping:
Date (standard function) [Formmat yyyyMMdd_hhmmss] -> UDF -> MesageType.
Thanks.
Ritu -
How do you vary the Date/Time stamp format in File Adapters
In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'. How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system? Also, can you control where the Date/Time stamp appears in the filename?
Hi,
There are many threads discussing the same issue. Go thro the following:
Dynamic file name (Date) in Receiver File Adapter
Receiver File Adapter - TimeStamp
Bhavesh's reply in above thread:
You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
Just use this code in an UDF,
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String SourceFileName = conf.get(key);
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
dateformat.format( new java.util.Date() );
String newfilename=SourceFileName+dateformat;
// change to new file name
conf.put(key, newfilename);
return "";
Regards,
P.Venkat -
Empty Message Handling with Receiver File adapter
Hi,
We were using the "Empty-Message-Handling" (status set to Ignore) of Receiver file adapter to stop a 0 KB file from being written to the specified directory.
However, inspite of this, a 0KB file continues to be written.
The specifications are given below-
File Construction Mode - Add Time Stamp
Put File - Directly
Empty Message Handling - Ignore
Maximum Concurrency - 1
File Type - Binary
Can anyone please help with this.
Thanks and Regards,
ShiladityaHI,
In one of thread the same problem was coming. Just look at the thread.
Receiver file adapter creates empty files, Empty-Message Handling SP19
Or
Follow the weblog for the same requirement.
/people/gowtham.kuchipudi2/blog/2006/01/13/stop-creation-of-an-empty-file-from-file-adapter-using-module
Thnx
Chirag
Reward points if it helps. -
Receiver file adapter not responding
Hi guys,
I have 2 interfaces in XI development system that make use of receiver file adapter in order to receive some .txt files. Although these communication channels used to work until yesterday, for some strange reason they stopped functioning, but only in development system. However, I cannot see any error in Runtime Workbench (Communication channel monitoring), it's status is "correctly configured and started" and has a green sign. But, when I sent a file from sender adapter, it is sent correctly, but it never gets received from receiver communication channel.
There is no error in SXMB_MONI either.
In XI production system, the same interfaces are functioning well.
Any ideas?
Best Regards
--EvaggelosHi Amit,
I went into Message Monitoring for this interface and I can see all the messages for the last 24 hours that should be written into a file that have status "to be delivered".
When I go into Details -->Audit Log for a single message:
2007-06-13 11:49:33 Success Processing child message of multi-message with message ID ff896d50-198a-11dc-cdfa-00145e694b16
2007-06-13 11:49:33 Success Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
2007-06-13 11:49:33 Success Message successfully put into the queue.
And in Message Data there is the following information:
Status To Be Delivered
Repeatable Yes
Cancelable Yes
Error Category
Error Code
Start 13.06.2007 11:49:33
End
Sender Party
Sender Service TPBS_GR
Receiver Party
Receiver Service TPBS_GR
Interface http://famar.gr:LoyaltyDataMNSToSRS
MI_LoyaltyDataMNSToGR_IB
Quality of Service Exactly Once
Message b2685674-7626-5141-bfa1-13155ad0d25a
Reference
Conversation ID
Serialization Context
Direction INBOUND
Message Type Recv
Profile XI
Connection File_http://sap.com/xi/XI/System
Transport HTTP
End Point http://fmgralxi01:50000/MessagingSystem/receive/AFW/XI
Authorization
Sequential Number 0
Number of Retries 3
Failed 0
Retries 300000
Valid to
Persist Until 13.07.2007 11:49:33
Schedule Time 13.06.2007 11:49:33 -
Dynamic file name (Date) in Receiver File Adapter
Hi,
can any one tell me how to create outbound file name with receiver file adapter in format like Name_22-08-2006.dat. I need from a current Date in the name of the message (without any other information). In message payload I dont have that date. Is it possible to use variable from user defined function in message mapping for that name?
Regards,
NaychoNaycho,
that's exactly what I've managed to perform using DynamicConfiguration. Check these links:
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm
Particularly, I've created a Java API for using setDirectory and setFileName methods through mappings. I use XSLT with java enhancement because it's a million times easier to parse and get node values with XSL than pure java.
I'm writing a blog on the subject, if you don't resolve the problem until it's out, let me know.
Regards,
Henrique. -
Receiver File Adapter Content Conversion Problem.
Hi All,
I am getting in receiver file adapter due to content conversion setting. Problem is that all the fields coming in file adapter are optional. In content conversion , i have specified fieldfixedlengths. So whenever any optional field is not present , it fails . How should we handle it? is there any option to declare fields as optional, I know that is the there for sender adapter. But no. of fields is also very large, so putting each and every field as optional is very time consuming.
What should i do?
Ranjeet Singh.Hi Daniele,
Instead of using the standard funciton , i created a UDF for handling this situation.
My logic is UDF is like
//write your code here
int Size = Integer.parseInt(Truncate_Size);
String Return_Value = "";
if (!("".equals(Input)) )
if (Input.length() > Size )
Return_Value = Input.substring(0,Size);
else
Return_Value = Input.substring(0, Input.length());
else
for(int i = 0; i< Size ; i++)
Return_Value = Return_Value + " " ;
return Return_Value;
SO in this case also , it should be able to handle empy source element. But it is not working. -
Receiver file adapter not functioning
Hi guys,
We have developed some interfaces that are exporting some .txt files in ftp locations and therefore they make use of receiver file adapter. Although the receiver file adapter used to function properly some days ago, for some strange reason, it stopped receiving any files. This happens only in XI development system but not in XI production system. In XI development, in Runtime Workbench --> Communication Channel monitoring, I can see this communication channel's status as correctly configured and started, with a green sign on the right, but it is not responding when some files are sent to it, and therefore there are no output files in target directory.
Any ideas?? It is urgent.
Best Regards
EvaggelosUdo,
Hi Amit,
I went into Message Monitoring for this interface and I can see all the messages for the last 24 hours that should be written into a file that have status "to be delivered".
When I go into Details -->Audit Log for a single message:
2007-06-13 11:49:33 Success Processing child message of multi-message with message ID ff896d50-198a-11dc-cdfa-00145e694b16
2007-06-13 11:49:33 Success Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
2007-06-13 11:49:33 Success Message successfully put into the queue.
And in Message Data there is the following information:
Status To Be Delivered
Repeatable Yes
Cancelable Yes
Error Category
Error Code
Start 13.06.2007 11:49:33
End
Sender Party
Sender Service TPBS_GR
Receiver Party
Receiver Service TPBS_GR
Interface http://famar.gr:LoyaltyDataMNSToSRS
MI_LoyaltyDataMNSToGR_IB
Quality of Service Exactly Once
Message b2685674-7626-5141-bfa1-13155ad0d25a
Reference
Conversation ID
Serialization Context
Direction INBOUND
Message Type Recv
Profile XI
Connection File_http://sap.com/xi/XI/System
Transport HTTP
End Point http://fmgralxi01:50000/MessagingSystem/receive/AFW/XI
Authorization
Sequential Number 0
Number of Retries 3
Failed 0
Retries 300000
Valid to
Persist Until 13.07.2007 11:49:33
Schedule Time 13.06.2007 11:49:33 -
Receiver File Adapter - Content Conversion
Hi,
I don't quite get this:
I have a structure
<?xml version="1.0" encoding="UTF-8"?>
<AnElement1>
<AnElement2>
Bla bla bla
</AnElement2>
</AnElement1>
I want to convert this to a flat file with a line containing
Bla bla bla
In te receiver file adapter I define the following:
In the 'Content Conversion Parameters'
Recordset Structure : AnElement2
Name Value
AnElement2.addHeaderLine 0
AnElement2.fieldSeparator 'nl'
AnElement2.endSeparator 'nl'
This results in an Empty file each time indicating some error somewhere.
What am I missing?
Thanks
AndreHi Andre,
Just check the link <a href="http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm">File content conversion</a>
Also check out this web log <a href="/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 to TXT</a>
Is there any error log shown in File adapter ?
Regards,
Keith
Message was edited by: keith thompson -
The same filename from a sender to a receiver file adapter - SP14
Hi Expers,
I Have Gone through the link which is given bu Michal.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Here My Questions are.........
1.Should we give any file name in the receiver side Adapter in this scenario.?????
2.How wil be the Sender and Receiver Communication channel Parameters????
What Are they???????
Please Clarify me...
Regards
KhannaHi Rajesh,
Is your query related to sending the file name from the source xml document to the reciever file adapter. If so this can be achieved.
Pls. do the following.
1. In the mapping program that you are using populate the filename coming from the source into the target root element.
2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time
3. To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.
<b>Note: You donot need to specify any filename in the receiver communication channel.</b>
To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
Create an simple user defined function in the mapping and use the following code.
Imports: com.sap.aii.mapping.api.*;
Parameter: String filename
Paramter: String filename;
filename = fileName + ".DAT";
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, filename);
return filename;
You donot need to hard code the value of the filename in the file adapter for your interface.
In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.
Thanks
Indranil -
Repeating structure through the receiver file adapter
I wanted to ask wheter it is possible to create repeating structure through the SAP xi receiver file adapter. What I'm trying to accomplish is this:
Item1
Item2
Item1
Item2
(variable number of times).
I can accomplish the following:
Item1
Item1
Item2
Item2
What I could do is have the Item1 and Item2 fields in the same segment in the design time, but this would mean the file adapter would write all the items on a single line instead of two.
There is no way to define line breaks between the the receiver file adapter field parameters ?
There is no way to support nested structures in the recordset definition ie. Item1.Item2 ?Henri,
What Vishal means is following:
Add sequences of the tag <recordset> between pairs of item1, item2:
<documentName>
<<b>recordset</b>>
<item1>
<field-item1>column-value</field-item1>
<field-item1>column-value</field-item1>
<field-item1>column-value</field-item1>
</item1>
<item2>
<field-item2>column-value</field-item2>
<field-item2>column-value</field-item2>
<field-item2>column-value</field-item2>
</item2>
</<b>recordset</b>>
<<b>recordset</b>>
<item1>
<field-item1>column-value</field-item1>
<field-item1>column-value</field-item1>
<field-item1>column-value</field-item1>
</item1>
<item2>
<field-item2>column-value</field-item2>
<field-item2>column-value</field-item2>
<field-item2>column-value</field-item2>
</item2>
</<b>recordset</b>>
</documentName>
A similar problem with header and items is in this thread:
Repeating structure through the receiver file adapter
Hope that helps,
Stefan -
Append in Receiver File Adapter
Hi All,
i want to append data into the same file in the receiver file Adapter.
<b>for Example ..</b>I have given XYX a file name in the target directory ..for the first execration it puts the data in to the file..
for the Next execution its not appending data to that file..
<b>the Requirement is</b>
for the first time XYX has data 1234
for the next time XYZ need to add
1234 and below this the next data must come
2345 like this
how can i archive this in receiver file adapter,?
thanks
shakifhello,
if you put that question into the correct forum (i.e. XI) you'll probably get an answer within minutes.
kind regards, anton
Maybe you are looking for
-
How do I recover files from an internal hard drive that is no longer recognized?
Hi there, Any help on this problem is greatly appreciated! I have a MacBook Pro (late 2009) running Snow Leopard. Over the last few years, after having brought the computer in to get checked, it seems that the RAM cards have gotten loose (or the bo
-
BAPI for creation of Authorization Objects in BI 7.0
Hi BW Gurus, Greetings!!! Is there any BAPI Available for creation of Authorization Objects in BI 7.0. The data will be transferred through flatfiles. Kindly provide me the info as earliest as possible. Best Regards, Priya
-
Missing idocs from SAP to webmethod
Hi Experts, We have many Interfaces from SAP to AS/400 System Via Webmethods . There are many Idocs are missing in webmethods Even if the Outbound Idocs is showing As Green with Status 03 in SAP. So Could You Please give some Suggestion where could b
-
Need to make an rfc connection to R/3 side.
Hi BW experts, I have an urgent requirement to display data from R/3 system at BW side based on the report value. We were doing RRI call to an ABAP report from a query at BW-side where parameters are passed to same ABAP report on R/3 side. For this s
-
Dear All Transaction VL71 when executed, generates an IDOC which creates a file. This file is used to run a Z-Application. The system was running fine untill a few days ago. Now When VL71 is run, it gives an error. When we check through SMQ1 transact