File name in mapping
Hello,
How can I get file name in mapping.
Regards
Hello ,
I have tested while running the scenario
but I am getting below mapping error
For my message mapping --- FileName_Src_To_FileName_Trg_MM
I have src Message Type which has one node -- FN of type String
I have Target Msg Type which has one node -- FN of type String
I have used my dynFileName function betwwen src node and target node
I am getting the error below for 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/_FileName_Src_To_FileName_Trg_MM_</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/_FileName_Src_To_FileName_Trg_MM_ 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>
Similar Messages
-
Creating dynamical flat file name in mapping?
Hi.
I know about the variations on how to use an input parameter and/or sysdate to create a dynamic output file name in a mapping.
My challenge is nearly the same, but I cannot make OWB generate the correct code.
Problem:
- got a one column table that holds an identifier in a string field
- got a function that reads and returns said identifier
- imported function into OWB
- trying to use the function call in the Flat File Operator's Target Data File Name, e.g. fixedfilename||fn_get_id()||sysdate||'.ext
OWB creates the code:
UTL_FILE.FOPEN(
'my_location',
'fixedfilename'||fn_get_id()||'_'||SYSDATE||'.ext',
'w',
32767
However, when compiling the package code, it returns the warning:
ORA-06550: PACKAGE BODY, line 2214, column 29: PLS-00201: identifier 'FN_GET_ID' must be declared
which results in an error when trying to execute the mapping.
I've tried substituting the function call in the FOPEN call:
myId := fn_get_id();
UTL_FILE.FOPEN(
'my_location',
'fixedfilename'||myId||'_'||SYSDATE||'.ext',
'w',
32767
and this works fine, the mapping creates a file with the desired filename. But obviously not a good solution rewriting the generated code all the time....
Anyone solved something similar?
Could I use an input parameter and the autogenerated function GET_<PARAMETER>?
But can I set the value of an input parameter inside the very same mapping?
Regards,
-Haakon-(It always helps writing out one's problems...)
I managed to get it working :-)
Added an input parameter to the mapping, and gave the outgroup variable a default value by calling my imported function.
Then concatenated the implicitly generated function (GET_PARAMETER) in the Target Data flat file name.
I now have a target file name that changes according to a departement id stored in a parameter table.
Regards,
-Haakon- -
How to get the Received File Name(using FILE.ReceivedFileName property) in BizTalk Map. Kindly provide with suggestions.
Regards, Vivin.try this
http://blogit.create.pt/blogs/tiagooliveira/archive/2009/02/02/Using-xpath-function-in-orchestrations.aspx
xpath(msgOut,"string(xpathquery)")=msgIn(FILE.ReceivedFileName)
You can't promote that field which occurs multiple times so in that case we use xpath()
Regards -
UDF to read a file name and use some of its contents to map fields in target.
I have a scenario where I need to take the month and year from the file name and map it to suitable fields in the target. Ex - filename_apr2014 from this i should be able to read the month and year and map it. How to do this? I tried the udf -
public String getFileName(Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
got this error while testing the mapping -
Runtime exception when processing target-field mapping /ns0:MT_<<>>_Output/I<<>>; root message: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.mapping.api.DynamicConfigurationKey) of a null object loaded from a local variable at slot 2] in class <<>> method getSourceFileName[com.sap.aii.mappingtool.tf7.rt.Context@5b04fc0f]
See error logs for detailsHi Satish - You declared "conf" twice.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
UDF -
String filename = "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = conf.get(key);
return filename;
And did you define the variable slot 2 in any of your UDF's?
The above UDF return the filename and you should handle the sub string later.. -
How do I map the source file name to a target table?
I am mapping a source fixed length flat file to oracle target tables. One of the tables is a parent transaction table that stores the date, record number, status, etc. and the file name of the source flat file. The file name will change daily because the date is part of the naming convention. Is there an easy way to determine the source file name and map it?
One option a co-worker is working on is writing a pre-mapping stored procedure. It would insert the file name into a table prior to the mapping. But I was hoping for a cleaner solution.
Thanks!Hi
Use extarnel table to load the data from the file into the table.
Create a procedure which changes the external table definition as the filename chnages.
Use this proceudre in the mapping as a premapping process.
Ott Karesz
http://www.trendo-kft.hu -
Setting dynamic file name in Receiver file adapter - not from payload
Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
Please let me know if you remember this.
Thanks a lot,
Viktor Vargaalso u can check in
<a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a> -
Flat file name from Sender Side Dynamically into subject of Receiver Mail
Hi All,
I am Using a file to Mail Scenario, My requirement is to get dynamically the file name from flat file of the Sender Side into Subject of Receiver Mail Adapter and attachment of file from the Sender Side. Can anyone help me out.
Thanks in AdvanceHi....
You can write udf in the message mapping to get the Dynamic file name and map that to the subject of the receiver mail.
DynamicConfiguration conf = (DynamicConfiguration) param.get(
StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// read value
String Filename = conf.get(KEY_FILENAME);
Regards,
Leela -
Vaildating File name with the data in the file using sender file adapter
Hi,
Below is the scenario
1) Pick up files from a FTP server, the file name is dynamic, how do I put dynamic name in sender file adapter?
2) Determine if the user correctly named the file based on data in the file.
a. File naming structure that we will be concerned with is <company_code><accounting_time_period>.<extension>
b. The company code and the time period in the file name have to match the data in the file.
i. For example. If the file name is 1001_200712.csv and the data in the file is for company code 1005, time period 200712, the file is incorrectly named. Both values must be correct.
How do we do this?Hi Sachin,
As Rightly said by Krishna, You can not put Dynamic name in sender File Adapter .You have to provide the name of the file like "*.txt" in Sender Adapter and at runtime you can access this file name by using following UDF:
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String valueOld = conf.get(key);
return (valueOld);
As now you have picked up the file name at runtime.
Now concatenate source file fields Company_code and Accounting_timeperiod using "_" as delimiter in properties.Also concat the extension .Now you have required file name.
So using EQUALS standard function ,compare it with File Name fetched at runtime using above given UDF, and pass result as you desire to process further or not or to raise Alert to resend the file.
Thanks & Regards,
Anurag Garg
You can validate this file name in Mapping itself. -
Hi experts,
I would like to know how to find the configuration of generated file name in F110? Path is taken from DME variant, but filename in AL11 has following format: posting date_ runId_BUKRS_payment method_00. I would like to change it, thank you in advance.
Best regards
Paul SmudaHI,
Use substring function in the mapping and give the the values as 5 and 8.
Map to the any field in the Target Structure.
Use the variable substitution in the Receiver File adapter.
Go throgh the following blogs.
Dynamic File Name using XI 3.0 SP12 Part - I
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
Dynamic File Name depending on the Source File name
Dynamic File Name - Suppress the Substitue varible
Solution to the problem encountered using Variable Substitution with XI-SP12
Regards
Goli Sridhar -
Need Target File Name Timestamp is same as Source File name Timestamp
Hi ,
I want to genereate Target file name (Target_09062008082030.xml) but this time stamp is exactly Sorce FileTime stamp..(Source_09062008082030.xml)..
so, i want to create a target file with the same source file time stamp..
for this.. i sed Message Specific attributes... in both sender and receiver side.. but that was creating with the complete name.of source file name.. but i want only Timestamp of the source filename... and remaing is the constant.. for this how can i proceed ..
Thanks
JainSee in Sender CC when you set the Adapter Specific Message Attr for file name it will send the filename in the header of the XI Message.
To acces this file name inside mapping you need to create a UDF . The type can be any thing as you desire.
You dont need to pass any variable .if suppose you want the file name (constant) e.g ABC_<timestamp>.xml
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);
//see above your key is FileName which will be sent by the sender CC automatically... You are simply accessing it here using get() method.
//now ur filename will contain name of the source file... you need to perform a substring operation to get the timestamp and create a new file name as you desire.
fileName = "New_<timestmp>.xml"; //for e.g
//set this file name again in header message using put()
conf.put(key, fileName);
//when you check on the adapter specific message attr for fileName in the receiver CC ,it will automatically take this new file name value.
return fileName;
// if you want to use this new fileName inside your mapping payload (for other fields) you can assign this to any target field,else just assign it to the root tag which will make no difference if this file name is not used anywhere. -
Receiver Mail Adapter File Name
Hi All,
I have a scenario file to Mail.
The rquirment is that everytime the file is picked by the adapter a mail needs to be sent.
The email should just have the file name of the file that got picked up by the file adapter but there should be no attachment in the email, just the file name either in subject or in the body of the email.
No Mapping should be used.
Can this be done?
Regards,
XIerHi,
You can do the File to Mail scenario as the normal way.
For Receiver side just consider one field as payload and don't map the other fields from File.
You can get the File name with the use of Dynamic configuration. Please refer
Refer this blog. for File to Mail
/people/varadharajan.krishnasamy/blog/2007/01/09/troubleshooting-soap-message--xi
File to Mail scenario help
Refer for getting file name in mapping
How to include the file name as an XML field
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken]
Dynamic File Name for Receiver File Adapter
/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
Thanks
Swarup -
How to read a file name and send it a particular reciever
Hi,
I have a scenario, where i am receiving a a file and based on the file name i have to decide who is the receiver and send it to that particular receiver.I do not have to do any mapping.
can someone suggest me how can I achieve this.
Thanks in advance.HI This may help you.Let me know if not.
Step by Step Guide: XML File 2 XML File Scenario: Part I
Step by Step Guide: XML File 2 XML File Scenario: Part II
Converting XML to PDF using XI
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
"JAVA MAPPING", an alternate way of reading a CSV file
Dynamic File Name using XI 3.0 SP12 Part - I
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
Push Data to MVC Architectured application using XI
How to send any data (even binary) through XI, without using the Integration Repository
XI in the role of a FTP
The specified item was not found.
The specified item was not found.
The specified item was not found.
The specified item was not found. -
SFTP sender to File receiver mapping of file names
My scenario is: sender channel = SFTP (Seeburger) transferring multiple PDF files to Receiver adapter File (NFS).
These PDF files need to have the same name as the original files from the sender (3rd party) system.
Because these files are being processed without an interface, I can't use UDF to help map the file names.
I've tried using Seeburger's localejbs/Seeburger/AttribMapper to map the names, as follows:
File (NFS) receiver channel config:
- ASMA boxes for 'Use Adapter-Specific Message Attributes' and 'File Name' are ticked
- Module localejbs/Seeburger/AttribMapper is on the first line in the module tab under processing sequence, with module key = AttributeMapper
- Under Module Configuration:
- Module Key = AttributeMapper
- Parameter Name = http://sap.com/xi/XI/System/File/FileName
- Parameter Value = @http://seeburger.com/xi/SFTP/dtSubject
(I haven't entered any attribute module config on the sender side)
This setup fails on the receiver side with the message '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.RetryControlException: Channel stopped by administrative task.' (not very helpful!). All I can get from that is that it doesn't like my module configuration!
Can anyone help me understand the correct way to do the file name mapping for my specific scenario?
Regards,
ChristineWe've got this working at last!
The main problem was indeed the missing .sca file from Seeburger: SeeModuleCollectionPI.sca
Our Basis team deployed this file this morning. After a bit of fiddling around with the attribute mapping, my test files were transferred successfully with their original names.
The config I ended up with is just as described in another forum post for SFTP to FTP, but I'll repeat it in more detail here:
Sender channel
Parameters tab:
Adapter Type = SFTP (Seeburger)
(sender, transport & message protocol = SFTP)
Scheduler = x in all appropriate days, with interval = 1 (minimum allowed)
(rest here is specific to your environment, but I set filename to *.pdf to get all .pdf files from the sender)
Module tab
Processing Sequence
Number Module Name Type Module Key
1 localejbs/Seeburger/AttribMapper Local Enterprise Bean AttribMapper
2 localejbs/Seeburger/solution/sftp Local Enterprise Bean solutionid
3 localejbs/CallSapAdapter Local Enterprise Bean exit
Module Configuration
Module Key Parameter Name Parameter Value
AttribMapper http://sap.com/xi/XI/System/File/FileName @http://seeburger.com/xi/common/dtSubject
Receiver Channel
Parameters tab:
Adapter type = File
(receiver, with transport protocol File System (NFS), etc)
Target tab:
Target directory (set to your required PI server directory)
File Name Schema = * (can be anything, will be ignored)
Processing tab:
(your requirements-specific settings - mine were create, write directly, file type binary)
Advanced tab:
Under Adapter-Specific Message Attributes (ASMA):
tick the following:
Use Adapter-Specific Message Attributes
Fail If Adapter-Specific Message Attributes Missing
File Name
Modules tab:
Processing Sequence
Number Module Name Type Module Key
1 CallSapAdapter Local Enterprise Bean 0
(nothing under Module Configuration)
Thanks to those who kindly took the time to try and help me, your suggestions pointed me at the real problem.
Christine -
Mapping Dynamic File Names - JDev 10.1.3.1.0
It is important for me to be able to capture the name of the inbound file while mapping in the XSL builder. I need it to be mapped to an XML value on the target side. The file name will be dynamic so it will not be possible to hard code it. Is anyone aware of a tool that can do this for me? I would only like the absolute name of the file, not the entire path.
Thanks, EricPerhaps better late than never...
This is a limitation in JDeveloper that it cannot render an XSL in design/mapper view when it contains these features of XSL. Pretty much 100% of AIA transformations fall into this category. -
File-name not being fetched in a multi-message mapping by Dynamic Conf
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,
The scenario I am trying to test is a multi mapping scenario where I am trying to split one source message and create two target messages by using two different receiver interfaces, one for each message.
I am on PI 7.1 and when I test message mapping and operation mapping using the payload from SXMB_MONI, it is successful. Whereas when I test the scenario end to end I am getting the following error messages:
Operation Mapping
Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
Name
Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
Namespace
http://accenture.com/1:N_multi-mapping
Runtime error
Split mapping created no messages
Start tag ns0:Messages Add raw attribute xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" Start tag ns0:Message1 Close tag ns0:Message1 Start tag ns0:Message2 Close tag ns0:Message2 Close tag ns0:Messages
Could someone please help
Cheers,
S
Maybe you are looking for
-
How to perform a query to read an xml file in SCCM 2007
Good, I need read knows how to read an csv file for a specific column after collecting the results, then put the PC's in a collection in particular. A greeting and thanks
-
New rule is not working from 'ojaudit' though I use loadSet="Audit"
When customizing new rules in audit framework using the Jdev Extensions API, I used the below content in extension.xml file. <hooks> <jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension"> <addins> <addin loadSet="Audit">oracle.te
-
Duplicates in Outlook connector global address list (GAL)
I am getting duplicates in GAL of Outlook 2007, some addresses appear seven times or more. I have followed the guide for VLV Browsing, it makes no difference to the problem. There are less duplicates if I use search base: ou=People,o=Organization1,dc
-
How do I get and set the double field in a Double?
Thanks - this has to be easy but I cant find documentation
-
ITunes movie has stopped playing
I've just encountered a problem. When I go to play a movie it would play and then lag after awhile. But as soon as I stopped playing and exited back to the movie listings, then went to start playing the same movie the screen would blink suddenly and