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,
madhu
You 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.
Similar Messages
-
It's odd, I was looking over the live docs about localization in Flex and no where did I see any mention of how you could substitute variables dyanmically? For example maybe in English I want "Welcome Rick!" but in some other language I want "Rick, Welcome!" (where "rick" as name is the dynamic portion.)
After many google searches I found this helpful post on another site: http://soenkerohde.com/2008/07/flex-localization/
That describes how you could do it, but shouldn't this be in the docs somewhere? Can someone point me to the adobe doc page that I'm missing. It's probably covered in some other area other than localization, but I'm not finding it.
ThanksHello Carme,
I have not found a solution for this type of event.
I was attempting this because the FTP site I was connecting to would DELETE a file the moment XI touched it. So when XI (using FTP Transfer protocol) configured with a DELETE or ARCHIVE (Processing Mode), it would error off because the file was no longer on the FTP site. I contacted the site but they refused to deactivate their script to auto-delete files. Using TEST processing mode is not recommended per SAP in a server pool environment. You would think SAP XI would provide a fourth option in which a DELETE command is not issued back to the FTP site.
The FTP site did have sub-directories in which copies of the original files were stored, but I could not figure out how to dynamically change the XI Source Directory as the current date changed.
I settled on using File NFS (Transfer Protocol) and running the FTP commands from a .bat (batch file). I put the command I run down at the bottom of the XI page with a 60 second timeout.
I still do not change to each folder dynamically because the standard FTP (GET and MGET) commands do not attempt a Delete after file retrieval.
Perhaps using a batch file is an option you may want to consider using.
Cheers,
Ralph -
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. -
Variable Substitution for Source Directory
Hello,
I have seen several threads about using a UDF and variable substitution for dynamically determining the Target Directory.
Is anyone familiar with (or had to implement) a solution where the Source Directory is dynamically determined.
My challenge is to connect to a different Source Directory name (sy-datum format, ex: 20070920 ) each day on an ftp site and download all the files in the folder to a know target directory. I am doing a simple file-to-file transfer, so no mapping is involved.
Your comments, suggestions and feedback is greatly welcomed.
Thanks,
RalphHello Carme,
I have not found a solution for this type of event.
I was attempting this because the FTP site I was connecting to would DELETE a file the moment XI touched it. So when XI (using FTP Transfer protocol) configured with a DELETE or ARCHIVE (Processing Mode), it would error off because the file was no longer on the FTP site. I contacted the site but they refused to deactivate their script to auto-delete files. Using TEST processing mode is not recommended per SAP in a server pool environment. You would think SAP XI would provide a fourth option in which a DELETE command is not issued back to the FTP site.
The FTP site did have sub-directories in which copies of the original files were stored, but I could not figure out how to dynamically change the XI Source Directory as the current date changed.
I settled on using File NFS (Transfer Protocol) and running the FTP commands from a .bat (batch file). I put the command I run down at the bottom of the XI page with a 60 second timeout.
I still do not change to each folder dynamically because the standard FTP (GET and MGET) commands do not attempt a Delete after file retrieval.
Perhaps using a batch file is an option you may want to consider using.
Cheers,
Ralph -
Variable subsitution for target file names
Hi All,
I am using variable subsitution for dynamic file names. I am using the multimapping for multiple files in the target.So i coluld not able to use the dynamic configuration for file names. Now i want to replace all the spaces in the filename to underscore.
For example
My payload filed value "file name in the target file".
Now my filename "file_name_in_the_target_file".
How to achieve this using Variable subsitution.
Regards,
Ramalakshmi.GUse replaceString Function.
file name
Constant (" ") --> replaceString -------> TargetField
Constant ("_")
Regards
Ramesh -
ORA-04054 : using variable substitution for the database link name
Hi,
I need to use variable substitution for the database link name.
Here is my command :
declare
GET VARCHAR2(50);
begin
select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
for rec in (select * from [email protected]_GET_DESIGNATION)
LOOP
dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
END LOOP;
exception
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
:crd := -1;
end;
When I run this programm, I receive the error :
ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
When I replace :
for rec in (select * from [email protected]_GET_DESIGNATION)
by :
for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
I receive the error :
PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
What can I do to resolv my problem ?
Regards,
RachelWhat is the name of the DB Link and the name of the object you are selecting
from?
I find it easier to create a view on the remote object then use that in selects.
e.g,
Link Name = MyLink
Object_name = Addr_Loc
create or replace VIEW Rem_Addr_Loc AS
select * from addr_loc@mylink;
In the code I then use the view
begin
for C_Rec in (select * from Rem_Addr_loc)
loop
dbms_output.put_line('Rec: '|| C_Rec.Col1);
end loop;
end; -
Gui_upload for csv file with numeric n date fields
Hi ,
i searched on net on how to use GUI_UPLOAD for csv files using split function but the spilt function requires that the data type of all fields of the internal table should be character whereas in my case there is a numeric n data field too.So kindly help me how to do it.
One way ppl might suggest that give all the fields as char in the internal n after recieving the data in the internal convert the required fields back to data n numeric n then finally insert to the database but if i have 80 fields u would really dont want to do that as it requires precision to convert it to the same type n length as in the original database for all the fields.yeah i guess that would be a bit longer if i m having more no of fields (80) compared to ORACLE where this can be done in a shorter way.
SO i shall use 2 internal tables here rite?? i mean first one(with all fields as char) for storing the split function values and the other one (with actual data types) .CAN u plz tell me how to convert or cast from one data type to another n while moving values from 1st internal table to another which way shall i do.
Thanks for ur help n can u suggest if there is any other method for uploading csv also other than this split method n whether this method is better n faster than others.
THANX -
Variable Substitution for File Name Scheme
Hi all,
Please clarify the following issue.
I have two source fields
Transfer Order number - 0000000222
Transfer Order line item - 0001
Both i map it into one target field
The target field output is - 0000000222#0001
I need a file name which starts with ABC <TranferOrderNumber>.txt
The problem is, when i try to use payload i get output
(ABC0000000222#0001.txt). The reason is i use the target field which was concatenated. I don't have any target field with only transfer order no.
Please give me a solution where i would get output
(ABC0000000222.txt).
Thanks in advance,
Jose AugastineHi,
Other way may be like this ..Create a one more segment in your target structure with field name as Transfer Order No. And populate only this no. And in the Reciever File adapter , in the variable sub, use only this field. But this new segment will come in the file. To avoid this, you can make use of " Cut " Parameter in the File Content Conversion.
This will hold good, if you have content conversion-
/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
Otherwise, you can think of Bhavesh's suggestion
Regards,
Moorthy -
Variable substitution for Dynamic filename
Hi All,
my Scenario is Proxy to file. and the receiver file should be a zip file of extension .dat.gz.
In mapping I tried as below. In signature I used one sender and two receiver messages.
SENDER: RECEIVER:(2messages)
MT_Product MT_Product
-----Row ---------Row
---------field1 -----------field1
---------field2 -----------field2
---------field3 -----------field3
MT_Poduct_1
--------field5
for field5 I mapped current date and I am trying to use it in Reciver file communication channel. will that be correct to use?
In receiver communication channel the file name is Product_%field5%.zip I used
and I used Module Configuration for content conversion and Zipping the file.
In variable substitution I used field5 for dynamic date.
field5-----------
payload:Messages,1,Message2,1,MT_Product_1,1,field5,1
Module Confuguration:
Guys! am on right path????? will this be possible????Hello,
Why you are using multimapping? Just for defining target file name using var substitution - BTW, that too is incorrect. You cannot use Messages/Message 1 nodes in variable substitution.
Secondly, if I am not wrong the approach of defining dynamic zip file name using variable substitution won’t work because variable substitution will be executed once all the modules before standard call sap adapter gets executed. So during runtime, at var substitution step, ur file will actually be a text file instead of XML as a result u will get an exception.
So, if there is no specific objective of using multimapping then simply use DC.
Thanks
Amit Srivastava -
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 -
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. -
FTPs connection error:When using Variable substitution for Directory path
Hi
I am transferring data from BI to xml file via PI: Here a Client proxy from BI sends the data to PI and the PI FTPs the XML file to a remote location. For FTP I am using FTPs SSL connection.
It was working fine untill I used Variable susbstitution to determine Directory path dynamically. I am using this because different xml files are intended to goto the different locations.
I did the variable substitution like this:
Target Message Structure:
---> Target Directory: %var1%
<?xml version="1.0" encoding="UTF-8" ?>
<MT_BI_EXTRACT_FILE>
<Header>
<Directory>/Customer</Directory>
</Header>
<Detail>
</Detail>
</MT_BI_EXTRACT_FILE>
And in the variable substitution I am doing it this way
payload:MT_BI_EXTRACT_FILE,1,Header,1,Directory,1
And the error I am getting is:
Attempt to process file failed with Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
Exception caught by adapter framework: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure.
Does anybody have some Idea of this ??
Regards
NainaHi,
I guess the problem is not with Variable Substitution..
Error when getting an FTP connection from connection pool:
So its a connection problem..
Also check the option Disable Security check and try again...
Try to check again if the interface is executing properly without Variable substitution and let us know..
Babu
Edited by: hlbabu123 on Jan 7, 2011 2:46 PM -
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 -
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> -
How to get file download dialog box in IE 6.0 for .CSV files?
In our Java application, when we download .csv file (by clicking a tool bar button or menu item) in IE 5.5, it brings up the download dialog box and when we click the open button it opens the file in a seperate browser window but after migrating to IE 6.0 it doesn't bring the download dialog box and we are not able to open the excle sheet in a new browser window.
We tried downloading .csv file in IE 6.0 by changing its extension(such as .cs1 and .xls) even then it did not work.We also tried associating CSV type of extension with "Microsoft Excel Comma Separated Values File" in the Windows folder options (Windows Explorer->tools->folder options->file types(tab)), which did not work.
Please respond if you have come across this kind of issue and solution for the same.
Thanks in AdvanceThis has nothing to do with Java. It's Microsoft
setting for known file type. IE is responding to the
setting which will automatically download known file
type (MIME type).
To show the "Save As" file dialog, you have to do the
following (for each file type)
1. open Window Explorer
2. click on Tool-->"Folder Option"
3. click on the "File Type" tab
4. select the extension and then click on the
"Advance" button
5. Check the "Confirm open after download" checkbox
6. Click OK
IE should now display the "Save As" file dialog for
that extension. Remeber, you have to to this for all
extension you want to see a "file dialog" pop up.Unfortunately this is not the only cause. Even with this box checked, downloading java source files from the pages of The Java Tutorial causes them to open in the most recent IE - I (and others also) don't get the save/open dialog box. Java source files downloaded from (some) other websites result in the save/open dialog box. I believe that one of the security changes that MS made in IE's handling of files is the cause. The setting of content-disposition by the server appears to be the key, according to MSDN information.
Maybe you are looking for
-
So i am sharing my apple id (account) with both my mom and my sister. i now want my own apple id just for myself, but i want to transfer all my music,photos,and apps over to the new account. Is there a way?
-
HT201342 how can I retrieve my old files on important and documents?informations
How can I retrieve my old files on important documents and informations?
-
How to copy procedure to sql plus window.
I am trying to copy my procedure from note pad to sql plus window and some of the texts are being cut off. How can I copy the entire procedure to sql plus window. thanks
-
Why is my browser blocking my webpage from running?
I have just upgraded from dreamweaver 8 to dreamweaver 11.5. When I try to preview my html page via dreamweaver, I always get a page is being blocked from IE. This did not happen with dreamweaver 8. Is there some setting I can configure so that I
-
SNMP Walk don't get IfName of Lots of Interfaces
Hello dear Specialists, I am facing a problem with a ASR9010 with IOS XR 4.2.3 that is preventing me from monitoring major of the Ethernet Interfaces with SNMP Walk. Though the router posseses IfMIB iso.3.6.1.2.1.2.2.1.2 and have created the correspo