How to define a public variable in webDynpro ?
Dear All,
I want use a variable between 2 methods.but don't know how to do , There are my part Error code ,
public class TestHtml
public String mystr1 = "";
public void wdDoInit()
mystr1 = "0123";
public void onActionExportIE(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
String mystr2 = mystr1 + "b";
when I click save button ,
"public String mystr1 = ""; disappear .
can you help me ?
thanks!
Hi Doke,
The best way to declare public/private variable is to declare it on global area
Declare it at the end of view where you can see this begin and end part
Inside (As shown below) it will treated as golobal variable, which can reuseable
Anywhere within your iview.
//@@begin others
public String mystr1 = "";
//@@end
It will solve your problem.
Thanks
Anup
Similar Messages
-
Portal: how to define new text variables for information broadcasting
Hello everybody,
I hope the post here is placed on the right position. If not, please try to advise me, where to ask to get answer on following question:
-> In BI Portal -> tab Business Intelligence -> Bex Broadcaster -> it is possible to create PDF and post it somewhere into Portal or any other network drive. That's fact. I'm searching for possible enhancement of the F4 help next to the field "data name". There are available only following few variables <OBJECT_ID> <SETTING_ID> <OWNER_ID> <PROCESSED_BY_ID> <LANGUAGE_ID> <DATE_ID> <TIME_ID> <WEEK_ID> <MONTH_ID> <QUARTER_ID> <YEAR_ID>
We are facing this issue: generated analysis file is valid for the period from month 01 to month actual-1. So therefore I would like to implement my own variable.
Do you know guys, where to define this own variable with own logic?
Could you please give me some hints how to create a new one and fill the logic?
Thank you very much in advance
StanNot resolved. Life goes still on.
-
How to define an updated variable in java?
Hello,
What i am trying to do is to have a variable that keeps its value updated when the program execuation finishes For example
public class class1
private static int x =0;
main()
x++;
Run 1 ..... x = 1;
run 2.........x =2;
run 3........x =3
I know that you can do that in VB using static variable? Is there the same thing in java? if there is not , then how can i know how many times my program runs?
ThanksWhat i am trying to do is to have a variable that
keeps its value updated when the program execuation
finishes For example
public class class1
private static int x =0;
main()
x++;
Run 1 ..... x = 1;
run 2.........x =2;
run 3........x =3
I know that you can do that in VB using static
variable? Is there the same thing in java? if there
is not , then how can i know how many times my
program runs?
ThanksCreate a class with static int x that extends Serializable, call it SaveX. Make setX and getX static methods for SaveX.
When executing your program deserialized SaveX. If the deserialization process gets an FileNotFoundException or IOException then instantiate the SaveX. That is your initial execution.
Increment x. For example:
int myX = SaveX.getX();
myX++;
SaveX.setX(myX);Serialize the class.
Each time the program is executed x will be incremented and saved. The first execution start x at zero and saves the first serialized class. -
How to define a changing variable in Broadcasting.
I would like to run bex web report in background using information broadcasting in bw 3.5. I setup all required settings and it is running fine. But I would want the broadcaster should take changing variable (example: date or fiscal period etc) based on the execution date or other condition. (please note that this is not for including date and time etc in description).
I want broadcaster should take current date or date range or fiscal period as variable (selection screen) while running the report. I have tried using filter variable tab in broadcaster. But it was taking only static dates.
pls suggest.
Thanks in advance.Could you please tell me in detail. Which user exit variable you have mentioned? I am already using user exits (code in CMOD) for variables in query and it is working fine.
Now, I want to run the same query in background using information broadcasting. When i run the query it asks for user input (for example: date etc). I enter the current date and execute the report. But I dont want to enter current date each time. Instead i want to execute them in backgroun and system should take values by itself.
Correct me if I am wrong. For this you suggested me write one more user variable where it will populate variable values for backgroun (not used in query)? pls reply.
Thanks, points assigned. -
How do I use bin variable in package without asking a user?
hi,
I would like to write an SQL but I want to use bind variable in package as a static without asking user? Like below?
I would like to ask you, below there is a emp_id variable? Is this BIND variable?
DECLARE
bonus NUMBER(8,2);
emp_id NUMBER(6) := 100;
BEGIN
SELECT salary * 0.10 INTO bonus FROM employees
WHERE employee_id = emp_id;
END;
If not, like this SQL how can define a BIND variable as static inside a code? not asking a user?
db version. 9.2.0.8
regards and thanksOracleADay wrote:
I would like to ask you, below there is a emp_id variable? Is this BIND variable?
DECLARE
bonus NUMBER(8,2);
emp_id NUMBER(6) := 100;
BEGIN
SELECT salary * 0.10 INTO bonus FROM employees
WHERE employee_id = emp_id;
END;
/In the query "SELECT salary * 0.10 INTO bonus FROM employees WHERE employee_id = emp_id" emp_id is turned into a bind variable because
if you are coding static SQL in PL/SQL then PL/SQL wil automatically use bind variables: please read http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/overview.htm#sthref145.
This can also be proved with SQL trace. The following code:
alter session set sql_trace=true;
declare
v number;
c number;
begin
select count(*) into c
from t
where x=v;
end;
show errors
alter session set sql_trace=false;generates following raw trace file section with 10G XE:
=====================
PARSING IN CURSOR #2 len=79 dep=0 uid=69 oct=47 lid=69 tim=33338762257 hv=2860574766 ad='3c10120c'
declare
v number;
c number;
begin
select count(*) into c
from t
where x=v;
end;
END OF STMT
PARSE #2:c=46800,e=329811,p=0,cr=9,cu=0,mis=1,r=0,dep=0,og=1,tim=33338762253
=====================
PARSING IN CURSOR #1 len=35 dep=1 uid=69 oct=3 lid=69 tim=33338788761 hv=3539261652 ad='3c10053c'
SELECT COUNT(*) FROM T WHERE X=:B1
END OF STMT
PARSE #1:c=0,e=216,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,tim=33338788755
=====================Edited by: P. Forstmann on 17 mai 2011 17:47
Edited by: P. Forstmann on 17 mai 2011 17:55 -
Public variables in javascript
how i can use public variables in javascript along with ADF. I am declaring a variable at the top of list but when an event is generated by ADF and i tries to access that variable, it gives me an error of undefined.
Kindly help meNot directly, but you can with this:
http://java.sun.com/products/plugin/1.3/docs/jsobject.html
See also:
http://www.codeproject.com/jscript/javatojs.asp?df=100&forumid=736&exp=0&select=700857 -
Avoid Global Public variables...
Hello Experts,
I have declared few variables in package specification (l_test , l_test_2)and i'm using across the API procedures.
But when i run the TOAD expert it says "Avoid defining global public variables in the package specification."
So i thought of moving the code from package specification to package body...
Is this a good approach and will my code work as it was working before if i declare in the body...
Plz suggest ...
Thanks...
Earlier
Package Specification Part
CREATE OR REPLACE PACKAGE PKG_TEST
AS
l_test NUMBER(1);
l_test_2 NUMBER(2);
END;New
CREATE OR REPLACE PACKAGE BODY PKG_TEST
AS
l_test NUMBER(1);
l_test_2 NUMBER(2);
PROCEDURE process
IS
END process ;
PROCEDURE process_2
IS
END process_2 ;
END PKG_TEST;Linus,
Just so you are aware, the scope of those variables are different depending on if they are defined in the PACKAGE (SPEC) or PACKAGE BODY.
Declared in the PACKAGE (Spec): Globally accessible to everything on the Schema.
Declared in the PACKAGE (Body): Globally accessible to everything with that particular Package.
So as you can see, this quite a big difference. TOAD is warning you because putting globals in the PACKAGE is a pretty sloppy coding practice that can easily lead to difficult to maintain code. While you can ignore it, I'd suggest not doing that. ;)
In fact, I'd suggest avoiding globals altogether when possible. Passing parameters may be more time consuming, but it makes it very clear what each procedure/function should be doing, and future programmers will thank you. Time you'll save on initial programming will be made up when doing maintenance. But admittedly globals are useful, just be careful when using them. Getting your code to work isn't enough; you should aim to make it clear and understandable too. -
How to define variables in toad sql script editor - newbie
I have just pull out the script of a Function and want to run it on toad SQL editor.
I am little bit confused how to define the VARIABLEs here in toad SQL editor to run my script.
SELECT
NVL(SUM(debit), 0) - NVL(SUM(credit), 0)
INTO l_accountBalance
FROM
GLP_VoucherMaster vm
INNER JOIN GLP_VoucherDetail vd ON vm.GLP_VoucherMaster_ID = vd.GLP_VoucherMaster_ID
INNER JOIN GLP_ChartOFAccounts coa ON vd.GLP_ChartOfAccounts_ID = coa.GLP_ChartOfAccounts_ID
WHERE
vm.isActive = 'Y' AND vd.isActive = 'Y'
-- *** how to define variables in toad sql script editor ***
AND vm.voucherDate < p_cDate
AND coa.AccountCode LIKE p_accountCode || '%';
Thanks
w\Just prefix with a colon (:)
SELECT NVL (SUM (Debit), 0) - NVL (SUM (Credit), 0)
INTO L_accountbalance
FROM Glp_vouchermaster Vm
INNER JOIN
Glp_voucherdetail Vd
ON Vm.Glp_vouchermaster_id = Vd.Glp_vouchermaster_id
INNER JOIN
Glp_chartofaccounts Coa
ON Vd.Glp_chartofaccounts_id = Coa.Glp_chartofaccounts_id
WHERE Vm.Isactive = 'Y'
AND Vd.Isactive = 'Y'
AND Vm.Voucherdate < :P_cdate
AND Coa.Accountcode LIKE :P_accountcode || '%';
/:p -
File Sender, Content Conversion - how to define variable length last field?
XI 3.0 SP17
With a File Sender communication channel, that uses Content Conversion - how do I define a 'variable length' last field?
The scenario - the input file has four fields, of which the first three are a known fixed length, and the last (fourth, trailing) field is variable in length.
Using a Message Protocol of 'File Content Conversion', how do I define that last variable length field (field name 'WOData' below) in the Content Conversion Parameters section?
My current parameters are:
Recordset Structure - Row,*
ignoreRecordsetName - true
Row.fieldFixedLengths - 1,12,5,99999
Row.fieldNames - WOType,WONum,WOLine,WOData
I've tried the following for 'Row.fieldFixedLengths' to no avail -
'1,12,5,*'
'1,12,5,0'
'1,12,5,'
'1,12,5'
The last two were grasping at straws )
The only thing I've got to work is specifying a 'large' value for the final field (99999 above).
In addition, does anyone know if specifying a large value (e.g. 99999) for the final trailing field will give rise to performance issues when the file is being processed?
In the help for "Converting File Content in a Sender Adapter", it states -
<Begin Quote>
NameA.fieldFixedLengths
If you make a specification here, the system expects a character string that contains the lengths of the structure columns as arguments separated by commas.
If you also specify a separator for the columns, you must not add its length to the length of the columns.
This entry is mandatory if you have not made an entry for NameA.fieldSeparator.
<End Quote>
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm<< note that fieldFixedLengths will not take any wildcard entries like *. So in these case it is ideal to provide a maximum char length. But note that while the file is being created that many spaces will be created in your file !!! >>
Hi Shabarish,
Yes, no wildcard is the conclusion I came to, hence my maximum )
The message size did not increase by any 'blank padding'. When I look in [Message Display Tool (Detail Display)] 'Audit Log for Message: X' -
2006-10-17 18:22:42 Success Channel X: Entire file content converted to XML format
2006-10-17 18:22:42 Success Send binary file "X" from FTP server "X", size 103290 bytes with QoS EO
2006-10-17 18:22:42 Success Application attempting to send an XI message asynchronously using connection AFW.
2006-10-17 18:22:42 Success Trying to put the message into the send queue.
2006-10-17 18:22:42 Success Message successfully put into the queue.
2006-10-17 18:22:42 Success The application sent the message asynchronously using connection AFW. Returning to application.
The input flat file in non-XML format was 92,132 bytes and the message payload into XI was 103,290 bytes.
My understanding is that trailing spaces are stripped from XML nodes. -
How to define variable for value range in Bex Query?
Hi
How to define variable for Keyfig. value range on runtime like characteristic in Bex Query?
Example: On runtime user select one of the following condition:
1)User want to those records where amount is greater than $1000
2)User want to those records where amount is greater than $1000 and less than $5000
3)User want to those records where amount is greater than and equal to $1000Hi ,
Need to Use exceptions & conditions for this scenario's & need to create variable for exceptions based on condtions.
Below document provides steps how to make selections at run time for a kfg.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60b33a28-dca2-2d10-f3b2-d2096b460b1e?QuickLink=index&overridelayout=true&48842368468641
Regards,
Seshu.P -
How do I set a public variable in a native ActiveX DLL using Java?
Hello,
I have run into an issue that I cannot seem to find any documentation on, and all of my efforts with search engines have returned no useful results.
Here is my situation:
I have an Active X DLL that has a very simple configuration, but it is a third party DLL which I cannot modify. To interface with the DLL I have to set a series of public variables and then call a method with no parameters that will use the current values of the variables to perform a calculation. There are no "set" or "get" methods.
At this point I have a very good idea about how to use JNI to create the class in java, and call the method. However, this does me no good at all if I cannot set the variables.
Everything I have found so far defaults to an assumption of no direct access to variables, and that getter and setter methods would be available for that purpose. Anyone know of a way that this might be handled? I would provide source code, but it seems useless unless I know how to actually do this.
Thanks in advance for any input.OK. Those are OLE/ActiveX/COM/WhateverTheyCallIt getters and setters, that VB makes look like object 'properties'.
If you are familiar a bit with C#, they also have 'properties', which are getters and setters hidden behind a syntax that makes them look like member variables.
I am affraid my help has to stop here, as I don't remember COM anymore.
But, unless you find someone who really knows COM, you will have to investigate by yourself.
One suggestion though: open a C++ project in VisualStudio 2005 or 2008 (not Express, it seems not to support what I describe).
Go to something like References or Add Reference and you will see a tabbed dialog box with a COM tab (I describe all this from memory).
Add your DLL. After this do View->Object Browser or alike. It should show your COM object. You will be able to examine its methods and properties.
I think Visual Studio canl generate code for invoking them. This is the C code that somehow you should take from there and place in your JNI code.
Edited by: baftos on May 9, 2010 11:22 AM
Correction: VS2008 Express also supports this, but to get there, you do View->Object Browser->Click the "..." button->COM tab.
VS2008 Express is free.
Edited by: baftos on May 9, 2010 11:25 AM -
How can i define a boolean variable with the condition if i got a specific text on a selected column?
Example:
my select results:
[id = 102] [Company = 'Microsoft']
If i got microsoft in 'Company' i want to my another table with the columnName "Microsoft" get "true".
Can you help me?That is called 2-table UPDATE.
Example:
http://www.sqlusa.com/bestpractices2005/updatewithcorrelatedsubquery/
Kalman Toth Database & OLAP Architect
Free T-SQL Scripts
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
How to reach public variables in a servlet from jsp
this is myclass.java servlet
public class myclass{
public String var1,var2;
public void method1() {
var1="test1";
var2="test2";
}this is my jsp page;
<%@ page import="com.xxx.albumlerim.myclass"%>
<%
myclass tester=new myclass();
tester.method1();
out.print(tester.var1);
out.print(tester.var2);
%>jsp can run the method but doesnt recognize tester.var1 and tester.var2 how can i reach this variables what i must do.?
thank you
Burak
Message was edited by:
netsoniccI may have used the term incorrectly. Basically I meant using the <jsp:include> tag to invoke a servlet directly. Then the servlet could send the output you need. That way you could keep things more modular.
So for example -- you say you have a servlet with these values. Maybe you could add some functionality to it so if it's invoked with a particular URL, it produces output displaying these values.
Then you could use <jsp:include> to invoke that new functionality via that URL.
Just an idea. -
How define a global variable in a class that all the methods will recognize
hi friends,
i need to define a global variable in a class that all the methods will recognize it.
any suggestions?
thanks,
dana.Dera Dana,
In se24, create your own "Z" class.
Open the Attributes tab.
Insert your variable in the declaration part.
EQ:
Attribute Level Visibility Typing Associated Type Description
ITAB Instance Attribute Public Type Structure name Description
In the Layout of View page,
<phtmlb:formLayoutDropDownListBox id = "Dropdown"
label = "Drop Down"
table = "<%= controller->Itab %>"
nameOfKeyColumn = "CODE"
nameOfValueColumn = "VALUE"
selection = "<%= controller->feild to be selected %>"
/>
Hope this will be helpful
Regards,
Gokul.N -
How to assign itemrender variables in global public variable of my applicaton.
Hi Friends,
How to assign internal item render values in global public variable. can u see below example.
List have one itemrender,within the itemrender i am using data grid .The dataGrid have itemrender.now i tried the data grid itemrender assign values to public variable of my application,but the Error came... How can u slove this Problem Any One can Help to me.
Example:
public var myData:arrayCollection;
<mx:List variableRowHeight="true" dataChange="validateNow()" width="900" id="Lst_userlist" verticalScrollPolicy="off" horizontalScrollPolicy="off"
buttonMode="true">
<mx:itemRenderer>
<fx:Component>
<mx:VBox paddingTop="-5" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
<fx:Script>
<![CDATA[
override public function set data(value:Object):void
]]>
</fx:Script>
<mx:VBox id="vbox_grid" horizontalScrollPolicy="off" verticalScrollPolicy="off" width="890" paddingLeft="10" paddingTop="5"
backgroundColor="#317152" color="#FFFFFF">
<mx:DataGrid visible="false" includeInLayout="false" height="100%" id="membershipGrid" alternatingItemColors="[#DCDCDC,#F8F8FF]"
paddingLeft="5" horizontalScrollPolicy="off" color="black"
horizontalGridLines="false" verticalScrollPolicy="auto" verticalGridLines="false" rowHeight="25"
borderSkin="{null}" showHeaders="true" borderVisible="false" dataProvider="{data.dataCollection}" width="900" >
<mx:columns>
<mx:DataGridColumn width="180" headerText="Name" minWidth="150" sortable="true" wordWrap="true" >
<mx:itemRenderer>
<fx:Component>
<mx:HBox horizontalScrollPolicy="off" >
<fx:Script>
<![CDATA[
override public function set data(value:Object):void
function Click_Name():void
outerDocument.myData=data; // Here Error came
]]>
</fx:Script>
<mx:Image id="fileimg" buttonMode="true" toolTip="This is the User's Home Organization"/>
<s:Label id="lbl_Gridcloumn_name" width="200" buttonMode="true" textDecoration="underline" click="Click_Name()" />
</mx:HBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</cloumn>
</datagrid>
Error:
Access of possibly undefined property myData through a reference with static type com.istmanagement.views:ProgramAcessRights_ComponentInnerClass3.
Thanks,
Magesh R.Hi Flex harUI ,
Thanks man....because of i was stugle in last one week.... once again Thanks.......
Maybe you are looking for
-
How to do Column Merge in Table View
Hi, I have a BW 3.x Query where in I need to show report in Visual Composer in such a way that Header should be mergeg under 3-4 sub column & so on is it possible in NW2004s SP12. Eg: |________CENTRAL_______| ITEM1 ITEM2 ITEM3 Regards Sw
-
Firefox will only allow intermittent access to facebook
More often then not (Although not always) when I try to go to facebook the page won't load and a page appears saying "The connection has timed out The server at www.facebook.com is taking too long to respond." I have tried clearing caches and cookies
-
Custom tab missing from Create Site template selection section in SharePoint 2010
Background:I migrated from SP 2007 to SP 2010. ISSUE: my custom templates are visible in the Gallery list but when i try to create a new site the Custom tab selection is missing. What am i doing wrong?
-
Error in custom Web Service: DATREF_NOT_ASSIGNED
I have created a new BO and Web Service. There is only one required element in the BO, but unless I make the Create call with all elements populated with a value, I get a DATREF_NOT_ASSIGNED error. Ideas?
-
Newbie Video production synchronised with a tune (BPM/frame per beat)
Hello, I wish to throw my audio track on a timeline, and have a grid allowing me to see the rythm/beats... that way I can just throw video sequences, trim and loop with help of the grid to be perfectly synchronised with the tune! do you see what I me