Use variable in target path
Hi
Im sure this is no sweat for a lot of you guys but as im new
to using arrays and stuff its still escapung me.
I nees to use a variable as part of a target path inside a
for loop so it populates a series of dynamic text boxes with
instance names busName0, busName1 etc. can this be done?
Heres my code so far:
stop();
var busNameArray:Array = new Array(
"business 01",
"business 02",
"business 03",
"business 04",
"business 05",
"business 06",
"business 07",
"business 08",
"business 09",
"business 10"
var i:Number;
for (i = 0; i < busNameArray.length; i++) {
this.rightPanel.busName(need the variable i to go here).text
= this.busNameArray
Any help much appreciated.
cheers chris
I know
You're welcome.
Similar Messages
-
How to use variable in source path of an image in flex
hello
i just want to know that how to use variable in source path
of an image in flexI am doing exactly that with data binding at the moment. This
is my Image element
<mx:Image width="50" minHeight="50" height="76"
source="{Application.application.parameters.api}/rest/entity/{data.Slug}/Image"
/>
Note the curly brackets
HTH
Pat -
Virtual directory mapping: how to use variable in local-path element
Hi all
We are using a virtual-directory-mapping declaration in the deployment descriptor
for our web application to load jsp'a and other files from the file system.
This declaration looks like this:
<virtual-directory-mapping>
<local-path>c:/views/jsp</local-path>
<url-pattern>*.jsp</url-pattern>
</virtual-directory-mapping>
Here is my question:
Is there a possibility to use a variable in the local-path element? Something
like:
<virtual-directory-mapping>
<local-path>%PATH_TO_JSP%</local-path>
<url-pattern>*.jsp</url-pattern>
</virtual-directory-mapping>
If yes, how does it look like? My example above didn't work.
If no, is there another way to do that?
Thanks in advance
Regards
Iwanposting to servlets newsgroup
"Iwan Bussmann" <[email protected]> wrote in message
news:[email protected]..
>
Hi all
We are using a virtual-directory-mapping declaration in the deploymentdescriptor
for our web application to load jsp'a and other files from the filesystem.
This declaration looks like this:
<virtual-directory-mapping>
<local-path>c:/views/jsp</local-path>
<url-pattern>*.jsp</url-pattern>
</virtual-directory-mapping>
Here is my question:
Is there a possibility to use a variable in the local-path element?Something
like:
<virtual-directory-mapping>
<local-path>%PATH_TO_JSP%</local-path>
<url-pattern>*.jsp</url-pattern>
</virtual-directory-mapping>
If yes, how does it look like? My example above didn't work.
If no, is there another way to do that?
Thanks in advance
Regards
Iwan -
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 -
Used of Sap text variable with replacement path in Bo designer
Dear experts,
I created a univers based on a SAp BW query. In this query I used a text variable in order to get dynamic header columns.
The text variable is done by using "replacement path" that is the text is derived automatically from the user input triggered by a sap bw variable.
example :
the query contains a restricted key figure which shows net values for a selected year based on variable PYEAR.
The name of this restricted keyfigure is &ZYEAR& where ZYEAR is the text variable with replacement path from the variable PYEAR.
When generated the univers based on this query I get component &YEAR&.
When I use this unvers in WebI my result containts header with &YEAR& althougth I selected for example the year 2006.
According to several how to and white papers on SDN , it seems that text variables with replacement path are supported. So I am disapointed by this result.
Can you give me advise to get a rigth result ?
thanks a lot
Olivier DoubroffHi Rishit,
I am trying to achieve the same as you, but it seems like text variables in restricted key figures do not work. I am using BO XI3.1 SP3 and SAP BW 7.01 SP6.
A work-around for me has been to use the "user response" function in webi to create a webi variable that holds the dynamic text title. If the user inputs Jan 2010, I change the input to a date using the "user response" and "ToDate" functions in the webi variable editor. After changing the input to a date I use the RelativeDate to extract 1 month (e.g. 25 days) from the user input. Then I have both Jan 2010 and Dec 2010 as webi variables to use as headers for my restricted key figures.
The formulas can easily become a little long, but by tweaking the user response string, you should be able to get dynamic headings by using webi functionality. But be aware that you need one webi variable for each dynamic heading if you use this method.
Let me know if it works or if I can help more:-)
Best regards,
Morten -
Time Format using text variable with replacement path
Hi Friends,
I've used "Text variable with replacement path" to make the column heading dynamic by replacing the values referring from "0calday"...
everything is working fine, but here it is displaying the time format like
YYYYMMDD (20030101), i want it to be displayed DDMMYYYY (01012003) in the column heading... how to make it possible?
pls waiting for ur inputs, it's an urgent...
Regards,
PattnaikHi Satyakam,
In the text variable properties make sure that in the replacment path you have chosen "Text" to appear date as per user setting . Other wise as in your case it must be set to "Key" which always shows in the format YYYYMMDD.
Hope that helps.
Regards
Mr Kapadia -
Using variables in paths to objects
Hi
I'm wondering how I can use a string in a declared variable
for a path to an object. Here's an example:
On the press of a button a variable is declared:
_root.nextsection = "news";
And later on I want to use the string "news" in a path, like
this (on a frame action):
if (_root.nextsection == "news") {
this.nextsection.gotoAndPlay(1);
As you can see in the second line I'm using the variable name
as a path... but this doesn't work.
Any suggestions?
ThanksDepending of where your if statement is, if your
this.nextsection is the
same as _root.nextsection, since this is a string and not an
mc, what it
does is:
"news".gotoAndPlay(1).
If you had a movieclip named news in the _root, then you
could do:
_root[_root.nextsection].gotoAndPlay(1) // EQUIVALENT TO
_root["news"] or
_root.news
Other option is:
var mynextsection_mc = eval("_root." + _root.nextsection) ;
mynextsection_mc.gotoAndPlay(1);
Flash will evaluate your constructed string "_root.news" to
an object and
return it, if it doesn't match anything, then you will get an
undefined.
JG
"Cetrez" <[email protected]> wrote in
message
news:ejqacs$q6r$[email protected]..
> Hi
>
> I'm wondering how I can use a string in a declared
variable for a path to
> an
> object. Here's an example:
>
> On the press of a button a variable is declared:
>
> _root.nextsection = "news";
>
>
>
> And later on I want to use the string "news" in a path,
like this (on a
> frame
> action):
>
> if (_root.nextsection == "news") {
> this.nextsection.gotoAndPlay(1);
>
> }
>
> As you can see in the second line I'm using the variable
name as a path...
> but
> this doesn't work.
>
> Any suggestions?
> Thanks
> -
Help creating a path using variables.
HI
I;m trying to create a path to a movievclip created with
attachMovie. I need tio create the path using variable:
_root.var1.var2.gotoAndPlay("something");
How can I tell flash that var1, var2, etc are variables and
not a relative path?
Tks,Hello Tks,
depending where the movieclip is that you are trying
communicate with you need to use either other movieclips or you
will need to use _parent.
var gong:MovieClip;
var bong:MovieClip;
var song:MovieClip;
this.attachMovie("gong".....
gong.attachMovie("bong"....
bong.attachMovie("song"...
to access song from the timeline in which all these movie
clips were attached
this.gong.bong.song.variable
from song to the timeline in which all movie clips were
attached
song._parent._parent._parent.variable
Hope this helps..
moozungu -
im looping through databases on a server & building a connection string to each database.
$SQLConn.ConnectionString = "Server=$SrvName; Database=$DBName; User ID =DBLogin; Password=myPassword;"
The problem is i get this error:
Only variable names (i.e.: $variable) may be used as the target of an assignment statement
I can put the code into an Inlinescript, but then I lose the ability to perform paralellism. Is there any way to construct the connection string in PS Workflow without using an Inlinescript?Hi Winston,
Why not just wrap the InlineScript blocks in a Parallel block, to cause them to execute in parallel?
For example:
workflow foo {
parallel {
inlinescript {
start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
"a"
inlinescript {
start-sleep -Seconds (Get-Random -Minimum 1 -maximum 5)
"b"
Sometimes outputs "a b" and sometimes outputs "b a" -
AttachMovie using variable target and source names
I've frequently used variable names for the target but is it impossible to do this:
holder.attachMovie(["mcButton"+i], ["box" + i + "_btn"], this.getNextHighestDepth()*200, {_x: arrBtnX[i], _y: arrBtnY[i]});
I can't get it to work and I haven't been able to find an example. It doesn't work without the square brackets either.
Thanks
MarionThank you very much for replying. I had tried that before without success but I discovered I had given the 'holder' a different name (doh!) Now that I am using the correct name, I find that it's working but only the last target movieclip appears. When I trace(i) I get the full trace. When I trace(btnHldr["box" + i + "_btn"]._x) I get the correct figures.
I have double-checked the linkage names for the mcButton0-5 movieclips and they are correct. I suspect it's looping through and replacing the same source with the target. I'm a bit puzzled.
Rgds
Marion -
I need help using the target path tool
Hi all,
I realise that I need to keep all my code on the main timeline, so now I need some serious help with targeting movieclips and buttons, when I use the target path tool (the little gun sight in the action script panel) it lets me navigate to the thing I want, but when I use it's suggestion it very often doesn't work, and I am left using trial and error to work it out. Ican get stuff to work, but I really have no idea why or how I am doing it, Sorry to be such a N00B, but I really think if I can work this out I am going to get somwhere.
Cheers
subsubtlefly72 wrote:
Thanks kglad,
OK that is basically what I have been doing, but its been a bit hit and miss, but maybe now I see why, your last sentence
of course, all those objects have to exist at the time your code executes.
So if I am referencing something inside a mc and it doesnt exist on the first frame there will be an error?
exactly.
also what is the this. Object() and Object(parent) ??
Do I need to be using these?
not when using code on the main timeline. "this" refers to the current scope which for code on the main timeline, is the main timeline. the following are the same:
this.mc and mc
this.var1 and var1
And still I want to know why the target tool gives me a path that doesn't work?
i can't tell you much about the target tool. i've never used it. but i tried testing it just now and it seemed to work correctly to target a nested movieclip. again, you must sure that object exists when your code executes so if you target something on frame 2 (or greater) of a movieclip using code on frame 1 of the main timeline, the reference may be correct but the object won't exist when your code executes. there are a number of ways to handle that if it's your main problem. -
Using variables in WLST Script ant task
I have multiple scipts that are run using ant tasks, however, I do not want to have to enter the password every time one of these scripts is executed. Instead I would like to use the following ant task to store the password in a variable/property:
<target name="getPassword" >
<echo message="Domain: ${domain}" />
<echo message="Username: system" />
<input message="Please enter password:" addproperty="password" />
</target>
I would then like to use that variable/property everytime a script is executed like this:
<target name="deploy4x">
<echo message="***** Copying 4X.ear *****" />
<copy file="${build.path}\jar\4X.ear" todir="${apps.dir}" preservelastmodified="true"/>
<echo message="***** Updating 4X.ear on ${domain} *****"/>
<wlst debug="true" fileName="Deploy4X.py" executeScriptBeforeFile="true" failonerror="true" >
<script>
connect('system','%s' % ${password},'%s' % $url)
</script>
</wlst>
</target>
However, the script blows up every time I try to run it b/c of the connect() line. I have also tried connect('system','%s' % password, '%s' % url).
Has anyone else successfully used variables in an Ant WLST Script task?
Thanks.Hi,
when I use *XDIM_MEMBERSET ACCOUNT AS %TEST% = BAS(REVENUE) - it work fine.
BUT ! after my first commit, it seems like the variable value is lost. And the *Xdim_memberset takes all.....
Fortunately enough, *select still contains the variable value after *commit.
Thanks,
Joergen
*Correction !
It actually works, it still contains the variable value after commit !!
Edited by: Jørgen Dalby Andersen on Dec 30, 2011 1:33 PM -
BW 3.5 - Issue with formula variable with replacement path
Dear experts,
I'm facing an issue with formula variable with replacement path.
Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100
To do so I've setup a calculated key figure as follow:
VAR1 * ("PO value" < 100 ) * "PO value"
VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
(The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
The report as characteristic "plant" in rows and my CKF in columns.
Now let's take an example. I have 3 POs in Plant 1:
PO1 -> 150
PO2 -> 90
PO3 -> 80
Because of the variable with replacement path, the result in my query should be:
plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
But the result coming is 320, which is wrong.
I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref characteristic 'constant =1' ...
Any though is welcome!
thanksHi,
The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
Regards,
Patricia -
Variable with Replacement Path
Hi, I have two queries. The results of the first one should be the input for the second one. E.g. the first query shows a list of personnel numbers and additional information. These personnel numbers shall be overtaken by the second query. The personnel numbers belong to "Dimensions" in the Query Designer. I alread tried to create a variable with replacement path to the dimension personnel number. I implementet this variable in both the first and the second query (under: "rows"). It`s no "Formular variable" and no "Calculated Key Figure" but a "Characteristic Value Variable" of a Dimension. The problem is now that I cannot execute any of the two queries. The error "Abort the query cannot be released for OLE DB for OLAP. System error in programm CL_RSR_REQUEST and form PREPARE_VQUERIES:INVALID_
What is my mistake? Thank you in advance! EveHi Eve,
It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
We are using the scenario in a couple of places, and it works very well.
Hope this helps... -
Creating Variable with Replacement Path to get value from ANOTHER Variable
Hi all,
Is anyone has created the Variable with Replacement Path to get the value from another User Entry Variable, PLEASE ?
First created the User Entry Variable (ZV_X) and it accepts the date range like '01/01/2009 - 01/31/2009'. Next created the Characteristic variable (ZV_Y) of Replacement Path for which source variable will be ZV_X and we should get the 'FROM Date' (01/01/2009) from the selection (ZV_X) into it (ZV_Y).
While creating the Characteristic variable (ZV_Y) of Replacement Path, I didn't find my newly created ZV_X variable in the list of available variables under 'Variable' header in 'Replacement Path' tab and it is causing the error 'Source to replace variable ZV_Y is not defined'. How could I create the Characteristic variable of Replacement Path for my requirement, PLEASE ?
The following is from help.sap..com:
Replace with Characteristic Value
Text and formula variables with the processing type Replacement Path can be replaced with a corresponding characteristic value. In the variable editor, on the General tab page, you specify under Reference Characteristic the characteristic that is to be referenced by the replacement. On the Replacement Path tab page, you can choose whether the variable is replaced with the From or the To Value and with the Key or the Name of the characteristic value. You can also specify the Offset Start and Offset Length for the output.
Replace with Variable
Characteristic value variables, hierarchy variables, text variables, and formula variables with the Replacement Path processing type can take their values from a different variable.
The following prerequisites need to be fulfilled:
Variable
● The variable must not be input-ready
● The variable must represent a single value
Source Variable
● The source variable must not be a hierarchy node variable
● The source variable must be input-ready
● The source variable must be available in the query
● The source variable must represent a single value or an interval
In the variable editor, on the Replacement Path tab page, you specify the source variable from which the value is to be determined. The value is either determined from the key, the external attribute of the key, the description, or the attribute value. You can specify an Offset Start and an Offset Length for the output here. The variable is replaced on the variable screen upon each data release.
Thanks,
Venkat.Hi Eve,
It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
We are using the scenario in a couple of places, and it works very well.
Hope this helps...
Maybe you are looking for
-
Writing two linked objects (obj1 is linked to obj2)?
writing two linked objects (obj1 is linked to obj2) Approach A: ObjectOutputStream o = new ... o.writeObject(obj1); o.writeObject(obj2); o.close(); Approach B: ObjectOutputStream o = new ... o.writeObject(obj1); o.close(); o = new ... o.writeObject(o
-
Purchase Order Cost Getting Changes Automatically
Hi All, We have developed an application which works as a bridge between two applications and we are taking data from other application and transferring the same to SAP B 1 using DI API provided by SAP we are having 2007 PL10 and we are facin
-
Can the dock be configured to recognize an external drive?
Can the dock be configured to recognize an external drive?
-
I am trying to find a cheap alternative to DW as I use DW for my job however my content writer needs an editor as our newsletter wysiwyg is very unstable and cannot hold complex tables. I suggested editing the newsletter in an editor and pasting the
-
I have an HP Pavilion DV9000.