Dynamic Configuration-File to File in scenario
Hi Experts,
As per the requirement needs to supress the numeric extensions of the files and transfer to the receiver.
Example: file name is XXX123.txt , but after picking up by sender communication channel in XI that file needs to converts XXX.txt and transfer to the receiver. Finally in the receiver end the file name should be Mahesh.txt only.
Please share the inputs how to do dynamic configuration in XI in File to File scenario.
Hi,
First you need to have a UDF as shown below. No need to put any arguments in the UDF.
public String getFileName(Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
//get file name in string s
String s = conf.get(key);
//remove all numeric values
int i,l;
l=s.length();
String a="";
for(i=0;i<l;++i)
if(s.charAt(i)>='0' && s.charAt(i)<='9')
continue;
a=a+s.charAt(i);
s=a;
conf.put(key, s);
return s;
Now you need to map this UDF to any root element or dummy element of the target XML structure.
Ensure that
1. Sender Comm Channel has ASMA and file name ticked
2. Receiver Comm Channel has ASMA and file name and "fail if ASMA missing" ticked
3. in receiver communication channel -> File access parameters-> File name scheme -
> put any value say "*". This step is not compulsory.
Hope this solves your problem.
regards
Anupam
Similar Messages
-
Doubt om Dynamic Configuration of receiver file
Hello ,
for Acheiving the Dynamic configuration of receiver file name ,adapter specific message attribute is used...But how to suppress the name of file in the content of the Received file...
Is my question correct..do we get the file name in content of the receiver file,while using the Adapter specifc message attribute.
And another question ,in the Variable substitution ...do we get the above problem,then how to tackle the situation to suprress the file name in the payload of receiver file.HI,
You can handle the dynamic file name via Dynamic configuration or with the help of Variable Substitution.
Please refer
have a look
Dynamic File Name using XI 3.0 SP12 Part - I --> Dynamic File Name using XI 3.0 SP12 Part u2013 I
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II --> Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
With Variable Substituion, you may need to supress the filename
Dynamic File Name - Suppress the Substitue varible
Let me know if you need anymore info.
Thanks
Swarup -
Dynamic Configuration for two file adapters communication channels
Hello Experts!!!!!!
In one of the interface in my landscape, I am using two file adapters for creating two files with different names and at two different destination on F.T.P.
However the receiver service for both the communication channel are same.
In message mapping I am using multi mapping to create two files out a single message.
Now i have a requirement of changing file path and file name using dynamic configuration for both the comm channel.
When i doing dynamic coniguration for both the comm. channel. My interface is creating two files but with same name and on same destination which is set for second communication channel through dynamic configuration.
Here, I guess the second dynamic configuration is over writing the first dynamic configuration and hence creating two files with same name and at same destination.
Please suggest, if separate dynamic configuration for separate communication channel of same receiver service can be done?
Thanks & Regards,
AmolThanks for your prompt responses!!!!!
Is there any way, By which in dynamic configuration I can find out the communication channel name and then change its parameter.
I mean if iam using say comm. channel A and B.
Then in dynamic configuration for A, I will first take communication channel A by calling it and then change its path/file name.
and then do samething for comm. channel B in its dynamic conf.
Regards,
Amol -
Dynamic configuration for multiple files
Hi All,
I am new to PI. I have a proxy to file scenario, wherein 3 files are to be generated depending upon the value in a field (site ID) on the same receiver. Site ID can only have 3 different vales. All these 3 files are to have a dynamically defined name.
How can I configure this scenario? Is there any way in which all 3 files can have dynamically defined names? Please help.
Regards
Vipulif you have only one recored (one site id) in proxy at a time, thn u can write a UDF for dynamic file name..
// UDF: public String SetFileNameDyn(String siteID, 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 = "";
if(siteID.equals("firstValue")){
myFileName = "FirstFile1";
}else if(siteID.equals("secondValue")){
myFileName = "SecondFile2";
}else if(siteID.equals("thirdValue")){
myFileName = "ThirdFile3";
conf.put(key, myFileName);
return myFileName; -
Problem:obtaing file name using Dynamic configuration of file adapter
hi all
I am using Dynamic configuration for getting file name.
I am getting Dynamic configuration in SXMB_MONI containg file name, but payload is empty unlike file i am sending.Hi All,
Basically my requirement to get Filename in idoc segments in order to validate the posting at month end.
Its an File to idoc scenario- GL Posting.
Please check attached UDF and it gives error. Kindly help. Thanks -
Dynamic Configuration - Set Directory Path for File Receiver Adapter
Hi Experts,
I have a question regarding the dynamic configuration for the file adapter. Is it possible to set a directory path without a message mapping for the file receiver adapter? the problem is that I want to import a pdf document. this pdf document I want to store in a dynamic directory (depending on the filename). so I have to read the filename out of the dynamic configuration and generate (depending on the filename) a directory for this file. Is that possible without a message mapping? I cannot make a message mapping because the file has the pdf format and should not get changed.
best regards
Christopher KühnHi Gaurav,
I use the ASMA (respectively the filename) for the sender adapter. After the pdf was imported into XI this filename is in the ASMA.
But what then??? How can I get this filename with the help of the variable substitution? and if I have this filename I have to change this filename a bit to generate the name / path of the directory.
Please explain it to me detailled
Thanks and regards
christopher -
Multimapping and dynamic folder selection for files
Hi SDNers,
I have a requirement where I need to split the message in multiple messages, I am using 1:N Multimapping for this.
Also I need to use dynamic configuration to route the separated files to multiple folders based on place field in the message.
When I am using Dynamic configuration the splitted files are all getting created in one directory instead of multiple directories.
The requirement is that if place field has value india then the file having value as INDIA should be placed in folder INDIA, if place is UK then that file should be placed in folder UK
Can anyone please help me on how to achieve this?
Regards,
Gautam PurohitAs far as I know this is not possible, since bulk message will be delivered to Adapter Frame Work (AFW). AFW delegates each message from bulk message.
Try using Variable substitution, but I am not sure if it works.
May be you need a BPM to achieve this. But this will cause performance.
Regards,
Praveen Gujjeti.
Edited by: Praveen Gujjeti on Apr 6, 2010 8:11 PM -
Hi Experts,
I am doing a pass through scenario (i.e. ICo) without any ESR objects and I want to add time stamp to the file name at receiver side.
Could you please help me in doing this via Dynamic Configuration Bean?
What I also want to do is to replace file name with interface name through dynamic configuration bean using File adapter in receiver side.
But instead of getting the interface name in place of file name I am getting "message.interface" as file name. I have also used
variable substitution in receiver channel along with ASMA attributes.
Please suggest where I am wrong.
Thanks,
AamirHi Aamir,
We are using only one Module :"AF_Modules/DynamicConfigurationBean" with the type "Local Enterprise Bean" and the system proposes a Module key.
In the above screen shot Module key "1" works as "getFileName" and Module key "2" works as "setFileName" .
Coming to Module configuration for Module key "1" we are providing the Parameter name as "key.1" and Parameter value as :"read http://sap.com/xi/XI/System/File FileName" this value reads the FileName and and repalces the FileName with Interface name based on the Parameter value as "message.interface" (attribute used to fetch the corresponding Interface Name) for Parameter name "value.1".
Module key "2" we are providing the Parameter name as "key.2" and Parameter value as :"write http://sap.com/xi/XI/System/Messaging interface" this value writes the FileName by calling the module.
I have worked with this Dynamic Configuration Bean in both File and SAP SFTP Adapter in SAP PI 7.3 in case of SFTP Adapter we need to follow the following steps.
Thanks
Durga -
XSL mapping with Java enhancment PI 7.1 - Dynamic configuration
Scenario - IDOC -> File
XSL Mapping using dynamic configuration to set file name.
1. Ive included
xmlns:javamap="java:packageName.DynamicFunctionClass">
in the XSL header
2.Ive call this method javamap:transform($input, $output)
In the Java code.
1. Package = packageName
2. Class Name = DynamicFunctionClass
3. Class Compiles and I have uploaded into the ESR for a particular scenario. (source and class)
4. extends AbstractTransformation and implements the transform method.
public class DynamicFunctionClass extends AbstractTransformation{ .....
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
ISSUE -
Essentially it looks as though PI cannot see the class file or is not able to reference it. I have created a static method in the class as well to access and this does not work.
TRACE -
Resource not found META-INF/Services/javax.xml.parsers.SAXParserFactory Thrown:
com.sap.aii.ib.server.mapping.execution.MappingClassNotFoundException:Ive stumbled across the fact that JDK 1.5 does not allow for Mapping with Java enchanment it is a feature only in SAPXMLTOOL kit, I shall tick the little box in the Operational mapping ...
-
Hi experts,
i have a file to file scenario. The third party wants the IDOC data as a IDOC file. So we have created file port and posting the idoc to that file port which creates file in the application server. here is my doubt when it comes to PI design.
requirement: the file name in ECC app server will be name1_<idoc no>. at third party it should be name2_<idoc no>. no data transformation is needed.
design 1: creating java mapping and do the dynamic configuration for the file name using dummy message types.
design 2: there is a adapter module provided by SAP which converts idoc text file to XML and vice versa. use that module and get the XML, do one to one mapping, using UDF change the file name by dynamic configuration. in message mapping we can import the idoc structure.
Please advice me which is effecive one in all aspects like performance, cost etc..
Thanks in advance,
--NareshHi Ravi,
refer the comments title SERVICE PACK in the below blog.
/people/william.li/blog/2009/04/01/how-to-use-user-module-for-conversion-of-idoc-messages-between-flat-and-xml-formats
-->The link which i provided is just expains about how to convert IDOC into either .txt and xml and how PI can handle them by using the standard module provided by SAP.
anyways Ravi......i think i am diverting the actual thread question....... ................................
also thanks for the PI7.3 link )
Thanks
Edited by: pavan kumar on Jul 28, 2011 11:41 PM -
Variable Substitution and Dynamic Configuration
Hi All,
In Variable Substitution , the name that should be given the the receiver payload should be part of the Source Payload unlike the Dynamic Configuration wherein the file name can be generated dynamically during mapping.
I have the following questions
1.Dont we need to write the UDF for the Variable substitution?
2.Cant we do the Dynamic configuration without writing UDF?If so then how?
3.In Dynamic Configuration the file name is generated dynamically.But where does the file name come from if it is not the part of the source payload?
Thanks in advanceHi Shwetha,
1.Dont we need to write the UDF for the Variable substitution?
No. Here we are accessing the contents of the payload to the target. So no UDF required.
2.Cant we do the Dynamic configuration without writing UDF?If so then how?
Yes and No.
Because we can set only few Dynamic configuration values without UDF.
If both source and target are File, then check ASMA on both sender and receiver. Then u can get the source directory name and source file name for target also without any UDF.Also some other parameters.
3.In Dynamic Configuration the file name is generated dynamically.But where does the file name come from if it is not the part of the source payload?
The file name comes along with the source in the payload as a attribute in header. U can view this in SXMB_MONI, and Dynamic Configuration.
In Dynamic Configuration the file name is generated dynamically.
No the file name is taken as it is from the source, if u want to change dynamically that u have to do in a UDF.
I hope this will clear all doubts,
If nt pl post
Babu -
Dynamic Configuration File Names
Hi,
I have a RFC->XI->File scenario.
I have to put the target files names based on the calculation of values in 2 fields in the input.
I tried using Dynamic Configuration in my message mapping for this.
This is the code:
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
String MyFileName = a + "_" + b +".xml";
conf.put(key, myFileName);
I checked ASMA in both the sender RFC adapter as well as the receiver file adapter.
But it never works.
I saw the dynamic configuration tab in SXMB_MONI but i can see only the RFC destination parameter.
Cant see the file filename parameter.
What is the problem here?No need enable ASMA on RFC sender adapter.
See if the file channel is activated after selecting ASMA with FileName.
The UDF might not be use in the mapping. Check this.
Edited by: Praveen Gujjeti on Feb 23, 2010 1:05 AM -
File name cant be fetched from Dynamic configuration...mutli-mapping used
In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration.....
the problem is ...the same BPM contains another transformation step which contains a message mapping (which is not multi mapping), and here the code (UDF) works to fetch the file name...
the code is all correct....and it looks like
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String sourceFileName = conf.get(key);
if (sourceFileName == null ){
sourceFileName = "ErrorFile.xml";}
return sourceFileName;Hi,
Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
It will throw Exception..
The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
If u r doing for file to file means no UDF required,, just check ASMA on both sides....
Babu -
Dynamic configuration- Is file name stored in any abap table in PI
Hi.
Is there any ABAP table in XI containing the dynamic configuration's xml of a message.
For any file scenario Can I get the file name from any of the abap table in PI
Regards,
DeepakInteresting ABAP tables in XI
Interesting ABAP tables in XI Part I
Regards,
Phani -
Receiver File Error while using Dynamic Configuration
Hi All,
My Scenario is from SAP IDOC --> PI --> FIle...
In the mapping i have used the dynamic variable substitution for the receiver file....
The Dyanamic file will be alwasy generated irrespective of the condition for the Mapping...
Now Whenever SAP sends IDOC then file to be created . If the condition is met then there is no problem the file is being created...
But if condition is not met then the error is being thrown in the Communication Channel...
Error occurred while connecting to the FTP server "10.1.999.222:21": java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'
Note the payload has the dyanmic file generated....
And when i tested the mapping by coping the payload then
I am getting the target with empty ...but with MT_ProductMaster node...
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ProductMaster xmlns:ns0="http://xyz/Ix_ProductMaster/WMS"></ns0:MT_ProductMaster>
and the error i think bcz of this payload ... but i dont have any option to remove this .... because if condition not met then the root node always will be created...
In CC File Content conversion i have given like this
Record setStructure FileHeader,FileDetail,FileTrailer
FileHeader.fieldSeparator |
FileHeader.endSeparator |'nl'
FileDetail.fieldSeparator |
FileDetail.endSeparator |'nl'
FileTrailer.fieldSeparator |
FileTrailer.endSeparator |
and my MT structure is
MT_ProductMaster 1.1
FileHeader 0...1
FileDetail 0....unbounded
FileTrailer 0...1
Please help me on how to ignore the empty root node... do i need to handle something else???
Regards,
Sridhar ReddyHey
Record setStructure FileHeader,FileDetail,FileTrailer
FileHeader.fieldSeparator |
FileHeader.endSeparator |'nl'
FileDetail.fieldSeparator |
FileDetail.endSeparator |'nl'
FileTrailer.fieldSeparator |
FileTrailer.endSeparator |
and my MT structure is
MT_ProductMaster 1.1
FileHeader 0...1
FileDetail 0....unbounded
FileTrailer 0...1
of course you will get error in content conversion if file is missing any of the parameters expected by FCC.
Right now the Content conversion is expecting several values in your payload(even if blank values) but you don't have any of them hence you get this error.
If you want to deliver empty file,you need to map all the receiver side nodes to some default,so that it is populated to that default (could be blank) if no values are present,then when this comes to content conversion,it will assume the blank value as node and do correct conversion.
If you dont have values in payload but have specified parameters for it on content conversion,then you will get errors as you mentioned in your first post.
Thanks
Aamir
Maybe you are looking for
-
I currently have a package that generates SSRS reports as PDF's and emails them to our clients. When this task is complete we currently have to manually run and print a report with list of reports sent. Is there a way from within SSRS to print the re
-
IPhone not showing up in Image Capture
My iPhone 6 isn't showing up in Image Capture. I wouldn't care but the app launching every time I plug the phone in is driving me crazy. But to stop that from happening I need to select my device from the list on the left in the app -- only it's not
-
Publising Error Unable to use iWeb to post photos
I had no problem posting my images to my web page using iphoto ie http://homepage.mac.com/michaelcampbellphoto/Menu172.html But since upgrading to te latest and greatest ! I have not been able to publish my images I have tried a dozen times and each
-
Hi.. have a little Web-Project (in Eclipse with Sun Application Server 9.1_01) for Persistence i Use Toplink. All work fine, until i change a jsp for example and eclipse do a redeploy. After this Redoploy i got the following error: [#|2008-03-03T16:3
-
Styles for graphs and charts?
Hello, I am trying to find out if there is a way to save a graph style, as you would do a paragraph style. This is mainly due to the fact that I need to create about 250 charts in illustrator, and I would really appreciate if I could automate some of