Get the name of the file generated by the File Adapter
Hello,
I am creating XML files using the File Adapter. Each file name is unique (my_file%SEQ%.xml) and I would like to know if there is a way to get the name of the generated file so that I can sent it as an attachment in an email notification. Thanks!
you can't get the generated filename for write operation.
But what you can do, is to define header variable of OutboundHeader_msg type, define your own filename (based on your unique creation criteria) and then pass it to invoke activity for file creation.
Similar Messages
-
Cannot get the db adapter connected to sql server proc
I cannot get the db adapter to connect to my sql server proc. I understand it is a 3rd party db and that I need to create some "artifacts" using the Oracle BPEL Process Manager 10.1.2 > Developer Prompt and run the sample files which I have received from Oracle. However, I am on a linux platform and the procedures are written for windows platform. Has anyone done this artifact generation in linux and if so, what do I need to do to get these built so that I can get my db adapter hooked into my sql server proc?
Same problem with me.. Couldnot call a stored procedure or function with SQL Server db service.. Some other threads say we need to use a command line utility since there are some comaptibility issue with JDeveloper 10g and com.microsoft.sqlserver.jdbc.SQLServerDriver..
Please help anyone. What is the workaround?? Please post it here.. Nowhere I could find the solution.
Thanks,
Susmit Dey -
How to get _pageLabel name in jpf file?
hi,
i need to get _pageLabel name in .jpf file
if any one knows, please reply
jphi,
already this isse solved.
please donot reply
jp -
HT1635 where can I get the power adapter for MC207xx/A . It's a 60W "T" connector
where can I get the power adapter for
MC207xx/A . It's a 60W "T" connectorYou can get a new third party 60W power adapter on eBay for under $20.
http://www.ebay.com/sch/i.html?_nkw=macbook+power+adapter&_sacat=0&_sop=12&_dmpt =Apple_Laptops&_odkw=macbook+power+adapter&_osacat=111422&_trksid=p3286.c0.m270. l1313
Or for $80 from Apple http://store.apple.com/us/product/MC461LL/A -
Dynamic File Name for Receiver File Adapter
Hi All,
How can we use dynamic name for Receiver file adapter?
Can anyone help.
Thanks in Advance
ChemmanzHi Chemmanz,
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 -
Error dynamic File Name in Receiver File Adapter
Hi all,
Dynamic file name for Receiver file Adapter Problem
my multi mapping look like this in design mode
messages
message1
SD01_E
FileName
row
message2
SD02_E
FileName
row
by processing the xml look like this:
<ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
or
<ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
<FileName>L40SA939.xiConstant</FileName>
- <row>
in file receivere adapter i have try this but it dos not work
payload:SD01_E,1,FileName,1
Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
is there any way to have access to Filename in different root elements??
regards
RalfHi Ralf,
i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
Regards,
Udo -
Dynamic file names in outbound file adapter
I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem.I have to configure a flow in XI system wich takes an input file from one machine and after mapping process leaves the output file in target machine with the same name of input file.
Name of input file won't be always the same (*.dat) so i cannot hardcode this name in outbound file adapter.
Does anyone know how to transfer input filename from inbound file adapter to XI message and then to outbound file adapter?
I know there is an option to create dynamic file names in file adapter but i think it isn't enought to solve my problem. -
Changing the file name dynamicallly in file Adapter - NullPointerException
Hi, I want to change the file name directly from Java Mapping in the file adapter for this i have written this code:
[code]
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:""/""/"+"sap.com/xi/XI/System/File","FileName");
String newFileName = CCC'_'NNN'_'NOMCIA'_'DATE;
conf.put(key, newFileName);
return newFileName;[/code]
Where CCC, NNN, NOMCIA and DATE are input of the user-defined function.
but it gives a null pointer exception:
[code]16:44:53 Start of test
Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:215)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Root Cause:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:215)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Root Cause:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:215)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.NullPointerException
at com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_.FileName$(_MM_JDBC_2_HSBCAltasTrabajadores_TEST_.java:564)
... 26 more
RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
16:44:53 End of test[/code]
Regards,
Luis DiegoHey Luis,
the container object only exists in message mapping runtime.
Thus you're getting a null pointer exception there.
For java mappings, remember that you have a .setParameter() method (which is necessary from definition of StreamTransformation interface),
which sets the private variable param with the transformation parameters. In your .execute() method, just use it like this:
DynamicConfiguration conf = param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Regards,
Henrique. -
Changing the file name dynamicallly in file Adapter
Hi i want to change the file name directly from Java Mapping in the file adapter
for this i have written this code
DynamicConfiguration dynamicConfiguration = (DynamicConfiguration)map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey keyFile = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey keyDir = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
dynamicConfiguration.put(keyFile,fileName);
dynamicConfiguration.put(keyDir,outputpath);
but it gives a null pointer exception at dynamicConfiguration.put(keyFile,fileName);
please suggest.
regards
Nilesh Taunk.Hi Nilesh,
If your requirement is to create , the file name dynamically for your receiver file adapter, you can do so using your <b>FILE ADAPTER CONFIGURATION</b> itself, and need not go for any JAVA Mappping / Java Code at all.
The dynamic filename generation concept is as follows.
In your filename field in the receiver file adapter, just give a variable with <b>%</b> symbols. (eg: %file% ).
Now, under the option <b>Variable Name Substitution</b>, you can give how the value has to be created.
<b>It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.</b>
For the former, your give
<b>message:interface_name</b> ,etc
and for the payload part you give,
<b>Payload: "your element root which u wanna acecss"</b>
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.
Also, in your FILE Adapter under the option FILE CREATION MODE, you have options like,
1.Add Counter,
2. Append
3. Create
4. Add Time Stamp
If you have any clarifications on this approach, do get back.
Regards,
Bhavesh -
Unable to get Field Names from Archived File
Hi All,
We have a ECC 6 Ehp4 system. When i retrieve Idocs archived using SARA, the data only contains application data. There is no field names available - eg: posting date, tax code etc. Please find below the background on this issue.
I configured archiving of process idocs (status 52,12,03) from EDIDC tables. I set up the settings for Archive Object IDOC and archived the data for 15 days.
Both archiving and deletion of data from the table was successful.
I tried reading the Idoc data from Archive File using the Information System option -> Info structure (available as default for Idoc).
But the data retrieved only shows the Application data for all the segments of the IDoc. The fields for the segments like Tax Code, Posting Date etc are not available in the data. Functional teams will not be able to make sense with just the application data.
Am I missing some setting? Is there any way to retrieve the related field values also ?
Please help.
Thanks and Regards,
RaghavanHi All,
There is tcode WE10. You could choose if the data source is archive and also the archive session. You will get the list of segments provided. click on the segment number and you will get the data.
Thanks and Regards,
Raghavan -
Getting Package Name From Class File Without Parsing File
I am writing an application where I need to get the package name from a class file without parsing the class file itself.
Basically, what happens is the user chooses a class file from anywhere in the file system. I then want to use reflection to get information about that class. To do that I need the fully qualified class name. I know that the package name is part or all of the path name but I don't know for sure which part it is. I don't want to parse the class file directly for the package name in case the class file spec is changed (that way I won't have to rewrite any code).
Does Java have any way of getting this information without doing something stupid like gradually stripping off part of the pathname and trying it?The ClassLoader way seems to work fine, copy a class file to "A.class" and run this:import java.io.*;
class ClassLoaderExample {
public static void main(String[] args) throws Exception {
class MyClassLoader extends ClassLoader {
public Class load() throws IOException {
File f = new File("A.class");
byte[] classData = new byte[(int) f.length()];
new RandomAccessFile(f, "r").readFully(classData);
Class loaded = defineClass(null, classData, 0, classData.length);
resolveClass(loaded);
return loaded;
Class c = new MyClassLoader().load();
System.out.println(c);
System.out.println(c.newInstance());
} -
Getting component name from property file
Hi
I want to get names for components(say button or label) from property file. How I can achiev this.
second option is that getting names from database.
I want to know both the things
Can anybody help me in getting those names in both the ways. If anyone has sample code it will be really helpfull to me. :)
RajFileInputStream fin=null;
Properties property=new Properties();
try{
fin=new FileInputStream("myfile.dat");
property.load(fin);
fin.close();
}catch(Exception e){}Infact this is the simpliest way to load property from file. You should check if File exists or readable with catch block. I used Exception but you dont. If you are using an Applet it will be a little different. -
Getting Error while running a file adapter.
Hi all,
I am doing a small application where I need to read an image from a shared path and send the base64code of that image in response. For that I am using File Adapter and Read
operation. I have just hard coded the image name didnt give any wild card or expressions. I generated a service which is a proxy using the jca of that File Adapter. I added a stage
replacing the response body with the opaque element of the request body. When I run the proxy I am getting something like *"The invocation resulted in an error: "* in response
and in the stack trace I am getting *"Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body."* as the fault
reason I am unable to detect where exactly I am going wrong. Kindly help me in resolving this.
Thanks,
Phanindra.Not sure why you want to replace. Since the response of the proxy would remain to hold the request body by default.
If you have stored the opaque element in a variable ($var_opaque), then you can do the following.
XPath : .
In variable : body
Expression : $var_opaque
Check - "Replace node content" -
Dynamic File name in Receiver File adapter
Hi,
My Scenario is Proxy to File.
I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
How can i create a dynamic filename? i searched the forum, but i could not get the correct answer,
Please help me out.
Regards
SrinivasHi Srinivas,
> My Scenario is Proxy to File.
> I must create filename dynamically in the receiver file adapter by taking the sales order number and divison from the source.
public String targetFileName(String Sono, String Div, Container container) throws StreamTransformationException
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String MyFileName = sono + div + "<filename>"+".xml";
conf.put(key, MyFileName);
return MyFileName;
File name you can format according to your requirement.
And one more thing for this you have to specify the ASMA properties. For this check the below link step-1 and step-2.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Regards
Ramesh -
Reg: File name in receiver FILE adapter
Hi Experts,
i have Scenario proxy to file
from source side i got input values in one field(long String). in the target side i need to split that field
finallly i need get the out put file like this
q2344eretrnnsd sewewerereefre wereretrtrtreeterte ertrterwytdyt rtretyeytyutueyt
sdgfghfhyghhjhj sdfgfdhdghgjgjh sdfgdfhgfhjgjgjfgh dfgdhdgghgh dfghfgfgfgfgfgf
sfdggggggggddf sdfdfsddfdfdfdfd sdfdfdfdfdfddfdfs sdfsdfdfdsfd asdfsdafdsfds
the problem is while place file in the target directory the file need save as according to the "version no" (it is included in the long string of source field)
file name should be change according to the "version no"
so please suggset to me how can i change the file name according to the version no which is include in the long string in the source side
Thanks in advanceHi Mani kandan,
thanks for the reply can you please tell me one more thing in FCC
source side we have only one field which is long string so we need put the value of that field in to the below format in target location
source (field value==<line>sapsdnforumsprocessintigration</line>) ocurs multiple times
in target file it has to appear as in below format.
sap sdnforums processintegration
sap sdnforums processintegration
sap sdnforums processintegration
sap sdnforums processintegration
please suggest wat type of file cotent conversion parameter rquired to achive this in the receiver communication channel
Thanks in advance
Edited by: katakoti on May 17, 2011 8:44 AM
Edited by: katakoti on May 17, 2011 9:28 AM -
File name in sender file adapter
Hi,
Our ftp server is sending the file names as:
AP_INV_<i>nn</i>.XI.<i>sss</i>.<i>xxx</i>.D<i>yyyymmdd</i>.T<i>hhmmss</i>
where nn sss xxx yyyymmdd hhmmss are all variable. The only fix part is AP_INV_ & XI. I tried AP_INV_* but it does not work. I tried AP_INV_.XI... but it also does not work.
Any idea here please !!!!Hi Dehra,
Check these thread. It may help you:
File name modification in a File adapter
Regards,
Subhasha Ranjan
Maybe you are looking for
-
Does anyone know of any good accesories for the zen touch and which website i could find them on. Thanks
-
Additional standard text in Process order
Hi gurus I have a question. I have maintained a standard text in RECEIPE and the same gets copied into process order. In the process addionally i have added a standard text to an exting phase. But while printing the shop floor papers , the same is no
-
I used the Screen Saver window to setup Sleep Display in the upper left corner and clicked OK. Tested it - but would work. I do not have any add on programs. Thanks, Bob61
-
I have a tabular form in which I want a select list to auto submit. I have tried using OnChange but can't seem to get it to work. What would I need to change on this select list to get it to auto submit the tabular form for me? Thanks! Edited to add
-
To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html For further support, go to www.adobe.com/support/products