Problem in dynamically file name generation procedure
Hi All,
I had scenario where i need to generate target filename dynamically for that i'm using UDF mentioned in the below blog :
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
to generate filename for target file adapter.
UDF used:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "HeaderFieldOne");
conf.put(keyHeader1, a);
return "";
While giving filename in receiver file adapter what should be the filename given in receiver file communication channel?
Regards,
VKG.
Hi,
My scenario is asynchronus scenario. When i use that messaging tool i'm getting following error:
There was an error processing your request.
com.sap.aii.af.ra.ms.impl.app.AdminException: Reading Messages from Archive failed, due to: null
With the following stack trace:
java.lang.NullPointerException
at com.tssap.dtr.client.lib.protocol.Connection.(Connection.java:304)
at com.sap.archtech.archconn.UnqualifiedArchSession.(UnqualifiedArchSession.java:33)
at com.sap.archtech.archconn.ArchSessionFactory.getSession(ArchSessionFactory.java:62)
at com.sap.aii.af.ra.ms.impl.core.archiving.ArchivingJobController.getMessageBeans(ArchivingJobController.java:1380)
at com.sap.aii.af.ra.ms.app.ArchivingBeanImpl.getMonitorBean(ArchivingBeanImpl.java:171)
at com.sap.aii.af.ra.ms.app.ArchivingRIObjectImpl0_0.getMonitorBean(ArchivingRIObjectImpl0_0.java:868)
at com.sap.aii.af.ra.ms.app.ArchivingRI_Stub.getMonitorBean(ArchivingRI_Stub.java:1518)
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.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy348.getMonitorBean(Unknown Source)
at jsp_monitor1228729032638._jspService(jsp_monitor1228729032638.java:464)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
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:219)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Similar Messages
-
Dynamic file Name Generation-problem
Hi Friends..
in My Idoc to File..
i want to generate Dynamic File Name ..
i put the logic in Message mapping -java intialization section
Container container = null;
SimpleDateFormat simpledatFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date();
String datewithYear = simpledatFormat.format(date);
SimpleDateFormat simpledatFormat1 = new SimpleDateFormat("HHmmss");
Date date1 = new Date();
String datewithMs = simpledatFormat1.format(date1);
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 valueNew;
if( oldFileName == null){
valueNew = "HRXML"+datewithYear+datewithMs+".xml";
else{
valueNew =oldFileName+datewithYear+datewithMs+".xml";
//set the new filename
conf.put(key, valueNew);
and i did in reciever File adaper adaper specific settings..
i am getting error sxmb_moni..
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_ZHRMD5_to_HRMasterData_MM_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>java.lang.NullPointerException</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_ZHRMD5_to_HRMasterData_MM_: java.lang.NullPointerException</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
if we remove the dynamic File configuration logic in message mapping ..i am getting the result..
please guide me..Container container = null;
DynamicConfiguration conf = ((DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION));
bound to get a NPE as your variable container is not getting intialized to a valid object ref here... -
Strange problem in Dynamic File Name . XI behaving strangely
My o/p is coming like this
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_PurchaseOrderChange xmlns:ns0="http://E2open.com/xi/IntercompanySCM_6.0/POChange">
- <recordset>
- <data>
<PoHeaderDomainName>broker_domain</PoHeaderDomainName>
<PoHeaderOrgName>broker_org</PoHeaderOrgName>
<PoHeaderPoState>$null</PoHeaderPoState>
<PoHeaderStateChangeDate>$null</PoHeaderStateChangeDate>
<PoHeaderPoNumber>4500000026</PoHeaderPoNumber>
<PoHeaderPoCreationDate>$null</PoHeaderPoCreationDate>
<PoHeaderLastModifiedDate>$null</PoHeaderLastModifiedDate>
<PoHeaderModelSubType>Discrete_Order</PoHeaderModelSubType>
<PoHeaderSupplierName>0000352119</PoHeaderSupplierName>
<PoHeaderSupplierDescription>$null</PoHeaderSupplierDescription>
<PoHeaderCustomerName>SSP_CUSTOMER</PoHeaderCustomerName>
<PoHeaderCustomerDescription>$null</PoHeaderCustomerDescription>
<PoHeaderCustomerMessage>$null</PoHeaderCustomerMessage>
<PoHeaderSupplierMessage>$null</PoHeaderSupplierMessage>
<PoHeaderBillToName>$null</PoHeaderBillToName>
<PoHeaderBillToAddressDescriptor>$null</PoHeaderBillToAddressDescriptor>
<PoHeaderBillToAddressAddress1>$null</PoHeaderBillToAddressAddress1>
<PoHeaderBillToAddressAddress2>$null</PoHeaderBillToAddressAddress2>
<PoHeaderBillToAddressCity>$null</PoHeaderBillToAddressCity>
<PoHeaderBillToAddressCountry>$null</PoHeaderBillToAddressCountry>
<PoHeaderBillToAddressCounty>$null</PoHeaderBillToAddressCounty>
<PoHeaderBillToAddressState>$null</PoHeaderBillToAddressState>
<PoHeaderBillToAddressZip>$null</PoHeaderBillToAddressZip>
<PoHeaderBuyerCode>$null</PoHeaderBuyerCode>
<PoHeaderFreight>$null</PoHeaderFreight>
<PoHeaderTerms>0001</PoHeaderTerms>
<PoHeaderOrderPriority>$null</PoHeaderOrderPriority>
<PoHeaderCommunicationMode>$null</PoHeaderCommunicationMode>
<PoHeaderAgreementStartDate>$null</PoHeaderAgreementStartDate>
<PoHeaderAgreementEndDate>$null</PoHeaderAgreementEndDate>
<UDFPoHeaderRevisionNumber>$null</UDFPoHeaderRevisionNumber>
<UDFPoHeaderERPPOCreationDate>01Sep2006000000</UDFPoHeaderERPPOCreationDate>
<UDFPoHeaderheaderUDF1>$null</UDFPoHeaderheaderUDF1>
<UDFPoHeaderheaderUDF2>$null</UDFPoHeaderheaderUDF2>
<UDFPoHeaderheaderUDF3>$null</UDFPoHeaderheaderUDF3>
<UDFPoHeaderheaderUDF4>$null</UDFPoHeaderheaderUDF4>
<UDFPoHeaderheaderUDF5>$null</UDFPoHeaderheaderUDF5>
<PoLineItemPoLineItemId>00020</PoLineItemPoLineItemId>
<PoLineItemCustomerItemName>E107434516</PoLineItemCustomerItemName>
<PoLineItemCustomerItemDesc>L1357 TOROID INDUCTOR</PoLineItemCustomerItemDesc>
<PoLineItemCustomerDomainName>SSP_CUSTOMER_domain</PoLineItemCustomerDomainName>
<PoLineItemSupplierItemName>E107434516</PoLineItemSupplierItemName>
<PoLineItemSupplierItemDesc>L1357 TOROID INDUCTOR</PoLineItemSupplierItemDesc>
<PoLineItemSupplierDomainName>0000352119_domain</PoLineItemSupplierDomainName>
<PoLineItemUnitPrice>720</PoLineItemUnitPrice>
<PoLineItemBasisOfUnitPrice>$null</PoLineItemBasisOfUnitPrice>
<PoLineItemCurrency>EUR</PoLineItemCurrency>
<PoLineItemUnitOfMeasure>TNE</PoLineItemUnitOfMeasure>
<PoLineItemLineItemState>$null</PoLineItemLineItemState>
<PoLineItemStateChangeDate>$null</PoLineItemStateChangeDate>
<PoLineItemLastModifiedDate>$null</PoLineItemLastModifiedDate>
<UDFPoLineSupplierItemName>E107434516</UDFPoLineSupplierItemName>
<UDFPoLinelineUDF1>$null</UDFPoLinelineUDF1>
<UDFPoLinelineUDF2>$null</UDFPoLinelineUDF2>
<UDFPoLinelineUDF3>$null</UDFPoLinelineUDF3>
<UDFPoLinelineUDF4>$null</UDFPoLinelineUDF4>
<UDFPoLinelineUDF5>$null</UDFPoLinelineUDF5>
<PoScheduleId>1</PoScheduleId>
<PoScheduleLastAction>Insert_Or_Modify</PoScheduleLastAction>
<PoScheduleScheduleState>$null</PoScheduleScheduleState>
<PoScheduleStateChangeDate>$null</PoScheduleStateChangeDate>
<PoScheduleRequestQuantity>9.000</PoScheduleRequestQuantity>
<PoScheduleRequestDate>16Sep2006000000</PoScheduleRequestDate>
<PoScheduleRequestShipmentDate>16Sep2006000000</PoScheduleRequestShipmentDate>
<PoScheduleOriginalRequestQuantity>$null</PoScheduleOriginalRequestQuantity>
<PoScheduleOriginalRequestDate>$null</PoScheduleOriginalRequestDate>
<PoScheduleCarrier>$null</PoScheduleCarrier>
<PoScheduleCarrierMode>$null</PoScheduleCarrierMode>
<PoScheduleCarrierAccountNumber>$null</PoScheduleCarrierAccountNumber>
<PoScheduleCustomerSiteName>5302</PoScheduleCustomerSiteName>
<PoScheduleShipToAddressDescriptor>$null</PoScheduleShipToAddressDescriptor>
<PoScheduleShipToAddressAddress1>$null</PoScheduleShipToAddressAddress1>
<PoScheduleShipToAddressAddress2>$null</PoScheduleShipToAddressAddress2>
<PoScheduleShipToAddressCity>$null</PoScheduleShipToAddressCity>
<PoScheduleShipToAddressCountry>$null</PoScheduleShipToAddressCountry>
<PoScheduleShipToAddressCounty>$null</PoScheduleShipToAddressCounty>
<PoScheduleShipToAddressState>$null</PoScheduleShipToAddressState>
<PoScheduleShipToAddressZip>$null</PoScheduleShipToAddressZip>
<PoScheduleLastModifiedDate>$null</PoScheduleLastModifiedDate>
<PoScheduleCustomerMessage>$null</PoScheduleCustomerMessage>
<PoScheduleSupplierMessage>$null</PoScheduleSupplierMessage>
<PoScheduleRefdPoCustomerName>$null</PoScheduleRefdPoCustomerName>
<PoScheduleRefdPoS>$null</PoScheduleRefdPoS>
<PoScheduleRefdPoModelSubType>$null</PoScheduleRefdPoModelSubType>
<PoScheduleRefdPoNumber>$null</PoScheduleRefdPoNumber>
<PoScheduleRefdPoLineItemId>$null</PoScheduleRefdPoLineItemId>
<PoScheduleRefdPoScheduleId>$null</PoScheduleRefdPoScheduleId>
<UDFPoSchedulescheduleUDF1>$null</UDFPoSchedulescheduleUDF1>
<UDFPoSchedulescheduleUDF2>$null</UDFPoSchedulescheduleUDF2>
<UDFPoSchedulescheduleUDF3>$null</UDFPoSchedulescheduleUDF3>
<UDFPoSchedulescheduleUDF4>$null</UDFPoSchedulescheduleUDF4>
<UDFPoSchedulescheduleUDF5>$null</UDFPoSchedulescheduleUDF5>
<PoPromiseScheduleId>1</PoPromiseScheduleId>
<PoPromiseScheduleAddressDescriptor>$null</PoPromiseScheduleAddressDescriptor>
<PoPromiseScheduleAddress1>$null</PoPromiseScheduleAddress1>
<PoPromiseScheduleAddress2>$null</PoPromiseScheduleAddress2>
<PoPromiseScheduleAddressCity>$null</PoPromiseScheduleAddressCity>
<PoPromiseScheduleAddressCountry>$null</PoPromiseScheduleAddressCountry>
<PoPromiseScheduleAddressCounty>$null</PoPromiseScheduleAddressCounty>
<PoPromiseScheduleAddressState>$null</PoPromiseScheduleAddressState>
<PoPromiseScheduleAddressZip>$null</PoPromiseScheduleAddressZip>
<PoPromiseScheduleQuantity>9.000</PoPromiseScheduleQuantity>
<PoPromiseScheduleDate>16Sep2006000000</PoPromiseScheduleDate>
<PoPromiseScheduleShipmentDate>$null</PoPromiseScheduleShipmentDate>
<UDFPoPromiseScheduleUDF1>$null</UDFPoPromiseScheduleUDF1>
<UDFPoPromiseScheduleUDF2>$null</UDFPoPromiseScheduleUDF2>
<UDFPoPromiseScheduleUDF3>$null</UDFPoPromiseScheduleUDF3>
<UDFPoPromiseScheduleUDF4>$null</UDFPoPromiseScheduleUDF4>
<UDFPoPromiseScheduleUDF5>$null</UDFPoPromiseScheduleUDF5>
</data>
- <FileNameNode>
<FileName>111111111_222222223_purchase-orders_20060901065147_</FileName>
</FileNameNode>
</recordset>
</ns0:MT_PurchaseOrderChange>
I have specifed
Payload:MT_PurchaseOrderChange,1,FileNameNode,1,FileName,1
in variable substitution
I am on SP 14 and it the dynamic file is working for other scneario
bt in this scneario i am getting the error
Receiver Adapter v2405 for Party '', Service 'com_E2open_qas':
Configured at 2006-09-01 18:42:32 GMT+05:30
History:
- 2006-09-01 19:11:48 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
- 2006-09-01 19:11:48 GMT+05:30: Processing started
- 2006-09-01 19:06:47 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
- 2006-09-01 19:06:47 GMT+05:30: Processing started
- 2006-09-01 19:01:47 GMT+05:30: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: amit
amit is the variable i have given for substitution.Hi,
if you have SP14 stop using variable substitiuion:)
you can do it much easier with dynamic configuraiton
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
so you can easily set it for file adapter to set the file name
you can also have a look at my weblog:
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
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> -
Problem in dynamic file name in File reciever adapater
I have given my file name as
%abc%.txt
and in the advanced mode
i have given
Additional parameters as
abc=
payload:file_reciever_mt,1,FileNameNode,1,FileName,1
while my file reciver structure is
<?xml version="1.0" encoding="UTF-8"?>
<ns:file_receiver_mt xmlns:ns="urn:filetofiledemo"><recordset><data><name></name><age></age></data></recordset><FileNameNode><FileName>Amit123</FileName></FileNameNode></ns:file_receiver_mt>
My file is getting store as %abc%.txt
not as Amit123.txt
I am using SP 14 .
Any pointers wld be very helpful
Thanks
AmitHi Amit,
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.
Apart from my previous post, you can also use Adapter Specific Identifiers in your Sender and Receiver File Adapters to copy the same file name from the source to the target.
take a look at this blog for the same,
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
-- Bhavesh
cheers,
Prashanth -
Hi Experts,
i have the requirement
I need to extract some records from Database (Scenario is Database to file) and we need to put it into file.
then i need to change the file name based on certain conditions and send it to relevent file server which are globally located across the world.
My Doubts are :-
1- After extracting the records from Database From where i can get file name?? Can i get the file name from SXMB_MONI. If yes then How??
2- Now I got the file name then i need to change this file name into different file names (Dynamically) based on some conditions to send it to different file servers. Can i do it in my mapping Or i need to write a module for it.??
Thanks in Advance
Regards PrajwalHi Naluvala,
Based upon your condition you can directly set the file name using this UDF:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(
u201Chttp://sap.com/xi/XI/System/Fileu201D,
u201CFileNameu201D);
String valueOld = conf.get(key);
if (valueOld != null) {
String valueNew = valueOld.replaceAll(u201Cinputu201D,u201Doutputu201D);
conf.put(key, valueNew);
Instead of using get function to populate the valueOld, you can use your own logic.
Regards,
Sanjeev. -
Dynamic file name in case of .txt output files
Hi all,
I have a query related to dynamic file name scenario.
In case of IDOC-XI-FILE sceanrio,
<b>Is it possible to generate .txt file name based on Plant number like</b>
<b>%<Plantname>%_%<BusinessDay>_filename.txt</b>
<b>Note:I have implemneted this for .xml output files but I am not able to implement it for .txt output files .</b>
PLEASE HELP ME .
Regards
PrabhatHi Prabhat,
I think, the normal Dynamic File Name generation should work fine in your case also. Even if you perform Content Conversion, you can use Variable Name Substiution to create your Destination file name as, the name of the file is determined first and only then is the content converison perfromed.
for info on content conversion, I would suggest that you go through this thread and check my reply,
Re: Dynamic File Name for Receiver File Adapter
Regards,
Bhavesh -
Dynamic File Name depending on the Source File name
Hi Experts,
I have a problem like Dynamic File name depending on the Source File Name. I will explain with example as follwos
Source File name Targer Folder/Filename
NK01.VR59.L2007030 VR59/Rec.l200
NK01.VR71.L2017030 VR71/Rec.l201
NK01.VR77.L2027030 VR77/Rec.l202
See above the exaple, Depending on the Source file name, I am deciding where i need to place my file and what name i need to name it.
So please suggest me the solution and How can i do this with a single communication channel ? Do i need to create multiple CC for each folder??
Points will be rewarded for Valuable anwer.
Thanks in Advance,
Best Regads,
VijayHi VIjay,
Thanks for quick reply. But i am getting error in End to End Scenarios only. If i remove the Return " " statement from the UDF, while activating it is showing the error saying like missing return statement. I also mapped to the top most node to this UDF.
I am getting the following error in End to End error Scenarios:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MM_Target_File_determined_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>During the application mapping com/sap/xi/tf/_MM_Target_File_determined_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error> -
Dynamic file name in communication channel
hello
is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
to get it out of a table or something?
Thanks
KfirHi,
Yes its bit possible to use the dynamic file name at File access paramters
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,
Refer below links for more in depth details about it
Re: Dynamic file name in Receiver File Adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check out this URL
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Check these weblogs as well...
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
Thanks
Swarup -
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 -
Xml file in dynamic file name in file receiver adapter
Hi,
I'm doing the dynamic file name in file receiver adapter. I have done as per instructed in /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
All turned out okay. I have got the file name I require. Except that the file format is XML and I need to suppress the filename node occupied by the dynamic file name.
The content conversion mentioned in /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12, does not seem to solve my problem. As it is only for file format other than the XML one, because we only do the content conversion if we want to "convert" the format of the content from XML to the other format.
Does anybody have the solution to my problem? thanks in advanceThank you Raj for the direction
The way to do it is :
1. In ID, advanced tab, put a check on the adapter-specific message attributes - file name.
2. Put a "*" on the file name scheme
3. In IR, create a UDF to set up target file name :
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// set up file name for receiver adapter
String SourceFileName = conf.get(key);
conf.put(key, TargetFileName);
return " ";
4. Map the above UDF to the header level of the target structure.
Regards,
Idi -
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. -
How to give a dynamic File Name for Receiver File/FTP Adapter.
Hi Experts,
I have one scenario in which we are creating a flat file of IDOC which is coming from R/3 & sending it to FTP location. For this we have configured Receiver FTP adapter with File Name Scheme as "NT.out" & in File Consturction mode i have given as "Add Time Stamp".
therfore while creating a file it is creating as NTyyyyMMdd-HHmmss-SSS.out
where as my requirement is only to to add Time & not the Date. (NThhmmss.out)
How to do this ?
for your info we are using ABAP Mapping.
Pl help me
Regards,
UmeshHi Umesh,
Add one more field to your target structure for your file name and populate that field as per your requirement like NTyyyyMMdd.out. In receiver communication channel use Variable subtiution option and give the refrence of Payload and file construction mode set as create.
And refer the below weblogs for Variable Subtiutuion File Name Scheme
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
Hope this way would be solve u r problem.
Cheers
Veera
>>>Reward points, if it is needful -
Dynamic file name(Context)
Hello All,
I am using Dynamic file name function in my message mapping. Below is the code that I am using inside UDF:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String fileName = conf.get(key);
return fileName;
Now the questions is as per my requirement, I need to generate multiple file names. Can some one help me how can change the above code for catering multiple returns
Thanks
Regards
MoorthyHello,
Now the questions is as per my requirement, I need to generate multiple file names. Can some one help me how can change the above code for catering multiple returns
If you are using multi-mapping (0..n), only one will be accessed. See link below from SAP Help
http://help.sap.com/saphelp_nw70/helpdata/EN/43/09b16006526e72e10000000a422035/frameset.htm
Or you can use variable substitution for filename generation (search in SDN).
Hope this helps,
Mark -
How to handle Dynamic File Name
Hello All,
I have a requirement, I have to download a file from application server to my ABAP program which will be executed in the background. The problem is the file name is a dynamic file name with timestamp on it. So how do I read the file from the application server. I know there are certain function modules but I don't think so that they can work in background.
So If anyone has worked on it before your reply would be helpful.
Thanks and Regards,
SushilHi,
Use this funcation module this will return you the list of files in a directory...
It will work even in back group processing also..
SUBST_GET_FILE_LIST
or if it is unix environ ment.
data: begin of t_tabl occurs 0,
line(132),
end of t_tabl,
data: lc_command(100) type c.
Get all the file name falling under specified directory...
lc_command(3) = 'ls '.
lc_command+3(45) = p_dir. " Directory of file path
call 'SYSTEM' id 'COMMAND' field lc_command
id 'TAB' field t_tabl-sys.
Check any files exits in the directory.......................
if t_tabl[] is initial.
message e006 with 'No files exist in the specified directory ' p_dir.
endif.
here you will have all the file names in t_tab1 you can sort by name and will get the latest file in order..
Thanks
Mahesh
Message was edited by:
I Can Solve It -
Dynamic file name from input payload (RFC 2 flat file)
Hi,
I have an RFC to flat file scenario. The output flat file has not an XML structure, it's just a plain text file generated with abap mapping.
In my source interface (RFC), I have a field called <FILENAME>, I want to use the value of that field to create the target file using dynamic file name. But if in variable substitution I use payload:ZRFC_NAME,1,FILENAME,1 It doesn't work because the dynamic variable substitution try to access to output payload, not the source one...
What can I do?Hi Marshal,
You can add a extra node to your target strucutre like
FileName- Node
--FileName - Element.
do the mapping from the field filename of RFC to FileName field in u r target strucure. And use this field path at Refrence in variable subtituion.
In the Content converison add the Name & Values as below
FileName.fileldNames -- FileName
FileName.fieldFixedLengths -- 0
FileName.fixedLengthTooShortHandling -- Cut
So the extra field in u r target structure would not populate in u r target text file.
Cheers
Veera
Maybe you are looking for
-
Commitment only after release of purchaseorder
I'm investigating the possibilty that commitments are only registrered when a purchase order with release strategy is released. is it possible to have no commitments of a purchaseorder until release ?? I have found this thread which is about the oppo
-
Okay, so right now, my laptop and my ipod are a whole host of problems now. My laptop is refusing every attempt i make to make it work again. At first, i was trying to fix my ipod, it was basically just a complete restore since it wasn't being very n
-
To whom it may concern, I'm currently trying to log in to the Firefox Sync and according to your systems, this SYNC Key is not a good key. The left side of your screen is the saved copy of the Key when I have re-created one. Please verify the server
-
Error : No data read for fiscal year 2006 (error FDBL020)
Hello ! I have a problem in transaction FS10N, when i am trying do execute appear the error: No data read for fiscal year 2006 (error FDBL020), i tried applying the note 302263 (deleting the attributes of programs)but the attributes has been deleted
-
IN OUT PObject parameter not updated
Server and client: 11.1.0.6 linux 32 bit, connecting with via a ConnectionPool. I'm passing a PObject parameter to a procedure as an IN OUT parameter. The object is passed in OK, but it appears that none of the object attribute modifications that the