Use a String to get data from a variable?
Hi, I've got a major problem, I need to get data (int []) from a variable, using a String with the name of the variable..
Does anyone know if this is possible?
public class Commands {
private static final int[] deploy_1 = {64,37,73,1};
private static final int[] deploy_2 = {4,167,6,51};
/** Creates a new instance of Commands */
public Commands() {
public int[] get(String name)
// what code here?
}I should be getting the data with
int[] command = Commands.get("deploy_1");
or something like that...
Please help me!
FYI, a hashtable is not a option!
Many thanks, Vikko
java.lang.NoSuchFieldException: deploy_1
at java.lang.Class.getField(Class.java:1507)
at dumb_commandstest.Commands.get(Commands.java:30)
at dumb_commandstest.Main.getData(Main.java:36)
at dumb_commandstest.Main.<init>(Main.java:21)
at dumb_commandstest.Main.main(Main.java:28)
Any ideas why I get a NoSuchFieldException?
deploy_1 does exist.
Similar Messages
-
Using xml iView to get data from URL generating rss feeds
hi,
I have a URL
http://xml.weather.yahoo.com/forecastrss?p=USCA1116
from the yahoo weather site.
It opens XML data.
I then created an XML iView in the following way:
In step 3 in XML source; i typed the above URL. Clicked on Next.
In Step 4 for Selected XML translation format I chose MY_RSS_TO_XHTMLB.
When I preview it gives the message : Error while using XML iView, please contact your system administrator.
I have Portal SP14.
So as mentioned before in a forum, I went to System Administration -> System Configuration -> Service Configuration -> Applications -> com.sap.portal.ivs.httpservice-> proxy
and changed "HTTP Proxy Host" to "proxy" and "HTTP Proxy Port" to 8080.
Then to re start I right clicked com.sap.portal.ivs.httpservice, went to Administrate and restarted the services.
But I still get the same message
Error while using XML iView, please contact your system administrator.
Can you please let me know if these 2 settings are correct.
thx.Hi,
Could you please let me know if you were able to solve this issue. Inspite of all the suggested configuration we are still getting the same error, as stated by you.
Anyone able to overcome this issue, please reply. Also let me know if we need to consider any specific versions of portal & browser, JRE etc..
Thanks,
KSK -
How to use Substr & Instr to get data from a file
hi i have a Scenario
i am getting a file like this
1,20,ram,sales
i am getting a file like this data as a column
i want to split this data in 4 different column like
1 20 ram SalesHi,
this query will help you.
select
SUBSTR(C1,0,INSTR(C1,',')-1),
SUBSTR(C1,INSTR(C1,',')+1,INSTR(C1,',',1,2)-INSTR(C1,',',1,1)-1),
SUBSTR(C1,INSTR(C1,',',1,2)+1,INSTR(C1,',',1,3)-INSTR(C1,',',1,2)-1),
SUBSTR(C1,INSTR(C1,',',1,3)+1,INSTR(C1,',',1,4)-INSTR(C1,',',1,3)-1),
SUBSTR(C1,INSTR(C1,',',1,3)+1)
from (
select '1,20,ram,sales' C1 from dual
remember that a comma isn't really safe as field separator
Message was edited by: DecaXD -
How to use JDBC iView to get data from MSSQL
Hi Guru,
I just try to follow the Demo (from SDN) to use JDBC iView. In the step of selecting query or existing function, I choose the query option to broswer the table. But the system is not display any tables. It just keep on displaying 'Loading ...'. Is there anything wrong with that?
Thanks for your help,
BoHi Bo,
I got the same problem with your, do you know how to fix the problem?
Thanks,
Ku -
I have installed migration assistant on the pc. I am running it as administrator. It says waiting to connect to Mac. I am running MS on the macbook pro (brand new) and it found the machine but keeps saying looking for other sources and I can't move ahead. Any ideas?
Resolved. Someone told me verbally what to do.
-
Best way To get data from another application using NDDE lbrary
My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
This is my code:
l : is the list of stocks.
This Sub connects to server and requests the data :
Public Shared Sub GetQuotes()
Try
client1 = New DdeClient(server, topic)
client1.Connect()
For i As Integer = 0 To l.Count - 1
client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
This the client_Advise Sub:
Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
For q As Integer = 0 To l.Count - 1
If l(q).t = w(1) Then
Dim item() As String = e.Item.Split("$")
If l(q).Open = "#" Then
l(q).Open = "0"
End If
If l(q).hi = "#" Then
l(q).hi = "0"
End If
If l(q).lo = "#" Then
l(q).lo = "0"
End If
If l(q).Close = "" Or l(q).Close = "#" Then
l(q).Close = "0"
End If
If l(q).pclose = "#" Then
l(q).pclose = "0"
End If
If item(1) = "open" Then
l(q).Open = Format(Val(e.Text), "0.00")
ElseIf item(1) = "last" Then
l(q).Close = Format(Val(e.Text), "0.00")
ElseIf item(1) = "high" Then
l(q).hi = Format(Val(e.Text), "0.00")
ElseIf item(1) = "volume" Then
l(q).Volume = Val(e.Text)
ElseIf item(1) = "low" Then
l(q).lo = Format(Val(e.Text), "0.00")
ElseIf item(1) = "pclose" Then
l(q).pclose = Format(Val(e.Text), "0.00")
If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
End If
l(q).flag1 = 2
ElseIf item(1) = "date" Then
l(q).Date1 = e.Text
ElseIf item(1) = "time" Then
l(q).Time = e.Text
End If
Exit For
End If
Next
End Sub
Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
Thanks in advance.Hi MikeHammadi,
According to your description, you'd like to get data from another app using NDDE library.
When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
If you have any other concern regarding this issue, please feel free to let me know.
Best regards,
Youjun Tang
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. -
Help needed with variable - trying to get data from Oracle using linked svr
Sorry if I posted this in the wrong forum - I just didn't know where to post it.
I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
Here's how I would get the variable in SQL:
declare @maxkey INTEGER
select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
the select statement I need to do in oracle would use that variable like this:
select * from OPENQUERY(OracleLinkedServer,'select
* from ORACLEDB.TABLE where keyfield > @maxkey')
and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?Please refer the example in this link which deals with Oracle date format.
You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804] -
How can i get data from another database SQL Server use database link from
I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?
hi,
u should see following documentation:
Oracle9i Heterogeneous Connectivity Administrator's Guide
Release 1 (9.0.1)
Part Number A88789_01
in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
regards
umar -
How to get data from Oracle using Native SQL in SAP.. Problem with date
Hi Masters.
I'm trying to get data from an Oracle DB. I was able to connect to Oracle using tcode DBCO. The connetion works fine
I wrote this code and it works fine without the statement of where date > '01-09-2010'
But i need that statement on the select. I read a lot about this issue, but no answer.
My code is (this code is in SAP ECC 6.0)
DATA: BEGIN OF datos OCCURS 0,
id_numeric(10),
component_name(40),
comuna(10),
record_id(10),
status,
sampled_date(10),
END OF datos.
DATA: c TYPE cursor.
EXEC SQL.
connect to 'LIM' as 'MYDB'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'MYDB'
ENDEXEC.
EXEC SQL PERFORMING loop_output.
SELECT ID_NUMERIC, COMPONENT_NAME, COMUNA, RECORD_ID, STATUS, SAMPLED_DATE
into :datos from lims.SAMP_TEST_RESULT
where date > '01-09-2010'
ENDEXEC.
EXEC SQL.
disconnect 'MYDB'
ENDEXEC.
How can i get the data from that date?? If i delete the where statemet, the program works well, it takes 30 mins and show all the data, I just need the data from that date.
Any help
RegardsPlease refer the example in this link which deals with Oracle date format.
You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804] -
How do i get data from a structure using join?
hi,
what is the actual use of a structure.?
my problem is :
KUAGV is an existing STRUCTURE. it has got one fields each which links to MARA, AND VBKD tables. i want to fetch all related information from KUAGV, mara, vbkd . which is the better way : using joins or views or anything else? how do i
get data from a structure using join?structure temporarily holds any data passed to it dynamically throughout the runtime but doesnot store it permanently. so
a structure cannot be included in a join.so instead of incuding structure KUAGV's field in a join
search the transparent table in which same field are present and use it in join.
A structure if created in DDIC(Data Dictionary) is a global DATA STRUCTURE which is used to group related information, for example you would group all the details of your bank account into a structure BANK_ACCOUNT that contains fields like account_Id, account_holder_name etc.
If you create a structure in your program then it is local to your program. So you use this structure to create data holders of this DATA TYPE to hold data in your program.
Edited by: suja thomas on Feb 11, 2008 6:24 AM
Edited by: suja thomas on Feb 11, 2008 6:31 AM -
How to get data from a USB-UIRT device using Labview?
How to get data from a USB-UIRT device using Labview?
I'm trying to get data from a USB-UIRT device, is it posible with Labview?
I really appreciate your help,
thanksYou may want to contact the developer of the device for the API and DLL.
http://65.36.202.170/phpBB2/viewforum.php?f=3 -
Trying to use FTP to get data from a different server
Hi Friends,
I have to use FTP to get data from a different server and upload it on SAP server. Now my problem is when I m trying to do ftp through command line it brings the file but with no data.
Through ABAP program nothing is happening.
Here's my code--
V_PASSWORD = 'test@123'.
V_PWD_LEN = STRLEN( V_PASSWORD ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = V_PASSWORD
SOURCELEN = V_PWD_LEN
KEY = CS_KEY_500098
IMPORTING
DESTINATION = V_PASSWORD.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
USER = 'test'
PASSWORD = V_PASSWORD
HOST = '176.0.1.6'
RFC_DESTINATION = 'SAPFTPA'
IMPORTING
HANDLE = MI_HANDLE
EXCEPTIONS
NOT_CONNECTED = 1
OTHERS = 2.
CHECK SY-SUBRC = 0.
cmd = 'lcd d:\ftp'. .
PERFORM FTP_COMMAND USING CMD.
CMD = 'asc'.
PERFORM FTP_COMMAND USING CMD.
CONCATENATE 'dir' 'ftpt*' INTO CMD SEPARATED BY SPACE.
PERFORM FTP_COMMAND USING CMD.
cmd = 'ls'.
concatenate 'ls' INTO CMD SEPARATED BY SPACE.
PERFORM FTP_COMMAND USING CMD.
cmd = 'mget trial.txt'.
CONCATENATE 'mget' 'trial.txt' INTO CMD SEPARATED BY SPACE.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = MI_HANDLE
COMMAND = CMD
TABLES
DATA = MTAB_DATA1
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0.
LOOP AT MTAB_DATA1.
WRITE: / MTAB_DATA1.
ENDLOOP.
ELSE.
CONCATENATE 'Error in FTP Command while executing' CMD INTO ERROR SEPARATED BY SPACE.
WRITE: / ERROR.
ENDIF.Hi
try this.....in one of my reqt, i done this successfully....
FORM FTPCON.
FTP-------------------------------------------------------*
CLEAR DSTLEN.
SET EXTENDED CHECK OFF.
DSTLEN = STRLEN( S_PWD ). -
> (S_PWD (password) is a selection screen field )
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = S_PWD
SOURCELEN = DSTLEN
KEY = KEY
IMPORTING
DESTINATION = S_PWD.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
USER = P_USER -
> Username
PASSWORD = S_PWD -
> password
HOST = P_HOST -
> Host
RFC_DESTINATION = P_DEST -
> Destination
IMPORTING
HANDLE = HDL
EXCEPTIONS
NOT_CONNECTED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = HDL
COMMAND = 'set passive on'
TABLES
DATA = RESULT
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = G_FCNAME
CHARACTER_MODE = 'X'
TABLES
TEXT = T_FILE1
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = G_FCNAME1
CHARACTER_MODE = 'X'
TABLES
TEXT = T_FILE2
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
HANDLE = HDL.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
DESTINATION = P_DEST
EXCEPTIONS
DESTINATION_NOT_OPEN = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " FTPCON
Hope it helps..... -
Using Get Data From Aggregation event class in SQL Profiler - SSAS 2012
Hi,
I'd like to understand better the use of the Get data from aggregation event class in SQL Profiler to monitor a MDX query and which info provide. Fe, does it return the MDX query? Is it possible to use this event class in order to monitor MDX query vs a
Tabular model?
In the TechNet documentation, this event class is handled briefly.
ThanksHi pscorca,
This event is raised when the storage engine reads data from an aggregation, it may have a negative impact on performance when turned on. If you need to monitor SSAS instance status, we can also use dynamic management view:
Use Dynamic Management Views (DMVs) to Monitor Analysis Services:
http://msdn.microsoft.com/en-us/library/hh230820.aspx
Regards,
Elvis Long
TechNet Community Support -
Get data from more than 1 subtype using RP_PROVIDE_FROM LAST
Hi all,
I need to get data from infotype 2013 subtype 90 and subtype 91.
Currently the codes only allow me to use it one time for the same infotype. If I use it again for the same infotype, pnp-sw-found will equal to zero. Anyone have any idea on this?
Example:
Get pernr.
Start of selection.
rp_provide_from_last p2013 0090 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE p2013-ktart TO ls_quota-ktart.
MOVE p2013-aedtm to ls_quota-aedtm.
MOVE p2013-uname to ls_quota-uname.
MOVE p2013-accnu to ls_quota-accnu.
MOVE p2013-accop to ls_quota-accop.
ELSE.
REJECT.
ENDIF.
End of selection.Using RP_PROVIDE_FROM_LAST you can only use for one infotype and one subtype. For reading data for IT2013 with subtypes 90 and 91....you have to use following....
Get pernr.
Start of selection.
rp_provide_from_last p2013 0090 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE:
p2013-ktart TO ls_quota-ktart,
p2013-aedtm to ls_quota-aedtm,
p2013-uname to ls_quota-uname,
p2013-accnu to ls_quota-accnu,
p2013-accop to ls_quota-accop.
ELSE.
rp_provide_from_last p2013 0091 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE:
p2013-ktart TO ls_quota-ktart,
p2013-aedtm to ls_quota-aedtm,
p2013-uname to ls_quota-uname,
p2013-accnu to ls_quota-accnu,
p2013-accop to ls_quota-accop.
ELSE.
REJECT.
ENDIF.
ENDIF.
End of selection.
Hope this answer is helpful -
Hi ,
I have a site that runs on Claims Mode ( NTLM) . That site has a web part that needs to show the data from any sharepoint farm, SharePoitn 2010 , or 2007 or 2003.
I am getting 401 unauthorized when I try to get data from webservice running in sharePoint context.
But when I run the same code in Windows Console application then it is giving no error.
What I doubt is that this issue is due to the reason that I have set
claims mode authentication.
Because same code is running in different farm in a site that is configured using windows authentication.So generally speaking, you're talking about a VERY long running topic of authentication methods... and generally speaking, in the world of Windows, the only long running authentication options have been:
- NTLM (limited to one hop)
- Kerberos (unlimited hops)
- Application level authentication (ex: SQL auth, also, no hops)
Recently, Microsoft has been investing in Claims Based Auth... and I fully expect claims to start working their way into other systems (previously starting to work into Windows via the CardSpace technology, but also in other ways such as Win8's ability to
log in with a LiveID)... but building a new authentication method into ALL applications is a VERY long process, and the complexity of claims adds a LOT of consideration (claims from the same AD can look VERY different depending on the STS, so lots of questions
around things like bridging claims).
So as far your SP auth needs...
IF both applications are CLAIMS AWARE, then you MAY be able to use claims (which support unlimited hops)... but that's just not very likely yet (and will probably take another 5-10 years to be available across the entire enterprise)... otherwise, KERBEROS
Outside of the Microsoft world... KERBEROS is open spec, so is supported by other systems (such as authenticating to linux)... claims based auth is also open spec, but again, still new... there are a few other options (LDAP, etc), but none that are native
to Windows (so you rely on things like third party auth modules for Windows, which Novell has done for DECADES with NDS and eDir)
And again, SharePoint can convert claims to Kerberos using the C2WTS... which MS uses internally for things Excel Services connecting to a backend SQL server... but it DOES require the Kerb and C2WTS configuration.
if you're having issues using Kerb auth... then it sounds like Kerb isn't configured correctly... and Kerb is a PAIN to configure (whitepaper for SP Kerb is ~100 pages long)... IIS (and SharePoint) also has the added benefit of failing over to NTLM if Kerb
fails (and you shouldn't disable this behavior, since it'll break other settings elsewhere)
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs
Maybe you are looking for
-
HT1349 I can no longer print from my iPad to air print
I have a iPad 2 that I was able to print from when I first set up my HP Photosmart B 210. I did change the printer email address . My husband can still print from his iPhone but I cannot print from either of my wireless devices Thanks
-
Xorg 1.8 moves to extra
2010-06-20 - Andreas Radke This release works with udev for input hotplugging and supports /etc/X11/xorg.conf.d/*.conf as a replacement for the hal .fdi files. After upgrading to this release, configuration for input devices in hal is ignored. Docume
-
Cannot upload videos into itunes library!
sorry if this is the wrong place to post or something, but i'm in desperate need of help! i can't seem to upload any of my own videos into itunes video library. i heard that i'm supposed to drag the file into the library but when i do that it just st
-
Hi Anybody help me to found out the user exit for the transaction V/08. Thanks and Regards Bharathi
-
Need to click on first FLASH movie to reactivate after second window
Hi there... I am hoping there is a simple code-solution out there to work around the following problem: I am building a mainly flash-base website that also incorporates a couple of pages of straight XHTML for some of the content. If I navigate from m