Variable Substitution in Receiver File Channel
Hi All,
Could you kindly help me with this?
Mine is File to File Scenario. ECC drops a XML file in AL11 directory and i send that file using FTP to a third party system. There is no mapping involved and i use ICO. I need to get a value from the payload dynamically for using it in my file name.
When i tried to use Variable Substitution Method i get this error : VariableDataSourceException: Caught SAXException while parsing XML payload: Content is not allowed in prolog.
This is the reference i have given in my variable substitution : payload:customerelement,1,customer,1,sender,1,dealercode,1
and my XML structure is as below and i am trying to access the dealercode field in the XML.
<?xml version="1.0" encoding="UTF-8"?>
-<ns0:CustomerElement xmlns:ns0="http://www.xxxxxx.com/customer">
<recordCount>34</recordCount>
<Customer>
<Sender>
<transmitDate>ddmmyy</transmitDate>
<dealerCode>N050</dealerCode>
<DMSSystem>ABC</DMSSystem>
<DMSReleaseNumber>1.0</DMSReleaseNumber>
</Sender>
Hi Amit,
Yeah that is correct. But in my case the XML structure was not properly formed and i hwas frequently getting this error " Content is not allowed in Prolog" for which i tried all the solutions in SDN and nothing worked out. So i had no other option and had to go for adapter module.
Now the issue is solved and the interface is working as expected with the adapter module.
Thanks for your valuable inputs.
Regards,
Prabhu V
Similar Messages
-
Variable substitution in receiver comm channel idoc - file
Hello all,
I have a error message in mys sytem XI for creating a file because I would like a file name create dynamically and use an info in this idoc providing system SAP.
And this variable substitution I put file name schema %var1% and variable substitution
var1 payload:ZBBPIV01,1,IDOC,1,E1BIVHD,1,IV_ID,1 and I have this message error
and I set Disable security checks in my communication channel
<b><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Inbound Message
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.MessagingException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1</SAP:AdditionalText>
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error></b>
Thanks for your helpHi,
<b>ZBBPIV01,1,IDOC,1,E1BIVHD,1,IV_ID,1</b>
Check if the target XML Contains a Field called <b>IV_ID</b> and does it have any value?.
Btter option is to use Adapter Specific Attributes and the code excert in this link,
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
Regards
Bhavesh -
Sender_interface_name in Variable Substitution in Receiver File Adapter CC
Hi,
as per this page : http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
it says:
Variable Substitution (Target Directory/File Name Scheme)
If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
The variables can refer to attributes of the message header or elements of the message payload.
○ If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id, message_id_hex
Can we not access sender_interface_name and sender_interface_namespace are not mentioned in above list of variables.
Is it not possible to access sender_interface_name or sender_interface_namespace as variable substitute parameters from within Receiver File Adapter Communication channel.
thanks.>Shabarish Vijayakumar wrote:
>>the sender interface details will always remain a constant
>>so you can hard code the value, isnt it?
Yes, i can hardcode, thats not a bad idea, i need to create then 3 different Reciever File Communication Channel objects, as I am dealing with 3 scenarios for which sender system and sender interface is different.
>Shabarish Vijayakumar wrote:
>>if you look at the mapping runtime constants, those are also for the receiver since the sender interface will always remain constant for any particular CC.
>>http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
yes in this link you provided i can see..
INTERFACE Interface
INTERFACE_NAMESPACE InterfaceNamespace
SENDER_SERVICE SenderService
RECEIVER_SERVICE ReceiverService
RECEIVER_NAME ReceiverName
RECEIVER_NAMESPACE ReceiverNamespace
it seems both INTERFACE (,INTERFACE_NAMESPACE) and RECEIVER_NAME(,RECEIVER_NAMESPACE) are present, may be one is for sender, and another is for receiver.. may be if i use dynamic configuration, possibly my issue would be addressed.. correct me if i am wrong.
thanks. -
Reg:Variable Substitution in Receiver File Adapter
Hi...
In the Source File,
I am gtting the Field "Product_Name". Based on the Product Name, i need to map the Target Field.
In The Target, I am having Filed as Folder Path.
This Folder_Path is mapped based on the condition like.
if Product_Name = DD, and Server Name = DISB,then the Folder Path should be "/home/corpuser/Disbursement/DD" else /home/corpuser/Disbursement/CC
So the ouput file should be placed in the corresponding Target Directory based on the Folder Path.
For this i am using Variable Substitution.
in Target Directory, i am giving the value as "/home/corpuser/Disbursement/%var1%"
Variable Name -
var1
Variable Reference Name -
payload:MTI_Payment_Disbursement,1,Folder_Path,1
Structure for the Target Message is like...
Messages
Message1
MTI_Payment_Disbursement --- 0 to unbounded
Folder_Path
Can you please tell where i ahve done wrong.
Thanks & Regards,
Leela Ratnam MHi...
I am to get the field value in the target structure.
<?xml version="1.0" encoding="utf-8" ?>
- <MTI_Payment_Disbursement>
- <Disbursement>
<Transactional_ref_num>123456</Transactional_ref_num>
<CorporateID>SATCOMP</CorporateID>
<UseridUploader />
<UseridAuthorizer1 />
<UseridAuthorizer2 />
<UseridAuthorizer3 />
<UseridAuthorizer4 />
<UseridAuthorizer5 />
<ProductID>D</ProductID>
<BeneficiaryName>143</BeneficiaryName>
<Amount>5000000</Amount>
<BeneficiaryAdd1>Hyderabad</BeneficiaryAdd1>
<BeneficiaryCity>Jubli Hills</BeneficiaryCity>
<BeneficiaryState>Andhra Pradesh</BeneficiaryState>
<BeneficiaryPinCode>533124</BeneficiaryPinCode>
<CorporateAccoutNo>ICICI48500</CorporateAccoutNo>
<PayableLocation />
<PayeeDate>2009-03-09 00:00:00.0</PayeeDate>
<CustRefNo>143</CustRefNo>
<ChequeNo />
<PaymentDetail1 />
<PaymentDetail2 />
<PaymentDetail3 />
<PaymentDetail4 />
<PaymentDetail5 />
<PaymentDetail6 />
</Disbursement>
<Folder_Path>/home/corpuser/Disbursement/DD</Folder_Path>
</MTI_Payment_Disbursement> -
Receiver File channel for XML files: with carriage return
Hi all,
we are using a receiver FILE channel to generate an XML file that is sent to an external partner.
The XML file looks good in a parser (IExplorer). But in fact there are not carriage return / line feeds between the XML tags
of the XML payload in the file.
Our partner now requires the XML file in a more vertical structure which means: for every tag a separate line (like it is displayed in a parser)
Does anybody know a more general way to convert to a vertical XML structure (so with carriage return line feed).
There is one entry in the SDN dealing with this topic but suggesting using an UDF. I think this is a very specific way.
I don't think it is a good way to change/enhance the message mapping just because of a general formating change.
Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
any experiences? suggestions? examples?
Thank you very much
best regards
Hans
examples:
original by XI receiver FILE adapter
<?xml version="1.0" encoding="UTF-8"?>
<MT_batchStatus><type>BS</type><header><message><messageSender>SENDER</messageSender><messageDate>20090723143720</messageDate> ... and so on
required:
<?xml version="1.0" encoding="UTF-8"?>
<MT_batchStatus>
<type>BS</type>
<header>
<message>
<messageSender>SENDER</messageSender>
<messageDate>20090723143720</messageDate>
... and so on>
Hans Georg Walter wrote:
> Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
> any experiences? suggestions? examples?
In such a case, the best is to write an generic XSLT or Java mapping that will attempt to do the pretty printing/formatting of the xml.
The advantage of a generic one is that you can reuse the same class/jar for many other scenarios.
so the flow will be as below in your interface mapping;
1. your specific source to target mapping
2. the generic formatting class -
Receiver file channel with ANSI format.
Hi,
I have developed file to file scenario for which sender file format is unicode and receiver file format is ANSI.
There is no FCC at sender and receiver site. In interface we are just bypassing the file in PI, there is no ESR objects.
I have configured sender channel for unicode in following way:
File Type : Text
file encoding : UTF-8
I have configured receiver file channel for ANSI in following way:
File Type : Text
file encoding : i have tried with cp1252 and ISO8859-1
When I run the interface I received receiver file in ANSI format. But when I open that file in notepad the content in the file is having spaces in between 2 characters like below.
V O L 1 0 0 0 0 0 9
Is any bady having idea about this problem?
Thanks.
Edited by: darshana-PI on Jan 23, 2012 6:32 PMHi,
The blanks in your target file might be created because your source file is encoded with UTF-16, not UTF-8. Try using one of these as an encoding in sender communication channel:
UTF-16BE (16-bit Unicode character format, big-endian byte order)
UTF-16LE (16-bit Unicode character format, little-endian byte order)
UTF-16 (16-bit Unicode character format, byte order)
Hope you'll find this useful,
Greg -
Hello All,
Scenario is Outbound(ECC to FTP).
Below is the steps in audit log of Receiver file adapter:
12.07.2011 03:30:07 Information Write to ftp server "AAAA", directory "'DEV'", file "DEV.OUTPUT>XML".
12.07.2011 03:30:07 Information Transfer: "TXT" mode, size 55 bytes, encoding ISO8859-1.
12.07.2011 03:30:07 Information 200 SITE command was accepted
12.07.2011 03:30:07 Information File processing finished.
12.07.2011 03:30:07 Information MP: leaving
12.07.2011 03:30:07 Information The message was successfully transmitted to endpoint <local> using connection File_http://sap.com/xi/XI/System.
12.07.2011 03:30:07 Information The message status was set to DLVD.
In step3, It is saying 200 SITE command was accetped. But I didnt mention any UNIX command in my receiver file channel(FTP
transport protocol).
Can someone tell me from where is this coming or is it a default one?
Thanks,
Regards,
MoorthyHi
Please see the DOC for SITE Command:
SITE command is used by the server to provide services specific to the system. Most of the SITE commands can be used by the admin only. You can get all the available SITE commands by "SITE HELP".
http://incubator.terra-intl.com/projects/ftpserver/site_cmd.html -
'Use Temporary File' in Receiver File channel
hi all,
I am facing a strange issue with receiver file channel which I am not sure if somene had already faced. I couldnt find any help from blogs..!
I have configured the Receiver File channel with Write mode as 'Use Temporary File' with a temporary file name(say tmp.xml) scheme and Empty-Message Handling set to 'Write Empty File'
When the scenario is executed, its so happening that the temporary file of 0 bytes(empty file) is being created as tmp<msgID>.xml before the actual file is being completely written. It is expected that once the Actual file is completely written, the tmp file should be deleted, but here is not the case.Thus causing both the files being present in the target location. This is not happening often though.
As the receiving application is processing all files from the target direcotry, the file is getting errored out in the target application.
I think the 'Write Empty File' has nothing to do with this as the option 'Write Empty File' is for empty payloads resulting from the message mapping.
Please correct me if am wrong and also provide me the inputs on my issue. Am on PI7.0
thanks in advance,Hi Tilak,
this is real time interface
real time by using a file... that's a non-sens according to me. You should use a non physical solution (web service, JMS, JDBC, etc...) but a not a file. well... Anyway, you can image that the receiver application schedule the folder every 30s or every 1min, that's almost a real time. Real time is mainly a conceptual view (only synchronous exchange needs really real time). Morevoer, if you really wanted a real time, you should not add a tool like PI (or other) between your source and your target system, the more we have systems, the less it's efficient (in term of delay and response time!).
Even if we propose that the receiver application should have a condition to its script to avoid picking the tmp*.xml files, after a period of time there would be a chance that the *tmp files may increase in number..
No ! coz if my theory is good, if your receiver application does not pick-up tmp.xml, that means this file is not currently treated and so PI is authorized to delete it. So no increase of tmp.xml files in this folder.
Another solution: to create the target file without option "temporary", but to create it in another folder than this one scheduled by your receiver application, and use an OS command AFTER processing, in your receiver CC, which move the created file from the "temp" folder to the target folder.
[http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature]
regards.
Mickael -
Error in Receiver File Channel...in MTB module (Urgent)
Hi,
I am working on a Proxy to File scenario. I am using Message Transformation Bean in receiver file channel to convert xml file into fixed length file. I am getting an error : Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: java.lang.Exception: Exception in XML Parser (format problem?):java.lang.NullPointerException'; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):java.lang.NullPointerException
in MTB step of audit log for comm channel.
Please help me resolve this.
Thanks,
JayaHi ,
"Transform: failed to execute the transformation:"
Pls check ur data what u have to send .. any missing information or any special Chacters or any extra fields are available in the data, this type of transformation error raised.
check once again ur mapping transformation and test the mapping in INTEGRATION REPOISTERY with the same data(what u have to send Previously).
and also check ur adapter status in RWB.
Regards,
Sateesh N.
Edited by: Sateesh N on Apr 21, 2008 1:53 PM -
Variable substitution in reciever file adapter
will any one please help me in sloving this problem ,
i have designed my reciever structure as shown in the below
<RECORDSET>
<HEADER>
<NAME1/>
<ADDRESS1/>
<ADDRESS2/>
<ADDRESS3/>
<ADDRESS4/>
</HEADER>
<LINE>
<QTY/>
<UOM/>
<UNIT_AMT/>
</LINE>
</RECORDSET>
<FILENAME/>
an i am using variable substitution
variable name as filename
reference payload:MT_exxxxx_RECV,1,Filename,1
i am getting a error in my message monitoring
will anyone there to give me syntax for thisHi !
I suggest to use Dynamic Configuration to assign the receiver filename using an UDF in graphical mapping. This little UDF can receive as input parameter the contents of the NAME field and write it to the specific tag in the header of the message, so the adapter will use that value as filename when writting the file on the receiver system, instead of variable sustitution.
/people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Regards,
Matias
ps:please award points if helpful. -
Error during variable substitution: idoc to file
Hi Friends,
I have a got a issue which is Idoc to file scenario.
Iam getting the following error.
Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: date_processing
Could you please tell me waht could be the reason for the same?
as per my analysis, I observed that the field date_processing has been declaredHi Sandeep ,
If the variable date_processing refers to an element in XML schema, Please check if you have added the prefix payload: to the information under Reference.
The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....
Where namea,nameb,... corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.
The description begins at the root of the document and ends at the respective element.
Also please check
Re: Variable substitution
Regards,
Jyoti -
Error :Receiver File Channel not Initialized
Hi all,
I am using a file adapter at the receiver side with file content conversion option. When i post a message it shows an error in the message monitoring as "Reciever File Channel not initialized : Unable to proceed : null"
Please Help.....Hi,
Check if the adapter is active or
check on this thread:
File Adapter Not Initialized Error
the error might be due to FCC. Jsut remove that and see ift he adapter works.
Regards
vijaya -
Variable substitution for csv file
Hi Guys,
I am using Multimapping to generate 2 target messages and finally creating these 2 messges as csv files. But i need to use variable substitution (because dynamic configuration doesnt work in multimapping) to create the target files and i need to omit this node from content. i know if it is fixed length file we can use variable substitution and finally we can cut the variable in content conversion by using below method
fixedLengthToodShortHandling cut
Note:- I am using PI7.1
thanks,
madhuYou must separate variable filename from the other fields in several nodes.
Please, analyze if you can change your scenario, with next stucture:
<ns0:MT_MadhuMulti xmlns:ns0="http://rr.unilever.com/bconepi13">
<Strutcture>
<Name>Syam</Name>
<***>FEMALE</***>
<ID>123</ID>
</Strutcture>
</Strutcture>
<Strutcture>
<Name>Syam1</Name>
<***>Male</***>
<ID>789</ID>
</Strutcture>
<nothing>
<Filename>EmpDetails</EmpDetails>
</nothing>
</ns0:MT_MadhuMulti>
And then in your CC:
Recordset strucutre --> Structure,nothing
Structure.fieldSeparator --> ;
nothing.fieldFixedLengths --> 0
nothing.fixedLengthTooShortHandling --> Cut
nothing.endSeparator --> '0'
Regards,
Carme. -
Need to variable substituion in receiver file adapter
Hi All,
I have one scenario in which i send data through proxy to xi to File .
I am sending the records in 50K(2lacs) slots in appending them in one file for today's date.
Now Next day again i will send the data with old2lacs and 1 new lacs record total 3 lacs .
the point here is i using append as file construction mode so the new 3 lacs records will get append in same file.
if i will send the current date frm ECC side and pick this date frm payold and use variable substituion my other neew file genreate or not, or else new records will get append in same file.
RegardsHi all,
I am using the varable substituion and getting this error..
Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var.
My payload is like this..........
<?xml version="1.0" encoding="utf-8" ?>
- <n0:UST04_MT xmlns:n0="ness.com:Eurekify:UST04" xmlns:prx="urn:sap.com:proxy:DV3:/1SAI/TAS9238077179A583C7CD28:701:2009/02/10">
- <row>
<Date>20100122</Date>
<Identifier>UST04</Identifier>
<Flag>1</Flag>
<MANDT>100</MANDT>
<BNAME>............</BNAME>
<PROFILE>............</PROFILE>
</row>
- <row>
<Date>20100122</Date>
<Identifier>UST04</Identifier>
<Flag>1</Flag>
<MANDT>100</MANDT>
<BNAME>AADLER</BNAME>
<PROFILE>BASE_TRANS</PROFILE>
and in variable substitution i am given the value like this
var=payload:MT,1,Date,1 -
Hi,
I am doing a simple file pass through using PI (File-PI-SFTP) and not using ESR.
I have two requirements -
1. The target file name should be in the format xyz_yyyymmdd.dat
The standard function with the receiver SFTP channel is to get the timestamp but I don't require timestamp.
Could anyone please let me know if I can get the file name format (xyz_yyyymmdd.dat) without using any mapping?
2. I am using certificates, but still the channel requires a User Name (it is a mandatory field). I am unable to understand why I need User Name even if I am using certificates? Is there a way of avoiding that?
Any help will be highly appreciated.
Thanks,
AbhiQuestion 1
Have you seen this wiki page?
http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicfilenameinaFiletoFilepassthroughscenario
2. I am using certificates, but still the channel requires a User Name (it is a mandatory field). I am unable to understand why I need User Name even if I am using certificates? Is there a way of avoiding that?
You might want to try anonymous ssl mode. This might not require credentials. But certificate authentication looks for the user credentials. Take help from BASIS.
Edited by: Baskar Gopal on Mar 6, 2012 4:53 PM
Maybe you are looking for
-
To build dynamic SQL Query using some conditions: Pseudo code required
Hi, I have a requirement where in i have to build a dynamic query based on one count. Some details on requirement: 1) It's a Proc where i need to return some columns 2) There are some fix set of columns 3) Based on one Count column, i have to decide
-
System locked up, now won't reboot.
I had been using my system for most of the morning, went to make sandwich, came back and system was all locked up. Wouldn't respond at all. Display was on, but dark except for cursor, which wouldn't move. Nothing would make it active again. So I shut
-
Arrays, Casting and instanceof, Polymorphism
Having Problems with my programme it compiles but I can't get anything to output when I add a Warden, Rest of code available if you want to compile Thankyou import java.util.*; public class Prison private ArrayList <Person> thePersons; priv
-
Not allowed to move load order of Control panels in System Preferences Tige
I post here because System refuses to let me post in Tiger forum depite my being a forum member since purchasing my G4-500 new just a few months after coming out. The problem is associated with my PowerBook17" bought new March a year ago. I currently
-
I want to run automation test in multiple device say iphone and ipad or two iphone device Is it possible.I have done automation testing using UIAutomation and get it running from iphone device