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,
Ralph
Hello 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
Similar Messages
-
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; -
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 -
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 -
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 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 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. -
Variable Substitution for IDOC-XML-Flat File
Hello
I have a scenario where I need to populate the Idoc number into my file name. the Source is an Idoc and the Target is XML but the target is then converted to an Flatfile via a module in the processing sequence. When I try to use the variable sub method it errors out as the final target structure is a flat file and not the XML structure that I hav used in the graphical mapping. Any help on how I can go abut doing this will be greatly appreciate.
Thanks
LavanyaIF I remove my adapter that converts the XML file to Flat file from the module sequence this works perfectly. So is there a way for me to now read the xml file for the target file name in variable sub. but still have the Flat file structure derived for the processing seq.
-
Setting up variable access for source control
Working on a few projects on my own I have used Team Explorer in Visual Studio Professional 2013 successfully for some time. I only use source/version control.
My default collection is hosted on visualstudio.com.
I now want to bring a second person, say Fred, who also has VS Professional, into the act in such a way that he can download but not modify my projects and I can download but not modify his.
Because all the projects are closely related, we each want to be able to quickly look at each others projects to see what has changed as well as being able to download them. I think this will be easier if all the projects are in the same collection.
Consider one of my projects, say "zxzx".
In the project control panel with the Security tab I can see:
Teams
zxzx Team
VSO Groups
Build Administrators
Contributors
Project Administrators
Project Valid Users
Readers
Under Permissions, I can see what each of these is allowed to do. "Project Administrators" and "Reader" seem relevant.
Under Members, I can see who is in each team and group.
I have myself in zxzx Team and Project Administrators, and Fred is in Readers.
When, in VS, I sign myself out and sign in as Fred. As Fred I can download all the projects and I can update them. That is not what I want.
I clearly don't understand the relationships between Collections, Projects, Teams and VSO Groups.
Help!
Thanks for any reply.Hi Jeff,
Thanks for your post.
We can Deny the check in permission for user/group on separate folder(s)/file(s) in Source Control Explorer. In your VS>>Source Control Explorer, right-click on “zxzx” and select
Advanced>>Security…, then you can add Fred account in this opened dialog and deny his check-in permission in there.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Dynamic target directory with variable substitution
Hi everyone.
I'm trying to save a file in a folder with receiver adapter.
This folder is determined in runtime and passed to the adapter with variable substitution. My problem is that in RWB i get a error like this : 'Content of variable XXXXX is not safe'
Does anybody have done a variable substituion for output directory receiver file adapter?
Regards,
Inigo.Hi,
Check this links,
/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Regards,
Phani -
Variable Substitution need to define pay load for the following structure
Hi All
Please help me for defining the pay load for the following structure for the Variable Substitution
for genearing the file dynamically fro the payload
Target structure is like this
MT_RFQ_IND_IDOC_MYSPACE_TARGET............> my message type
<HEADER>
< FileName>
<INDI>
<RFQNO>
<DOCUTYPE>
< ITEM>
<FEILD1>
<FEILD2>
<FEILD2>
please help me
thanking you
SridharHi,
should this var1 given in any data type of my IR - No
in variable substitution, in value give the complete thing which i said above in italics i.e. payload:MT_RFQ_IND_IDOC_FILE_TARGET,1,hEADER,1,FileName,1
which user you used for CPACache refresh - it can only be done by XIDIRUSER.
Regards,
Rajeev Gupta
Edited by: RAJEEV GUPTA on Feb 6, 2009 7:34 AM
Edited by: RAJEEV GUPTA on Feb 6, 2009 7:35 AM -
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> -
Hello All,
Below is my source structure:
<Messages>
<Message1>
<MT_BILL> (0...*)
<RECORD> (1....*)
<FILENAME> (1...1)
If using variable substitution for the filed FILE NAME which is in the source structure.
This is the declaration I used in channel:
payload:MT_BILL,0,RECORD,1,FILENAME,1
But i am getting this error in channel monitoring
DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var
Can anyone help me here
Regards,
MoorthyHi Dasika,
In variable substitution we use the receiver message type path.
Please map the required source field to any of the field at the reeiver side and use variable substitution.
For 1:N muti-mapping with variable substition go through the below links:
Re: 1: N File Scenario..
Using Variable Substitution
Regards,
Pranav -
Variable Substitution with tag attribute
Hi,
is possible to use variable substitution with tag attribute? as follow:
<root directory="xxx" filename="yyy">
<....
</root>
using variable substitution for directory : root,1,directory,1
root,1,filename,1Hi,
I solved my problem using Dynamic Configuration to set the FileName and Directory fields in Adapter Specific Configuration. To use Variable Substitution only accept element in XML.
Thanks for all. -
Hy,
I get following problem with Varibale Substitution in Receiver File Adapter.
<b>"2006-04-19 14:10:39 CEST: Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters! (Value '001')', probably configuration error in file adapter (XML parser error)'"</b>
My file has following structure(message typ)
level1
recordset
fieldsa String 1
fieldsb String 1
level2 Element 1
fields1 String 1
fields2 String 1
and Adapter configuration is
Folder : data\%w%\
filename : file%r%.txt
w payload:level1,1,level2,1,fields1,1
r payload:level1,1,level2,1,fields2,1
Could anyone see my problem
cheersHi,
Is this is your structure
level_1
-level_x
-fields_a String 1
-fields_b String 1
-level_2 Element 1
-fields_1 String 1
-fields_2 String 1
If so the variable substitution looks ok.
w payload:level_1,1,level_2,1,fields_1,1
r payload:level_1,1,level_2,1,fields_2,1
First Option-
1) Remove the _ (Underscores) and check it -Refer SAP Note 850694
2) Remove the Directory Susbtsitution - by giving static path for the File Directory
3) If it works in 2nd step, there is a error in the Variable Sustitution for the Directory .( check SAP help mentioned in my earlier reply)
Hope this helps,
Regards,
Moorthy
Maybe you are looking for
-
I recently received a new MacBook pro 15" and 2 Dell 27" P2714H monitors. I can run a mini display port to one of the Dell Monitors, but I tried to run an HDMI to DVI Port (not mini DVI) to the other Dell Monitor, no signal...I have 2 displays worki
-
Hi I have four rollover images that I want to centre on my homepage, but I want to align them as in the attached pic below. Do I need to create a new style for each image? I've tried this and many other things, but nothing seems to work! I'm obviousl
-
Burning Double Layer DVDs in iDVD 6.0.3
I can't seem to burn double layer DVDs. I am using an intel iMac which says i should be able to but it won't accept discs to burn. Is it because i am using 8.5GB discs because iDVD says in the project info that double layer DVD should be 7.7GB? Any t
-
Hp pavillion g6 notebook pc windows 8, graphics card
Hi there, I got one of these laptops and it is incredible, I am very happy with it. I just wanted to know if the graphics card was upgradable, and if so what to? (hp pavillion g6 notebook pc windows 8). Thanks a lot, Dave {Personal Information Remove
-
Need simple flash that plays a sound, urgent!
Hey, I haven't worked with flash for a long time and don't have it installed on my computer... But I need a very simple flash to can play a sound once. All it should do it so recive an url to a wav file and play it without display anything, thats it.