Assign value to final
i have a field declared final, such as final File db; and i have a method of a class shell that initilize db,
but compiler wont let me, i guess this because that compiler cannt tell if db will be given values more than once during the execution of the program, are there any ways i can go around this? many thanks!
i d like to make sure that only one database is open while the shell is running, and i need to record the pathname of this database, so i set this field final. and i want to initilize it in a method called openDatabase.
Similar Messages
-
Assigning value to a variable in Script Component.
I'm pretty new to SSIS development and need to figure out a problem with assigning a value to a user defined variable. I created a pretty simple package. It reads a flat file, extracts date from a header record and subsequently uses derived column component
to reformat data to the desired output format. One of the columns (FileRunDate,
string, length 8) in the derived component is defined as a string and in the expression I'm assigning it to a variable I set earlier in the script component -
@[User::vRunTimeDate]. When the process runs, the output file gets generated, however FileRunDate reflects
originally set varible's value. It seems that the variable assignment in the script task does not work, even though in the debug mode, I do see how the value is being set. The variable has an attribute of ReadWrite. Is it due to the fact that the value is
being set in the same workflow?
Any feedback is greatly appriciated.Unfortunately I'm unable to add a screenshot of the process, for some reason I get an error message when I try to do that. In a nutshell the entire workflow consist of flat file source component, following by a script component (this is where I read and
assign the variable)
public override void PostExecute()
IDTSVariables100 vars;
base.PostExecute();
// Set run date
if (strRunDate != null)
VariableDispenser variableDispenser = (VariableDispenser)this.VariableDispenser;
variableDispenser.LockForWrite("User::vRunTimeDate");
variableDispenser.GetVariables(out vars);
// Set the variable
vars["User::vRunTimeDate"].Value = strRunDate;
//Unlock the variable
vars.Unlock();
//Variables.vRunTimeDate = strRunDate;
then goes conditional split ( filtering out unwanted records), which is connected to a derived column component (this is where one of the columns get assigned a variable's value), one more script component (this where I identify
specific data element and do a replace command) and finally flat file destination.
BTW, the article in the provided URL clearly states that variable won't reflect assigned value till the entire workflow has finished. If that's the case, then I think I know my
answer. Is there is such a thing as putting execution of different steps in a different step, so anything executed subsequently will see that value? -
Assigning value bands to numbers
Hi there,
I want to write a query to assign value bands to revenue. Here is the value bands table that I have:
I tried to use a DLookup function as follows:
COMB_VALUE_BAND: DLookUp("[Alias]","LOOKUP_VALUE_BAND",[REV_NET]>=[LB] And [REV_NET]<=[UB])
Needless, it does not work. What should I do?
Many thanks for help.Here are the values in LOOKUP_VALUE_BAND.
VB
LB
UB
Alias
A
0.00
700.00
VB1
B
700.00
1,100.00
VB2
C
1,100.00
1,500.00
VB3
D
1,500.00
1,900.00
VB4
E
1,900.00
VB5
That's not going to work. The lb values must be distinct from the uv values, i.e. each of the latter must be greater than the former, e.g.
A 0.00 700.00 VB1
B 700.01 1,100.00 VB2
and so on
And the final row:
E 1,900.01 VB5
should have an artificially high value in the ub column.
Ken Sheridan, Stafford, England -
Assigning value to array type variable in a loop
Hi
I have a scenario in which i am assigning value from a array type variable(x) to the invoke variable of a database adapter. The variable x is exact replica of the invoke variable.
My copy operation in assign activity looks like this-
<copy>
<from variable="Var" part="InputParameters"
query="/ns7:InputParameters"/>
<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
part="InputParameters"
query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
</copy>
It is inside a while loop activity.
PS *()* are square brackets
But it is erroring out at run time.
Does anybody has an alternate idea to assign value to an array type?.
i have seen that while extracting value from an array type variable it works fine
A similar kind of operation is shown below.
<copy>
<from variable="Var" part="InputParameters"
query="/ns7:InputParameters *(* bpws:getVariableData('iterator') *)* "/>
<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"
part="InputParameters"
query="/ns7:InputParameters"/>
</copy>
Thanks
Ayush
Edited by: Ayush fujitsu on Aug 14, 2009 4:36 AMHi Ayush
I suppose you are getting some error like "source node returns multiple elements".
In second case there is no problem because you are assigning *InputParameters[bpws:getVariableData('iterator')]* (+suppose InputParameters[1]+) to target. Here it works fine because you are fetching oonly 1 value from source and assigning it to the target.
Now in first case you are saying copy InputParameters to target[1] suppose. You know that source is an array which contains multiple index so which index field from the source will be assigned to the target.
Try your process with only 1 source value it will work but when multiple values will be there it will fail. You have to merge both the cases and it will look like
*<copy>*
*<from variable="Var" part="InputParameters"*
query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
*<to variable="Invoke_call_XXDPI_EDI_852_PKG_InputVariable"*
part="InputParameters"
query="/ns7:InputParameters ( bpws:getVariableData('iterator') ) "/>
*</copy>*
And the easiest way to do this is by the transform activity as said above.
Regards
Suryaveer
Edited by: Suryaveer on Aug 15, 2009 11:19 PM -
BP Transaction : Assign values to fields upon selection of BP role ?
Hi All,
I want to assign values to Grouping and Account Group fields in BP transaction in CRM.
Is there any BADI or Userexit to achive the same. If possible kindly explain the steps to be implemented to use the BADI.
Thanks & Regards,
Navneeth K.Hi Navneeth,
There are 2 ways to approach this :
1. You can create an application transaction for the standard transaction BP. This will open the transaction in whichever role you require, default a groupng, and allow you to control some other initializaittion parameters. This is very similar the transaction variant mentioned above by Adil.
You can explore 'Application Transactions' through SPRO->Cross Application>SAP Business Partner-> Business Partner> BAsic Settings>Business Partner Roles>Define Application Transactions.
2. To default grouping , you can use BADI BUPA_NUMBER_GROUP. THe BADI will receive the list of groupings that will be shown in the dropdown .Write the implementation so as to remove unwanted groupins and keep only the number groupig you wish to default.
Hope this helps.
Cheers,
Rishu. -
Can we assign value to a variable in PL/SQL Loop
Hi
Can we assign value to a variable in PL/SQL Loops?
DECLARE
V_Num NUMBER;
BEGIN
LOOP
V_Num := 10;
DBMS_OUTPUT.put_line(V_num);
V_Num := V_Num - 1;
EXIT WHEN V_Num = 0;
END LOOP;
END;
In the above program, Can we assign V_num with a value 10????????
Thanks & Regards,
Hari Babu
Edited by: 1004977 on Jun 5, 2013 2:40 AMHi,
1004977 wrote:
Hi
Can we assign value to a variable in PL/SQL Loops?
DECLARE
V_Num NUMBER;
BEGIN
LOOP
V_Num := 10;
DBMS_OUTPUT.put_line(V_num);
V_Num := V_Num - 1;
EXIT WHEN V_Num = 0;
END LOOP;
END;
In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
After that, v_num is set to 10 - 1 = 9.
Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.) -
Assign value to a record in a loop?
I have the record as following:
TYPE Curr_Select_Rec IS RECORD
ser_date date,
blk_route varchar210)
p_select Curr_Select_Rec;
How do I assign value to it in a loop?
I know I can do this
p_select.blk_route := 'aaaa';
but in the loop
Loop
How??????
end loop;
NEXT, LAST, FIRST Did not work
nullHi,
here a little package I wrote to select a table into a plsql_table and to work with the pl/sql table .
Package STIL_utils
IS
type r_export_tags is record
(bezeichnung stilvorlagen.bezeichnung%TYPE,
start_tag stilvorlagen.text_beginn%TYPE,
end_tag stilvorlagen.text_ende%TYPE);
type t_export_tags is table of r_export_tags
index by binary_integer;
procedure fill_tag_table(p_export_tags in out t_export_Tags,
p_export_typ in varchar2);
procedure show_tag_table(p_export_tags in t_export_Tags);
procedure find_tag(p_export_tags in out t_export_tags,
p_export_typ in varchar2,
p_tag_typ in varchar2,
p_start_tag in out stilvorlagen.text_beginn%TYPE,
p_end_tag in out stilvorlagen.text_ende%TYPE);
END; -- Package Specification UTL_STIL
Package Body STIL_utils
IS
-- Stilvorlagen Array
procedure show_tag_table(p_export_tags in t_export_tags)
is
v_index number;
v_index_last number;
begin
v_index := p_export_tags.first;
v_index_last := p_export_tags.last;
loop
dbms_output.put_line(p_export_Tags(v_index).bezeichnung);
dbms_output.put_line(p_export_Tags(v_index).start_tag);
dbms_output.put_line(p_export_Tags(v_index).end_tag);
exit when v_index = v_index_last;
v_index := p_export_Tags.next(v_index);
end loop;
end;
procedure fill_tag_table(p_export_tags in out t_export_Tags,
p_export_typ in varchar2)
is
cursor tags is
select bezeichnung,text_beginn,text_ende
from stilvorlagen
where bezeichnung like p_export_typ| |'_%'
and loesch_kz is null;
v_count number := 0;
--Prozedur zur Ermittlung welche Tags verwendet werden sollen.
-- Aus der Tabelle Stilvorlagen wird ein Array mit den Start und
--Ende Tags des entsprechenden Export Typs gef|llt.
begin
for rec in tags
loop
p_export_tags(v_count).bezeichnung := rec.bezeichnung;
p_export_tags(v_count).start_tag := rec.text_beginn;
p_export_tags(v_count).end_tag := rec.text_ende;
v_count := v_count + 1;
end loop;
--show_tag_table(p_export_tags);
end;
procedure find_tag(p_export_tags in out t_export_tags,
p_export_typ in varchar2,
p_tag_typ in varchar2,
p_start_tag in out stilvorlagen.text_beginn%TYPE,
p_end_tag in out stilvorlagen.text_ende%TYPE)
is
v_index number;
v_index_last number;
v_bezeichnung stilvorlagen.bezeichnung%TYPE;
begin
v_index := p_export_tags.first; --Arrayindex setzen
v_index_last := p_export_Tags.last; --Abbruchkriterium ermitteln
p_start_tag := null;
p_end_tag := null;
loop
v_bezeichnung := p_export_tags(v_index).bezeichnung;
-- Ist das der richtige Tag?
if v_bezeichnung = p_export_typ| |'_'| |p_tag_typ then
p_start_Tag := p_export_tags(v_index).start_Tag;
p_end_Tag := p_export_tags(v_index).end_Tag;
-- Tag gefunden also raus
exit;
else
-- Wenn alle getestet, dann raus
exit when v_index = v_index_last;
-- Ndchstes Feld aus Array
v_index := p_export_Tags.next(v_index);
end if;
end loop;
end;
END; -- Package Body UTL_STIL
Hope that helps
Detlev
null -
How can i assign value to the certain field in dynmic table ?
i have created a dynmic table .now i want to assign value to the certain field,how can i do that?
for eg,
<dyn_table> contains fields of name age ,now i want assign 'jack' to this internal talbe's field name ,Hi,
try this:
FIELD-SYMBOLS: <GT_ITAB> TYPE TABLE,
<GS_ITAB>,
<FS>, <FS1>.
DATA: GT_DATA TYPE REF TO DATA.
DATA: GS_DATA TYPE REF TO DATA.
START-OF-SELECTION.
CREATE DATA GT_DATA TYPE TABLE OF PA0002.
ASSIGN GT_DATA->* TO <GT_ITAB>.
CREATE DATA GS_DATA LIKE LINE OF <GT_ITAB>.
ASSIGN GS_DATA->* TO <GS_ITAB>.
ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
<FS> = 'Smith'.
ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS>.
<FS> = 'Paul'.
APPEND <GS_ITAB> TO <GT_ITAB>.
ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
<FS> = 'Jones'.
ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS>.
<FS> = 'Martin'.
APPEND <GS_ITAB> TO <GT_ITAB>.
LOOP AT <GT_ITAB> INTO <GS_ITAB>.
ASSIGN COMPONENT 'NACHN' OF STRUCTURE <GS_ITAB> TO <FS>.
ASSIGN COMPONENT 'VORNA' OF STRUCTURE <GS_ITAB> TO <FS1>.
WRITE: / <FS>, <FS1>.
ENDLOOP.
Regards, Dieter -
Dynamically assign value to a column in ALV LIST Display
Hi all,
How can I dynamically assign value to a column in ALV LIST Display without using classes and methods?
Thanks,
RidhimaHi Vikranth,
I am displaying one ALV list say with columns A and B.
I have value in A but not in B. Now at runtime user selects one row, clicks on push button in application toolbar, then i have to display value in column B in the already displayed list.
I searched and came to know it can be done with oops concept. but i am not using classes and methods.
so how can i do this?
Thanks,
Ridhima. -
Assigning value to variable in ODI
Hi
TotalCount(datatype is numeric)--->Action is (Latest value)
And i want to assign value it by using following query
select count(*) from Investment_ato
i am writing this in a refresh tab
And i am using this variable in another variable(var_account)
but value of TotalCount variable is not coming in var_account
so plz suggest regards the same
thanksYou can set the refreshing mode in the variable var_account and in the refreshing tab put the query as: select #TotalCount from dual.
Hope it helps! -
Is there a way to assign value to variable
of data type ITEM? In other words, I need to
assign value to an item, where I just know the
it_id.
In the following procedure p_item is unknown until runtime;
and if it_id is not null then assign some value to the item.
procedure update_item(p_item)
is
it_id item := find_item('block1.'||p_item);
if not id_null(it_id) then
it_id := 'some_value'; --doesn't work.
end if;
end;Do you mean you know the name of the item and you want to then assign a value?
If so then use the COPY command which allows you to assign a value to a named variable
e.g.
COPY (12345, 'blocka.number_item1');
To read the value in the same way use the NAME_IN function.
There is plenty in the forms helps about this.
Mark -
Assigning value to an input account
Hi,
We have an input account in our Account dimension. In the rule file (maybe in the consolidation routine) can we write a code which assigns a value to an input account. The assigned value maybe another account value or a static value based on a logic.
ThanksIf by "input account" you mean a leaf-level account that has no children, the answer is "yes", but with a qualification. In normal circumstances, for the rule to post the value to the account it needs to have the "IsCalculated" parameter set to "Y". This means the account can no longer have data posted to it via FDM, grids or forms.
The other possibility is the use of allocation functions &/or routines but this is an area I have not explored personally in HFM. -
Assigning Value To An Application Item via JS
Hi guys,
I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
else if(action=="ASSIGN")
var moname = $(el).children("td[headers='SOURCE']").text();
$s('F10_SELECTED_OBJ',moname);
alert($v('F10_SELECTED_OBJ'));
ThanksHi
>
I am trying to assign a value to an application item by using javascript. But I can't do this when I try to display with alert the result is empty. Do you have any idea how can I assign value to an application item by using javascript?
>
Scope of JavaScript is the HTML DOM in the browser. The Application Items do not exist in the HTML DOM, only in the session state.
This explains what you observer. To set the App Items using JS you have to use an AJAX call to an OnDemand Application Process that sets the Application Item using PL/SQL. Or, call a procedure over http and set the App Item in that procedure after setting the Workspace / Security Group Id.
Regards, -
Assigning value to field in proxy report
Hello,
I am writing the abap report for sproxy.
The link to the field in structure is very long.
e.g. it-fault_message_mt-request-calldata-requester-gid = 'Z12345'.
In the structure one field in calldata is ADDITIONAL_ATTRIBUTE which is of table type.
I want to assign values to the fields of ADDITIONAL_ATTRIBUTE.
When I click on field ADDITIONAL_ATTRIBUTE we can see line type ZFAULT_MESSAGE_ADDITIONAL_ATTR and this line type is having NAME as on of the field.
I want to pass value to field NAME.
Regards,
NeelambariHi,
Create a work area as line type. and loop at table type into work area.
*wa like line type
*loop at table_type into wa.
*wa-name = Value.
*append wa to target table type.
****target table type structure should be same as that of source table type. *****
Sachin -
Hi,
I created 2 UDF's in PO header. When I assign values to the UDF's only one UDF gets the value.
Below is my code:
Dim UDF1 As SAPbouiCOM.EditText = frmUDF.Items.Item("U_UDF1 ").Specific
Dim UDF2 As SAPbouiCOM.EditText = frmUDF.Items.Item("U_UDF2").Specific
UDF1.Value = "100"
UDF2.Value = "101"
Is there something worng with my code?
Regards,
XcubeHi,
Instead use the code below to set the value
SAPbouiCOM.DBDataSource oDBs_Head;
oDBs_Head = oForm.DataSources.DBDataSources.Item("@TableName");
oDBs_Head.SetValue("U_DF1", 0, "100" );
oDBs_Head.SetValue("U_DF2", 0, "200" );
regards:
Sandy
Edited by: Sandeep Saini | Roorkee | India on Feb 5, 2010 2:01 PM
Maybe you are looking for
-
SAProuter for Jco between Java and ABAP stack
When configuring Jco at Java only, there is an option to use SAProuter. This is not for SMP download or OSS support. So is there any document for this kind of SAProuter usage? Thanks!
-
Mail app itself stutters and is very slow.
I installed Lion today with little problems until now. My Mail app (v 5.1) is excruciatingly slow. Scrolling up and down the list of emails shows to have a 1 to 3 second delay. If I closed out of the app and went back in to it, it would take minut
-
Recieving press MouseEvents immediately after release MouseEvents
When I release the mouse with this code, it receives a MouseEvent that says it's released, and then immediately afterward one that says it's been pressed again. This is the code that processes the press events... (I am fully aware of how awful it is)
-
Macbook Pro won't sleep after installing Lion
Hi, I have just installed Mac OSX Lion last night. Everything worked out fine until I realized that everytime I close the Lid or Press Sleep from the Apple menu, it will not actually Sleep. After I open up the lid, I actually have to press the bright
-
PL/SQL Sort an array Oracle 10g
Does Oracle 10g have a built in method to sort an array (collection)?