XI3.0 - file adapter create directory
Hi,
Is there anyway in 3.0 to prevent a receiver file adapter from creating a directory if it does not already exist. There was a parameter in the J2SE adapter but I do not know if or how this has been implemented in 3.0.
Regards
Ian
Ian,
SPS 17 introduces a new configuration setting for the receiver file adapter: "Create Target Directory" which does exactly what you want.
See http://help.sap.com/saphelp_nw04/helpdata/en/57/a21f407b402402e10000000a1550b0/frameset.htm
Regards,
Koen
Similar Messages
-
File Adapter - Create File Name from Payload
Hello,
I have a scenario where I'm sending deductions to external vendors (wage types) following a payroll run, via XI. Part of the message payload includes a data element 'Vendor Name' (e.g. Zurich Insurance). When the XI File Adapter creates the file, I want to create the files as /usr/file/xi/<Vendor Name>.csv
How to I pick up the 'Vendor Name' from the message payload and pass this into the "File Name:" field of the "File Access Parameters in the File Adapter communication channel configured?hi,
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 -
XI3.0 File Adapter - Changing target directory at runtime
Hi all,
I have a XI3.0 running and I'm using the file adapter of SAP Basis 7.00. I'm trying to change the target directory at runtime, as I already did with the file name. The file name could be changed using the DynamicConfiguration, but this does not work for the directory. In help.sap I found the hint to use the variable substitution of the communication channel. I did not get it running, but it also does not solve my problem since I don't want to get the value for the target directory from the message header, but from a SAP IS-U system.
Can anybody help me to solve this problem?Hi,
while using variable substitution, did u set the indicator for create Directory:
<i>If the adapter is to create the target directory, if it doesn't already exist then set the indicator Create Target Directory.
If the indicator is not set and the target directory doesn't already exist the adapter returns an error.</i>
Regards
Vijaya -
Date and Time in Sender File Adapter Target Directory
Hi there,
is there a way of using Date and Time from XI to the Target Directory naming? To use variable substitution some fields of the message had to contain that date and time information, which is not our case.
For filename you can use "add time stamp" option, but and for target directory?
Thanks and regards,
Henrique.> <i>Do you have further information on how to perform
> this with shell commands?</i>
> >> You need to write a shell script. This script will
> add the date/time stamp into the folder in the target
> system. This shell script is executed from the File
> adapter. So once the file is written into the target
> directory, then it will rename the directory.
Hi there, Moorthy
We've tried to write that shell script that you mentioned, but now we have a few doubts on how to make it create the proper directory.
In the file adapter, my target directory is "/%var1%/%var2%/", where %var1% and %var2% are variable substitutions, referencing data which comes from the payload. Now, I need the shell script to append "/<Year>/<Month>/" in the target directory. But where to archive the script? If it stays in the root directory, than how to make it create "/<Year>/<Month>/" folders inside a directory which is variable (/%var1%/%var2%/)?
Is there a way of passing %var1% and %var2% as parameters for the shell script?
Thanks a lot,
Henrique. -
Error in sender file adapter: source directory does not exist
Hi,
The PI system is 7.11
I've created sender file adapter with following details:
Transport Protocol : File System
Source directory: /interfaces/In
I checked in AL11 that this path really exists and it does. (I can even see the .txt file that should be processed.)
But still i get in Communication Channel Monitoring the following error:
"Configured Source directory "/interfaces/In" does not exist.
(i also tried to give the source directory as "interfaces/In" and as "//interfaces/In" but still the same error.
Any suggestions as to what is wrong?
kr
RobertActually, Need to use forward slash (/) to separate directory names in accordance with the Java specification.
But wanted to try if that works..
Also check directory name , path again as this is case sensitive...
--Divyesh -
Reg:File adapter archive Directory
Dear team,
Our requirement is to read a csv file from a directory and archive the file in archive folder specified in the file adapter.
If any exception is caught,then we need to read the archieve file from archive directory rename the archive file with source file name and place it in source directory.
On the receive activity we are able to get the source file name and source file directory.
<receive name="Receive1" createInstance="yes"
variable="Receive1_Read_InputVariable" partnerLink="fileRead"
portType="ns1:Read_ptt" operation="Read">
<bpelx:property name="jca.file.FileName" variable="srcFileName"/>
<bpelx:property name="jca.file.Directory" variable="srcDrFolder"/>
How to get the archive file name and archive file directory from the receive activity so that we can store in local variables.
Pls do help.
ThanksHi,
Another way you can accomplish your scenario. Instead of deleting or archiving in beginning just move the file from inbound to archive location after business flow completion.
In case of error, the file will remain at original position as moving operation is at the end.
First read the file using read operation, then at the end create a file adapter with sync read operation. Change the entries in .jca generated with below sample.
Sample jca file.
<endpoint-interaction portType="SynchRead_ptt" operation="SynchRead">
<interaction-spec className="oracle.tip.adapter.file.outbound.FileIoInteractionSpec">
<!-- Below properties are dummy except Type , it will be changed in runtime -->
<property name="SourcePhysicalDirectory"
value="srcdir"/>
<property name="SourceFileName" value="abc.txt"/>
<property name="TargetPhysicalDirectory"
value="targetdir"/>
<property name="TargetFileName" value="abc.txt"/>
<property name="Type" value="MOVE"/>
</interaction-spec>
Then,in you bpel flow at the invoke for sync read add these two properties.
<bpelx:inputProperty name="jca.file.SourceFileName"
variable="varInputFileName"/>
<bpelx:inputProperty name="jca.file.TargetFileName"
variable="varArchiveFileName"/>
<bpelx:inputProperty name="jca.file.SourceDirectory"
variable="varInputDirectory"/>
<bpelx:inputProperty name="jca.file.TargetDirectory"
variable="varArchiveDirectory"/>
- It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
Thanks,
Durga -
File Adapter: Target directory does not exist
Hi All,
Using RFC to File Scenario.
While processing in File adapter, i get following error for the target directory.
Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Target directory '
*********************\Out' does not exist and cannot be created.
Although I am able to use the same target directory on my local machine.I think FTP user didnt have suffiecinet otherrization to create directory in FTP, check once again Directory format entered is correct.
if you have phycial access to FTP then create one folder and enter the same in File channel and push one message and let us know the result.
Regards,
Raj -
Text Content Conversion - File Adapter - Creates empty file
I am running XI 7.0.
Mapping from abap proxy to file - text content conversion.
The process works, generates and sends file from mySAP, maps through XI, logs onto ftp site and creates file, but doesn't write any data into the file!
I am really confused as to what is happening!
This is taken from the communication channel!
Audit Log for Message: 5ccc2e46-c0f2-5349-e100-00000ddf240f
Time Stamp Status Description
2007-04-28 10:37:21 Success Message successfully received by messaging system. Profile: XI URL: http://host.fqdn:55000/MessagingSystem/receive/AFW/XI Credential (User): XIISUSER
2007-04-28 10:37:21 Success Using connection File_http://sap.com/xi/XI/System. Trying to put the message into the receive queue.
2007-04-28 10:37:21 Success Message successfully put into the queue.
2007-04-28 10:37:21 Success The message was successfully retrieved from the receive queue.
2007-04-28 10:37:21 Success The message status set to DLNG.
2007-04-28 10:37:21 Success Delivering to channel: EPIW_FTP_Receiver_EmployeeRecords
2007-04-28 10:37:21 Success File adapter receiver: processing started; QoS required: ExactlyOnce
2007-04-28 10:37:21 Success File adapter receiver channel EPIW_FTP_Receiver_EmployeeRecords: start processing: party " ", service "XE_DEV_3RD_EPIW_001"
2007-04-28 10:37:21 Success Connect to FTP server "ftp.ftp.ftp.ftp", directory "/ECS/Target"
2007-04-28 10:37:21 Success Write to FTP server "ftp.ftp.ftp.ftp", directory "/ECS/Target", file "epiw_output.dat"
2007-04-28 10:37:21 Success Transfer: "BIN" mode, size 125 bytes, character encoding -
2007-04-28 10:37:21 Success Start converting XML document content to plain text
2007-04-28 10:37:21 Success File processing complete
2007-04-28 10:37:21 Success The message was successfully delivered to the application using connection File_http://sap.com/xi/XI/System.
2007-04-28 10:37:21 Success The message status set to DLVD.
I can see the data before and after... Any ideas?hi,
this is starange:)
did you refresh FTP (F5) ?
maybe you're checking wrong ftp server? with the same folders ?
ups - I thought I doens't create any file...
as suggested check your mapping as per my blog:
/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
just use TCODe for abap mapping tests - SXI_MAPPING_TEST
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> -
File Adapter-Creating a temporary file
Hi,
I got an requirement to place only completed file(With 100% data) in the target directory. So i need to gather the data in a temporary file first before final file is put on the target directory. I know we have an option in the File adapter (Put File). What i need is, where the temporary file is created? do we need to delete these temporary file? and How to test this requirement?
Thanks in advance.
Regards
SreeniHI Sreeni
If you use Temporary file under put file XI wil create a temporary file at the target location only.
But when your requirement is to create file why you are looking for temperory file. Just use Create and it will create a final file.
write mode : directly
Use empty file handling as Ignore
Thanks
Gaurav -
Receiver file adapter creates empty files, Empty-Message Handling SP19
Hello,
We have just upgraded the system to SP19.
One of the new features is that it should be possible to determine how XI messages with an empty main payload are to be handled in the receiver file adapter.
If the parameter Empty-Message Handling is set to 'Ignore' no file should be created if the main payload is empty. In our case an empty file (size 0 kb) is still created even though the main payload is empty and the flag is set to 'Ignore'.
Has anybody experienced the same problem?
// Best regards HansThis should work:
Use your own adapter module that parses incoming message and checks if it has any record sets in the document. If it does not have any record sets, then set the message to empty and then give this modified message to File receiver.
For example, see the example code below:
Module imports..
Audit log import..
DOM imports/SAX imports..
public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
try {
// get the XI message from the environment
Message msg = (Message) inputModuleData.getPrincipalData();
AuditMessageKey amk = new AuditMessageKey(msg.getMessageId(),AuditDirection.INBOUND);
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"RemoveRootTag: Module called");
XMLPayload payLoad = msg.getDocument();
Document doc = parseXmlFile(payLoad.getInputStream());
if(doc != null){
if(!doc.getDocumentElement().hasChildNodes()){
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "Document is empty!!");
payLoad.setContent("".getBytes());
msg.setDocument(payLoad);
// provide the XI message for returning
inputModuleData.setPrincipalData(msg);
} catch (Exception e) {
// raise exception, when an error occurred
ModuleException me = new ModuleException(e);
throw me;
// return XI message
return inputModuleData;
private Document parseXmlFile(InputStream xmlpayload) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
// Create the builder and parse the file
Document doc = factory.newDocumentBuilder().parse(xmlpayload);
return doc;
} catch (SAXException e) {
} catch (ParserConfigurationException e) {
} catch(IOException e){
return null; -
I have set up a File Adapter comms channel that should be picking up a file from the XI SAP system directory path F:\usr\sap\temp.
I place a file in that directory and can see it via SAP transx AL11.
However my comms channel is not picking up the file so my process does not start. I had previously been using a FTP File Adapter and that was working fine. So I know my other configuration is correct. I now needed to testing something use just the plain File Adapter.
The RunTime Cache has been refreshed and I can see my CC via SXI_CACHE.
Here is what I have entered into the File Sender Adapter
Transport Protocol : File
Message Protocol : File
Adapter Engine : Integration Server
Source directory : F:\usr\sap\temp
File Name : MYFILE.XML
Processing Options :
QAS : EO
Poll Interval 60s
Processing Mode : Delete
Processing Seq : By Name
File Type : Binary
Adapter Status : ACTIVEHi
check the following things
first select ur message protocol as "NFS". save the changes and activate the channel.
if still not work go to the communication channel monitoring using the path
runtime work bench->compnent monitoring->dispaly->adapter ebngine->communication channel monitoring--->enter ur channel name and click on use filer button.
and check whether the channel is started or stopped.
if stopped start the channel and the try.
if u still face the problem please reply me back.
Thanks
Rinku -
Changing File Adapter target directory - container bounce required?
I edited USPSshipment.wsdl in the FulfillmentESB project to reflect my desired target directory (/home/oracle/usps_ship instead of C:\temp) and then re-registered the project with ESB.
The registration completed normally, and I verified that the edited USPSshipment.wsdl file exists in the deploy and content directories in the ESB home. Also, checking the WSDL file from the ESB console showed the new value.
However, until I bounced the OC4J_soa container, order submissions continued to use the C:\Temp target. After I bounced the container, the next order submission went to the desired /home/oracle/usps_ship.
What is the expected cacheing behavior here? Is there a programmatic way to clear the cache after an ESB deploy. It is too restrictive if I have to bounce the whole container serving ESB and BPEL (perhaps many processes and ESB adapters) just to make a change in one particular project.
Thanks.Using the SOA Demo, FulfillementESB project ~
Example: Immediate reflection of change w/o further action
If I change the Shipment router filter criteria (Fulfillment_Shipment.esbsvc) to cut at say $750 instead of $500, then re-register FulfillmentESB with OrderBookingIS, JDeveloper reports:
Registration of Services Successful
Fulfillment Shipment Updates
The next submitted order follows the new criteria (e.g. a $600 order goes out USPS).
Example: Change not reflected in runtime, until OC4J container restarted
If I change the target physical directory of the USPS Shipment file adapter (USPSShipment.wsdl), then re-register FulfillmentESB with OrderBookingIS, JDeveloper reports:
Registration of Services Successful
However, the next submitted orders continue to be written to the previous target physical directory. Checking the value of the re-deployed USPSShipment.wsdl at the ESB host filesystem and through the ESB console shows the updated value, but the old copy is being actually used to process the message.
Restarting the OC4J container, causes the updated USPSShipment.wsdl to be referenced for messages submitted thereafter.
-Todd
Message was edited by:
tbeets -
Error: File adapter dynamic directory not safe with subdirectories
Hi,
I'm using variable substitution to determine the destination directory for my RFC->File scenario
In my RFC I have a tag called <PATH> that contains the full target path. If that path doesn't have subdirectories the variable substitution works perfect, for example:
<PATH>directory1</PATH>
Then in File adapter I have %var1% with the value of PATH and it works.
But if I want to add subdirectories on the path, for example <PATH>directory1/subd2/subd5</PATH> the solution doesn't work.
That's the error that I get:
Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: java.text.ParseException: Security violation encountered during variable substitution: Content of variable var1 is not safe: directory1/subd2/subd5
How can I access to that directory?Hi Marshal,
From help.sap:
To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters u201C/u201C, u201C\u201C, and u201C..u201C.
Carlos -
Exception handling in File adapter when directory structure is incorrect
hi,
How can exception handling part be done in File adapter in cases where directory structure is incorrect, or directory
we are referring to is not present.
thanks
YatanIf you are polling then there will be error message in log files.But i dont think we can do exception handling in such cases.
Cheers -
File adapter created file permissions at OS
Hi,
We have a file adapter scenario and once we run the scenario at OS level the file is being created with following permissions.
<b>-rw-r----- </b> 1 xisadm sapsys 19789000 Oct 10 17:01 File10024322.txt
So it is not being processed further till we change the permisions to<b> -rw-rr</b> .
Is there any place in XI where we can change to write the file at OS with <b>-rw-rr</b> permisions.
Thanks
SunilMoorthy,
This is XI writing the file at OS and not XI not reading the file.
But in one of our DEV env the file is being created with <b>-rw-rr </b> permissions after changed some thing , which we are not sure now. Now we have the same issue in production. Bye the way OS is AIX.
We would like is there any place in XI we can change so that XI can write the file to have "others" to <u>read</u> the file.
thanks
Sunil
Message was edited by: Sunil Guditi
Maybe you are looking for
-
Hello, I've two RFC in user-exit. Both, using IN BACKGROUND TASK DESTINATION XI When i execute the transaction, the user-exit is raising and i can see the follow error in SM58: maximum size of requests for one LUW has been reached(1). I've changing i
-
How to deactivate a crashed computer
how to deactivate a crashed computer
-
How to drag songs onto iPod in iTunes7? Where's the list?
Honestly, iTunes 7.. thank you Apple. You've added some visual elements, but where the **** did you put my iPod songs list? If I click on my iPod under "devices" (on left), I am greeted with a fancy iPod settings page.. Where did the iPod song librar
-
CS4 - no longer local help files???
I recently upgraded to CS4, and it seems that when I try to access the help system it goes off to a web site instead of using local help files on my hard disk. This is extremely annoying because: 1. I often work on airplanes and other places where
-
My partner and I both have an iPhone 5s on the Three network in the UK Both phones are on iOS 8.03 We are currently in portugal and because Three do not currently allow minutes from the UK to be used in Portugal. We both bought the europass data to u