File Events using parameters
Hello,
Is it possible to create a file event which "files" field can use a parameter as value ?
My point is that I would like to create a script, with a directory path parameter, that is launched every time that a file comes to the directory path parameter, and not create one script for each directory.
If someone know a way to make this works, please answer me.
Thanks in advance,
Regards,
Yi Jiang
Hi,
You do not need to create separate scripts, you can simply create one script with one wait event and then create multiple file events for different paths and patterns that all raise the same event.
The exact filename and path are stored in the raise_event comment, and you can retrieve this value in your runtime parameter on the script using the jcs_event.event_filename() function.
So then each job of this single script will know which file to process based on the parameter.
Regards,
Anton
Similar Messages
-
File Events Triggering Erroneously
I have been using file events for a few years. The creation of a file from an application triggers a report to run (file event), then I use schedule events to trigger addtional reports for the same application. The file events are getting triggered for no apparent reason. The files did not get updated or created new. The files are in shared folders on filers which are referenced in CMC as File Events using a UNC designation.
When this happens, it usually triggers all file events. This happened a few times in the past, and I would clean up the mess and blame it on sunspots. But it has happened three times in the past month. I'm not sure if it's something on the network that makes these files appear "new" or if there's an issue with BOE File Events. Has anyone else encountered issues with File Events? Is there a fix? Thanks in advance for your response.Hi Isaac,
You'll probably best off with moving the files away. For some reason, the move caused all files to look like new ones.
If all files are processed one by one anyway, you could have CPS move them using a move directory so they'll never show up again.
Regards,
Anton. -
I used a method LoadPrototypeFromMetaDataToken(token,options) to load the return type parameters. I am unable to set the value field in the return parameters for an action step in teststand sequence file programatically using C#.How can I do that.
Continue here
-
Reading large XML file using a file event generator and a JPD process
I am using a FileEventGenerator and a JPD Subscription process to read a large XML file. The large XML file basically contains repeated XML elements. My understanding is that the file subscription method reads the whole file in memory which causes lots of problem for huge file size like 1MB. Is there a way to read the file size-wise or is there a way to read chunks of data from a large size file..or any other alternative. I would like to process the file in a loop iteration by iteration.
Hitejain,
Here are a couple of pointers you could try. One is that the file event generator has a pass by reference (filename) functionality which you could use so that you could do the following inside of your process.
1) Read file name from the reference
2) Move the file to a processed directory (so it doesn't get picked up again. Note: I don't know how the embedded archive methods of the file event generator plays with pass by reference.
3) Open a stream to the file.
4) Use a SAX or SAX - DOM combined approach to parse your XML while managing the memory usage inside of your process
There is another possibility which might fit your needs and it is related to the RawData object that BEA provides. If I understand it correctly provides wrapping functionality around a stream object, but depending on your parsing methods might just postpone the problem.
Hope this helps
Chris Falling
Stormforge Software -
Using NFS Auto Mounts with File Event Generators (FEG)
Has anyone had experience with using WLI file event generators with auto mounted NFS filesystems? The problem that we are running into is that threads are staying blocked if there is an I/O request to a hard mounted NFS filesystem that does not return a response. We know we need to figure out why periodically we are not getting a response from the NFS server on some requests, but the thought is that at least with auto mounting, the request would time out and the thread would continue, process the I/O exception, and then go back into the pool. Thx.
OK, I have a work around that will do for now: disable DNFS, like this:
cd $GI_HOME/rdbms/lib
make -f ins_rdbms.mk dnfs_off
Re-start ASM, and then it works:
SQL>
SQL> alter system set asm_diskstring='/dev/sd*1','/u01/nfs_shares/asm/*' scope=memory;
System altered.
SQL> select group_number,path,header_status from v$asm_disk;
GROUP_NUMBER PATH HEADER_STATU
0 /u01/nfs_shares/asm/irond3 CANDIDATE
0 /u01/nfs_shares/asm/irond6 CANDIDATE
0 /dev/sdg1 CANDIDATE
0 /dev/sdh1 CANDIDATE
0 /u01/nfs_shares/asm/irond4 CANDIDATE
0 /dev/sdf1 CANDIDATE
0 /u01/nfs_shares/asm/irond1 CANDIDATE
0 /u01/nfs_shares/asm/irond5 CANDIDATE
0 /u01/nfs_shares/asm/irond2 CANDIDATE
1 /dev/sde1 MEMBER
1 /dev/sdd1 MEMBER
1 /dev/sdc1 MEMBER
1 /dev/sdb1 MEMBER
13 rows selected.
SQL>
But clearly, this is not ideal. If anyone has any other suggestions, I would be very grateful. -
Restart/resubmit job chain waiting of a file event
Hi Experts,
how can I restart/resubmit a job chain waiting of a file event?
In my case the variables OriginalPath and FinalPath are used in job chain parameters as an Default Expression (waitEvents...). If I restart the job chain I get the message "Could not evaluate default value for parameter...".
We are using SAP-CPS Build M28.20-37214.
Regards
MathiasHi,
You probably want to restart it because there was a failure somewhere in the chain. In this case it is easier to not let the chain end in error, but to let it go to status Console using the "Request Restart" postcondition.
Then when the step is restarted, or the chain is restarted from the beginning, it is restarted within the original chain and it reuses the already determined parameter values.
Regards,
Anton. -
Create XML file by using servlet
Hi, Is there anyone who sucessfully create XML file by taking parameters from a web form? If so, hope you could share the code with me. I moved the code from the example to servlet. it keeps returning null pointer exception on the root node.
java.lang.NullPointerException: at oracle.xml.classgen.CGDocument.(CGDocument.java:62)
nullHi everybody,<br /><br />the code works good now. so it should be available for everybody who needs it:<br /><br />---------------- my code --------------------------------------<br /><br />var container = "";<br /><br />container = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";<br />container = container + "<all>\n";<br />container = container + "<header>\n";<br />container = container + "<author>author name</author>\n";<br />container = container + "<authorMail>[email protected]</authorMail>\n";<br />container = container + "</header>\n";<br />container = container + "<body>\n";<br />container = container + "<name>" + value + "</name>\n";<br />container = container + "<adresse>" + value + "</adresse>\n";<br />container = container + "<ort>" + value + "</ort>\n";<br />container = container + "<staat>" + value + "</staat>\n";<br />container = container + "<plz>" + value + "</plz>\n";<br />container = container + "<land>" + value + "</land>\n";<br />container = container + "</body>\n";<br />container = container + "</all>\n";<br /><br />var myDoc = event.target;<br />myDoc.createDataObject("export.xml", container);<br />myDoc.exportDataObject("export.xml");<br /><br />app.mailMsg(false, "mail-address1; mail-address2", "", "",<br />"mail subject", "mail body");<br /><br />---------------- end of my code ------------------------------- <br /><br />now i'm looking for a solution to automatically attach the file to this mail and directls sent it without to call up the mail client.<br />if anybody has got an hint, you're welcome ;-)
-
File to File scenario using Transport Protocol FTP Problem
Hi,
my scenario is a file to file scenario using Transport Protocol FTP
there are 3 systems involved
a. computer 1 ( My system-source)
b. computer 2 (XI server)
c. computer 3 (Target system)
I want XI to pick file from computer 1 and post it to computer 3
I am logging on to XI server from computer 1(thro SAP GUI),
<u><b>Sender communication channel :</b></u>
Transport protocol:FTP
Messsage protocol: file
<u><b>In FTP connection Parameters:</b></u>
Server: computer 1 IP address
port:21
User name and PW---> I have given computer 1 Username and password.
Connection mode: permanently
Transfer mode: Binary
Folder: C:\ftproot\output
filename : given
<u><b>In Receiver Communication Channel</b></u>
Transport protocol:FTP
Message protocol: file
<u><b>In FTP connection Parameters:</b></u>
Server: computer 3 IP address
port:21
User name and PW---> I have given computer 3 Username and password.
Connection mode: permanently
Transfer mode: Binary
Put File: Use Temporary File
Folder:
eccserver\saploc\tmp
filename scheme: given
When I activate the scenario file is not getting picked from the source
In Adapter Framework: Message says up and running No message processing now
How to check FTP server is up and running on computer 1 (source system)and Computer 2 (XI server)?
What could be the problem ?
Thanks
dushanthHi
Consider that I dont have FTP installed on my computer. According to this blog
/people/shabarish.vijayakumar/blog/2006/08/01/along-came-a-file-adapter-mr-ftp-and-rest-of-the-gang
I have configured.
In sender comm channel I have given Ipaddress of computer 1 (which has a file to be picked)
In Receiver Comm channel I have given IP address of computer 3 (in which file to be posted)
and computer 2 is the XI server
Computer 1 has FTP installed
1. XI server should have FTP installed or not ? IF yes is it FTP client or FTP server or Guild FTP (according to the blog is enough)
2. Computer 3 should have FTP installed or not ?
Please help me I am really confused.
Thanks
dushanth -
File Content Conversion Parameters in FIle Adapter
Hi
I am doing a scenario - XML file to Text file using File content conversion parameters in Receiver File Adapter Channel.
I given FCC Parameters like:
DATA.addHeaderLine - '0'
DATA.fieldSeparator - ,
DATA.endSeparator - 'nl'
But im getting error in Receiver File Adapter as - fieldSeparator not specified.
i would be greatful if any one help me.
Regards
RajeshHi Rajesh,
There are lot of blogs which explain File Content Conversion in different scenarios:-
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
I hope this helps.
Regards.
Praveen -
How to send multiple files by using File Adapter
Hi Experts,
I am trying with the scenario by using the File Adapter.
As per my requirement, I need to send multiple files (like FileA.xml, FileB.pdf, FileC.txt, FileD.html etc) to the Target system.
I have seen Additional Files option, in Sender Communication channel. But I am not sure how to give the parameters, in case if I would like to send the multiple files as mentioned above.
Could someone please explain about the steps, that I need to proceed further?
Thanks in advance.
SreeAnand,
Thank you for your reply.
My requirement is to send the multiple files like inone.xml, intwo.txt etc. In the Sender Communication channel, I had provided ' inone.xml ' in the File Name field under the "File System Access Parameters" section.
Next I had chosen "Additional Files" option as Checked and provided ' intwo.txt ' in the field name of "File List".
After activation, i have provided those two files (inone.xml, intwo.txt) in the Source folder. It is not processing? What could be the problem ?
Thanks
Sree -
How do i extract Delimited falt file-Sender File adapter FCC Parameters
Hello,
I'm trying to extract data from a flat file. The file is built as tab delimited. I cant find the option of tab delimited in the XI Sender File adapter FCC Parameters. How do i extract tab delimited file?
Please Advice,
RajeshHI,
You can use Fieldseperator as '0X09'...
Look at this blog...........you can solve this problem...
NAB the TAB (File Adapter)
Thanks,
Madhu
Edited by: Madhu sudhan Reddy on Jul 28, 2008 9:02 AM -
Target file name using Dynamic Configuration
Hi,
Currently we have requirement Idoc to File interface.In this scenario if one field exists infile then we have to check and we need to create update directory and if it is not exist then we should create one more directory and upload files over there there files should create with timestamp. Since,File system using Sql database so we have used JDBC lookup to check that particaluar field and if it exists we are passing update to UDF if it is not then we are passing constant Create to that. If we use Adapter Specific Message Attributes then in reciever side file Communication Channel addtimestap will it consider or do we have to write anything in Udf it self? Could anybody explain on this?Please provide some sample udf .
Thanks ,
Aparna.
Edited by: aparna_karnam on Dec 24, 2011 11:44 AM
Edited by: aparna_karnam on Dec 24, 2011 11:52 AMHi,
I have added little changes to the code you have written, to meet your expectations
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
conf.put(key,"/sap-dev/" +a);
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
string filename=conf1.get(key1);
final String DATE_FORMAT_NOW = "dd-MM-yyyy_HH-mm-ss";
String s;
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT_NOW);
java.util.Calendar cal = java.util.Calendar.getInstance();
s=sdf.format(cal.getTime());
filename=a+" "+"User_"+s+".txt";
conf1.put(key1,filename);
return " ";
So if value of input variable "a" is "update" then the target directory will be "/sap-dev/update" and the file formed will have name "update User_26-12-2011_01-20-50.txt", of course the date and time values will change depending on server settings. I just showed a sample. one more point, the directory will not be created, you have to create the directories before you run the scenario, only the final directory will be decided depending on value of variable "a". In case you wanna create new directory if directory is not pre-existing then try ticking on "Create Target Directory" option under "file access parameters" in communication channel. (I have never used this option u can have a try. )
Now coming to your queries
1. But whether file type txt automatically it will take or do we have to give in udf it self ?
ans) You have to put the value in UDF as I have done in code.
2. how it will consider timestamp ?
ans) This has been generated in UDF itself.
3. how i can give file extension .txt?
ans) same as ans 1
4. And also in Receiver Communication Channel under Adapter Specific Message attributes we have option of file type how it works?
ans) File type determines is the file you are going to write is of type "text" or "binary". From "Processing Parameters" tab you can select this from drop down menu in communication channel or you can set it through ASMA properties in similar manner as you have done for file name and directory name. For more details refer to http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6830e67f2a6d12e10000000a1553f6/content.htm
Finally few more points I would like to add
1) you have not mentioned the operating system of the server where file is going to form. In case its UNIX/LINUX you are not allowed to use space in the filename. you can consult these links before you decide on file name and directory name in the UDF mentioned above
http://www.med.nyu.edu/rcr/rcr/nyu_vms/unixfileanddirectorynames.htm (UNIX)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions (WINDOWS)
2) you can alter the string "DATE_FORMAT_NOW" as per your requirement so that the timestamp appears in the way you want. I have just showed a sample.
3) Plesae do not forget to tick on the options "Use Adapter-Specific Message Attributes indicator", "Fail If Adapter-Specific Message Attributes Missing", indicators "File Name" and "Directory" under "Define Adapter-Specific Message Attributes." in receiver communication channel.
Hope this solves your problem.
Wish my dear forum members and users of SDN
Merry Christmas and Happy new year (in advance)
Regards
Anupam
N.B:- I initially forgot to add the ".txt" part to the file name. I made necessary corrections in code now. -
Hi im trying to contribute documents on UCM using parameters because my legacy applications wont support webservice and because this can be the most simple way.
Reading services documentation i found CHECKIN_UNIVERSAL
If i use this url:
http://localhost/idc/idcplg?IdcService=CHECKIN_UNIVERSAL&dSecurityGroup=Public&primaryFile=C:/test.txt&dDocAuthor=AUTOR&dDocTitle=TITLE
I get this error message:
Content item 'DEMO_000002' was not successfully checked in. The content item must have a primary file.
I did exactly like the documentation.
What`s missing?The check in services require an actual file as a payload along with the call. Simply using parameters in the url will not work for a check in. Unless you want to do a metadata only check in?
In which case if your server is configured for that you can add this addtional parameter to your url: createPrimaryMetaFile=true
Read More Here:
[http://www.corecontentonly.com/2008/09/15/MetadataOnlyCheckIn.aspx|http://www.corecontentonly.com/2008/09/15/MetadataOnlyCheckIn.aspx] -
In iPhoto, how can I find a particular event using the search function?
NO - read my last answer over a year ago
That is because iPhoto is all about photos - not about files
You do not access the piles in iphoto - you access the photos using either iPhoto or the media browser - see this user tip for photo access details
LN -
Infoview Issues Missing Events and Parameters
Very strange problem. I am on BO 3.1... the CMC shows all events and parameters. When I open up Infoview under the same login (administrator), I am not able to see any events when I go to schedule. In its place, under job history, the report would show NO parameters even though it has parameters and it is showing in CMC. Also, when trying to schedule it based on an events, there are no available events. Instead, I get a message of "This is a formatting string" in all of the boxes.
At first I thought maybe it is a setting for the Infoview application on CMC but it does not make sense since administrators have FULL CONTROL.
Help.
Thanks!Hi,
Does this happen for all reports? If so, then its probably an interface issue more than anything else. You'll want to redeploy the web applications, or at least the InfoView releated ones (InfoViewApp, InfoViewAppActions, PlatformServices)
You can use WDeploy to do this.
[Web Application Deployment Guide - Windows|http://service.sap.com/~sapidb/011000358700001647122008E/xi3-1_deployconfig_win_en.pdf]
[Web Application Deployment Guide Unix|http://service.sap.com/~sapidb/011000358700001647132008E/xi3-1_deployconfig_unix_en.pdf]
Or, an easy way in Tomcat is to go to the WebApps directory and just rename the folders of the apps you want to redeploy. Then restart tomcat and wait about 20 minutes for the apps to re-deploy.
Other than that, have you modified the out of the box security at all? Locked down permissions to the InfoView application or anything along those lines?
Thanks
Jonathan
Edited by: Jonathan Brown on Jul 13, 2010 6:47 PM
Maybe you are looking for
-
I am unable to hear anything on my iphone 4 nor can the person i call hear anything when i speak - I think that my ear piece and mike have both got magnetised how do fix the problem Please help
-
Message handling in ALV events
I have a screen with ALV Grid control. This grid has columns (attributes of more than one material). Now when I select more than one column and click on a button added on the ALV grid toolbar it triggers a button click event and in the implementatio
-
After PR convert to PO, MRP does not consider PO as the supply
Hi gurus, The problem is like the following: Material A, Plant : CN01 Procurement type: F ( External procurement) Avability check group-- 002( standard one ) MRP type -- PD( standard one) Requirement-- 100 PC. What I did is : 1) Run MD02 ( MRP) to ge
-
Service Call Solution Able to delete
Hai Experts, In Service Call--> Solution Able to delete now... My Actual Requirement : Once Service Call Solution once Solution Added Can not able to delete is it possbile??
-
I've just started exploring the Adobe TV site and have found quite a bit of material I'd like to watch. I would like to "subscribe" to a series--Acrobat 9 for example. At the top of the list is a selection to add tv shows to my homepage. I have made