Syntax Error with creating object
Hi,
I am getting the following syntax error in the code below:
non-staic variable this cannot be referenced from a static context
job[ ] thread = new job(20);
non-staic variable this cannot be referenced from a static context
thread[index] = new job(index);
public static void main (String[ ] args) {
job[ ] thread = new job(20);
for(int index=0; index < 20; index++) {
input1[index]=index;
input2[index]=index*2;
for (int index=0; index < 20; index++) {
thread[index] = new job(index);
thread[index].start();
Zulfi.
Declare the nested class 'job' as static. Like "static class job" etc.
Similar Messages
-
Syntax Error after creating enhancements for subroutine
Problem:
Creating enhancement sections gives a syntax error when creating enhancement options and implementations for a subroutine and then ceating enhancement options and implementations for the call to that same subroutine.
<p>
Syntax Error:
"Different number of parameters in FORM and PERFORM (routine: SET_LAYOUT, number of formal parameters: 2, number of actual parameters: 1)
</p>
<p>
Here's the following scenario:
</p>
<p>
A subroutine is defined in a program.
The subroutine is called within the same program.
</p>
<p>
I then executed these steps:
<br> 1. Defined an enhancement section around the subroutine definition
<br> 2. Defined an enhancement section around the subroutine call.
<br> 3. Implemented the enhancement section around the subroutine definition and add an additional parameter.
</p>
<p>
Currently, this gives a syntax error as expected, since the call to the subroutine needs 1 more parameter.
</p>
<p>
4. Implemented the enhancement section for the subroutine call. I change the call in the implementation so it passes the new parameter.
</p>
<p>
A syntax check to this gives an error. The syntax checker is not only checking the new implementation, but also the original subroutine that should have been overwritten.
</p>
<p>
The enhancement sections use the same enhancement spot, and the enhancement implementations use the same implementation.
</p>
<p>
I tried various combinations of using different enhancement spots and/or implementations, but all give the same syntax error. I tried separating the subroutine in a different include and retried my testing, but it still gave the same syntax error.
</p>
<p>
Here's the sample code I first created to try troubleshooting the problem:
</p>
<p>
<pre>
ENHANCEMENT-SECTION ZEP_Z_MICHAEL_02 SPOTS ZES_Z_MICHAEL .
PERFORM set_layout
CHANGING
wa_layout.
END-ENHANCEMENT-SECTION.
$$-Start: ZEP_Z_MICHAEL_02----
$$
ENHANCEMENT 2 ZEI_TEST_SECTIONS.
"inactive version
PERFORM set_layout
using 'X'
CHANGING
wa_layout.
ENDENHANCEMENT.
$$-End: ZEP_Z_MICHAEL_02----
$$
ENHANCEMENT-SECTION ZEP_Z_MICHAEL_01 SPOTS ZES_Z_MICHAEL STATIC .
FORM set_layout
CHANGING p_wa_layout TYPE slis_layout_alv.
p_wa_layout-zebra = 'X'.
wa_layout-no_colhead = 'X'..
p_wa_layout-colwidth_optimize ='X'.
wa_layout-window_titlebar = 'Woot'.
ENDFORM. "set_layout
END-ENHANCEMENT-SECTION.
$$-Start: ZEP_Z_MICHAEL_01----
$$
ENHANCEMENT 1 ZEI_TEST_SECTIONS.
"inactive version
FORM set_layout
using p_test type boolean
CHANGING p_wa_layout TYPE slis_layout_alv.
p_wa_layout-zebra = 'X'.
wa_layout-no_colhead = 'X'..
p_wa_layout-colwidth_optimize ='X'.
wa_layout-window_titlebar = 'Woot'.
ENDFORM. "set_layout
ENDENHANCEMENT.
$$-End: ZEP_Z_MICHAEL_01----
$$
</pre>
</p>
<p>
Please let me know if you think I am doing something wrong.
</p>
<p>
Thanks, <br>
Mike
</p>
Edited by: Michael Herman on Mar 8, 2010 8:11 PMYes, Sandra. That is what did and it worked with no syntax errors!
I'm not sure if this is getting off topic or not, but the SAP documentation(taken from the SAP help after pressing F1 on the keyword static in ERP6) seems misleading:
"The STATIC addition is intended for the enhancement of data declarations, while the statement ENHANCEMENT-POINT without the STATIC addition is designed for the enhancement of executable coding."
I would think the enhancement section ZEP_Z_MICHAEL_02 would fall under the category of executable code, while the enhancement section ZEP_Z_MICHAEL_01 would fall under the category of declarative code.
Unfortunately, all the SAP enhancement sections I come accross are dynamic. The SAP help explains the reasoning for this:
"In contrast to the statement ENHANCEMENT-POINT, the addition STATIC of the statement ENHANCEMENT-SECTION can only be used with maximum caution for changes of data declarations, because a replacement and no completion is carried out. Especially application development within SAP should not use the addition STATIC at all with ENHANCEMENT-SECTION as the change will be active in the entire customer system. "
I do not know what the word "completion" means in the previous quote, so I can't determine why it would matter. Regardless, if a developer wanted to change a standard subroutine declaration, they would also have to mod an enhancement section to change it to static. This seems to defeat the purpose of using enhancements, but maybe this scenario is not what enhancements were intended for. -
Syntax error when creating a user-defined table type in SQL Server 2012
Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
CREATE TYPE ReportsTableType AS TABLE
( reportId INT
, questionId INT
, questionOrder INT );
Results:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'AS'.Hope these posts could help,
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
Regards, Dineshkumar,
Please Mark as Answer if my post answers your question and
Vote as Helpful if it helps you -
Syntax Error with Table Parameter (type: ANY) when Creating Function Module
Hello experts,
I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
Could anyone tell me what the wrong is? And how can I fix it?
Thanks,
ShelwinHi,
For table parameters, you can only pass
MSG_TABLE_ITM TYPE STANDARD TABLE
or
MSG_TABLE_ITM ( don't fill other columns TYPING ASSOCIATED TYPE ).
For reference check FM 'GUI_UPLOAD' - Table parameters
Regards,
DPM -
Syntax error while creating Calculation view script based
Hi Folks,
I'm creating Calc view based on script and drafted a simple code but I'm getting syntax error.
Its just fetching few coloumns from two tables products and purchaseorderitem.
/********* Begin Procedure Script ************/
BEGIN
var_out = select productid , category, nameid, currency, grossamount, quantity
FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
where P.productid = B.productid;
END /********* End Procedure Script ************/
Could you pls take a look and let me know what wrong I'm doing?
Error logs are:-
sap.hana..package.project.folder.mytest.CALCSCRIPTVIEWInternal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Calculation View: SQL: sql syntax error: incorrect syntax near "democontent": line 5 col 18 (at pos 439)nSet Schema DDL statement: set schema "SYSTEM"nType DDL: create type "_SYS_BIC"."sap.hana..package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" as table ("PRODUCTID" NVARCHAR(10), "CATEGORY" NVARCHAR(2), "NAMEID" NVARCHAR(10), "CURRENCY" NVARCHAR(5), "GROSSAMOUNT" DECIMAL(15,2), "QUANITYT" DECIMAL(13,3))nProcedure DDL: create procedure "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc" ( OUT var_out "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as n /********* Begin Procedure Script ************/ n BEGIN n t var_out = select productid , category, nameid, currency, grossamount, quantityn t FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS Bn t where P.productid = B.productid;nnEND /********* End Procedure Script ************/nHi Rubane,
I don't have EPM installed here but based on this Table User Defined Functions( Table UDF ) in HANA you are not properly defining the source table.
In your case missing 1) schema of EPM, 2) not using double quotes, 3) separation of package and view, 4) missing camel case on purchaseOrderItem:
FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
On blog:
from "SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::businessPartner" as a
SAP_HANA_EPM_DEMO is the schema
sap.hana.democontent.epm.data is the package
businessPartner is the view
Start simple... before the seletion try it out on Studio SQL.
Regards, Fernando Da Rós -
Syntax error when creating input-ready query
Hi,
When creating an input-ready query, I set the key-figure to 'Data can be changed by user entries or Planning Functions' in the Planning Properties in the query designer.
When I execute the query, I get the following error:
Syntax Error in : CL_RSR_RRK0_KEYFIGURE
In se24, the class has a syntax error in its Constructor method.
The error is not occuring when I change the Planning property to 'Data Cannot be changed' or 'Data can be changed via Planning Functions'.
Has anyone encountered such an error. If yes, how to proceed further?
Anything do with the the ABAP Patches. Currently I am in Patch13.
Thanks,
BalajiHi,
Plz apply the notes 1042924 and 1043103.After appling the notes regenerate the
query.
This should solve the error.
Regards,
Srikanth. -
MySQL syntax error with TestStand 4.0 database logging
I had been using MS Access database to log results which worked fine but the access database is too limited. Switched to MySql. Database works fine and I can query it from Visual C++ and was able to create all my result tables fine from TestStand.
I get a syntax error when actually trying to log results and it has to do with either a missing quote or and extra quote, I can't quite tell. I thought I saw a post on this somewhere but can't find it now. Here is the complaint from TestStand:
An error occurred calling 'LogOneResult' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Statement: UUT_RESULT.
[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1
Description: [MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1
Number: -2147467259
NativeError: 1064
SQLState: 37000
Reported by: Microsoft OLE DB Provider for ODBC Drivers
Description: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Number: -2147217887
NativeError: 0
SQLState: 37000
Reported by: Microsoft OLE DB Provider for ODBC Drivers
Source: TSDBLog
And here is all that appears in the MySql logfile:
INSERT INTO UUT_RESULT DEFAULT VALUES
070914
You can't see it here but the string is truncated after the word VALUES. The next line starts with the odd number.
Any ideas?
Thanks,
Bill Peters
BAE SYSTEMSSure. There were two bugs in the ini file that contains the default TS schemas (I think it was Default_Database_Options.ini or like that...).
Anyway the table description for STEP_NUMERICLIMIT had for it's command line INSERT INTO MEAS_NUMERICLIMIT. I guess TestStand looked at that and said hmm I better create that table too. Then later down the page when you try to create MEAS_NUMERICLIMIT it says the table already exists even though it is empty. The generate SQL button builds a bad file and then the database viewer creates a bad database. I would have to go into MySql and drop the database. I had to save the schema under a custom name, edit it read it back in, generate a new SQL file, but then it would still fail validation because the ini files don't get updated until you exit TestStand. So basically I did this process 3 times before I got it right.
It's wasn't a big deal but it's amazing how a little thing can cause a lot of work.
The second bug, I'm not certain was initially in the file or somehow got set on the fly. There was a random int statement at the very end of the SQL table description for UUT_RESULT. It was also in the schema INI file. Since the int had no name and occurred in a odd place, it created a syntax error in MySql. Same fix as above.
But like I said it's working great now. I like this approach because I serve it to the net with Apache and parse the database with simple PHP scripts.
Thanks,
Bill Peters
BAE SYSTEMS -
Implementing Note 487917 ,,, error - to create object
Hi,
I am implementing SAP note 487917 through SNOTE.
But I am getting an error saying:
Create an empty object METH ZZ_NOTE_487917 with the corresponding object editor.
Version: SRM-5.0
Can someone guide me to create an object with type METH?
I have no Idea on OO-ABAP.
Thanks,
Ashwin.Hi Ashwin,
You need to create a Z/custom implementation for the BADI "BBP_CATALOG_TRANSFER".You cannot apply this note directly thorugh SNOTE.
Follow these steps;
-->Goto trascn SE19.
-->Create a Z implementation for the BADI BBP_CATALOG_TRANSFER ,say zBBP_CATALOG_TRANSFER.
-->Then give some description and under methods tab,click on the method ENRICH_ITEM_DATA.
-->In this method,in the editor,write the code which is given in the attached instructions in the note
i.e.
This implementation is writing all the fields that are filled
in the OCI-Interface to the application log BCT1. Furhtermore
it is also storing the error messages from ENRICH_ITEM_DATA to
the same log. The log can be view with transaction SLG1.
******** DATA DECLARATION **************************************
Work area for catalog_content
DATA: ITAB_WA TYPE bbp_ws_oci_item_s.
Data of the aplication log
DATA: L_S_LOG TYPE BAL_S_LOG. "Header of application log
DATA: L_S_TEXT(200) TYPE C. "Message lines
DATA: L_S_HANDLE TYPE BALLOGHNDL. "Log Handle.
DATA: L_T_HANDLE_TAB TYPE BAL_T_LOGH. "Handle tab for BAL_DB_SAVE
Data for OCI-Fields
DATA: OCI_FIELDS TYPE DDFIELDS. "all OCI-fields
DATA: OCI_FIELDS_WA TYPE DFIES. "work area for OCI-fields
DATA: HELP_FIELD(30) TYPE C. "dynamic field for loop at OCI-fields
DATA: DISP_FIELD(30) TYPE C.
DATA: H2(40) TYPE C. "conversion to type C
FIELD-SYMBOLS: <F1> TYPE ANY.
Data for OCI-Error-Tab
DATA: CATALOG_CONTENT_ERRORS_WA TYPE BBP_OCI_ERRORS.
******** END OF DATA DECLARATION *********************************
Read all the fields of the OCI-Interface.
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
tabname = 'BBP_WS_OCI_ITEM_S'
TABLES
fieldtab = oci_fields.
create a log
L_S_LOG-EXTNUMBER = 'CATALOG_DOWNLOAD'.
L_S_LOG-ALUSER = SY-UNAME.
L_S_LOG-ALPROG = SY-REPID.
L_S_LOG-OBJECT = 'BCT1'.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
I_S_LOG = L_S_LOG
IMPORTING
E_LOG_HANDLE = L_S_HANDLE
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
fill the data for the Application Log
CLEAR ITAB_WA.
LOOP AT CATALOG_CONTENT INTO ITAB_WA.
loop at all oci-fields and add nonempty fields to the appl. log
LOOP AT OCI_FIELDS INTO OCI_FIELDS_WA.
CONCATENATE 'ITAB_WA-' OCI_FIELDS_WA-FIELDNAME INTO HELP_FIELD.
ASSIGN (HELP_FIELD) TO <F1>.
IF <F1> IS INITIAL.
only write the fields that are not initial
ELSE.
H2 = <F1>. "conversion to type C
CONCATENATE 'NEW_ITEM-' OCI_FIELDS_WA-FIELDNAME INTO DISP_FIELD.
CONCATENATE DISP_FIELD '=' H2 INTO L_S_TEXT SEPARATED BY SPACE.
add this line to the application log
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
I_LOG_HANDLE = L_S_HANDLE
I_MSGTY = 'I'
I_TEXT = L_S_TEXT
EXCEPTIONS
LOG_NOT_FOUND = 1
MSG_INCONSISTENT = 2
LOG_IS_FULL = 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.
ENDIF.
ENDLOOP.
check if there are errors for this item in CATALOG_CONTENT_ERRORS
LOOP AT CATALOG_CONTENT_ERRORS INTO CATALOG_CONTENT_ERRORS_WA
WHERE LINE = ITAB_WA-LINE.
CONCATENATE
CATALOG_CONTENT_ERRORS_WA-LINE
CATALOG_CONTENT_ERRORS_WA-TYPE
CATALOG_CONTENT_ERRORS_WA-CODE
CATALOG_CONTENT_ERRORS_WA-MESSAGE
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V1
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V2
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V3
CATALOG_CONTENT_ERRORS_WA-MESSAGE_V4
INTO L_S_TEXT SEPARATED BY SPACE.
add this line to the application log
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
I_LOG_HANDLE = L_S_HANDLE
I_MSGTY = CATALOG_CONTENT_ERRORS_WA-TYPE
I_TEXT = L_S_TEXT
EXCEPTIONS
LOG_NOT_FOUND = 1
MSG_INCONSISTENT = 2
LOG_IS_FULL = 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.
ENDLOOP.
ENDLOOP.
Save this log to the data base (Log-Object = BCT1)
CLEAR L_T_HANDLE_TAB.
APPEND L_S_HANDLE TO L_T_HANDLE_TAB.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
I_T_LOG_HANDLE = L_T_HANDLE_TAB
EXCEPTIONS
LOG_NOT_FOUND = 1
SAVE_NOT_ALLOWED = 2
NUMBERING_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.
-->After that save and activate your implementation.
Pls let me know if you need any further help.
BR,
Disha.
Do reward full points for useful answers. -
Syntax Error with EXPORT statement in ECC 6
Hi All,
I have one issue with EXPORT statement syntax.
I have declared data like below:
DATA: BEGIN OF mem_id,
mandt LIKE sy-mandt,
uname LIKE sy-uname,
modno LIKE sy-modno,
END OF mem_id.
export the memory id
EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID MEM_ID.
When I am checking the syntax error i am getting like "MEM_ID" must be a character-type field (data type C, N, D or T). by "INTERFACE". by "INTERFACE". "INTERFACE". by "INTERFACE". by "INTERFACE".
I know this statement would be like IMPORT ITAB TO JTAB FROM MEMORY ID 'table'. So I have written like below
EXPORT E_VBKOK XANZPK TEXTTAB XBOLNR TO MEMORY ID 'MEM_ID'. But still it is throwing an error.
Can you please let me know how can I resolve this?
Regards,
Jyothi CH.Hi Jyothi,
data: l_var type string.
concatenate '6' '8' into l_var separated by space.
export l_var to memory id 'BB'.
Here we have to declare the type(structure) for l_var not for BB
and in another program
data:l_var type string.
import l_var from memory id 'BB'.
write : l_var. -
Syntax error while creating a standard order
Hi All,
I created a projet in CMOD and than added the enhancement V45A0002.The components shown as EXIT_SAPMV45A_002(Predefined sold to party when making the standard order),i double click on the exit and entered into the function module.After that i double clicked on the include ZXVVZU04 and entered in and wrote E_KUNNR=100171
While activating i got error msg 'The last statement is not complete (period missing)." & i have saved inspite the error .After that i tried to create a order and program terminated error came after entering sold to party no. in sales order
so now i have deactivated the project which i created in CMOD & deleted it aswell,than also i am getting the syntax error while making the order thru VA01.I want to come out of this please.
I would be great ful if somebody helps me *** out of this syntax error.
Thanks
RishiHi Rishi
As you are getting message that "The last statement is not complete (period missing)", check in your assigned project in CMOD the last statement , what is the last statement maintained in that project
Secondly also check the closing period and the current period. as it is giving in the message that "The last statement is not complete (period missing)".So check the current period and check the period maintained in the CMOD
It would be better if you take ABAP'ers help . So post in ABAP forum
Regards
Srinath -
SYntax error while creating a formula for %
Hi All,
I have to calculate Growth percentage and creating formula. But its giving me a syntax error.
I am writing like this:-
(Month to Date Sales-MTD PRior Year Sales)/ MTD PRior Year Sales*100 %
Can anyone please tell me where I am making a mistake.
RegardsSyntex for Percentage Deviation (%)
Plan Sales % Actual Sales (this will give the percentage deviation between Planned Sales and Actual Sales)
this is identical to formula
100 * (Planned Sales - Actual Sales) / (Actual Sales)
please check the space in your foumula
Dev -
Getting a syntax error while creating the simple OData service.
Hi Folks,
That is what I typed in a in .xsodata file but it is giving me a syntax error..any idea why this can be?
Thank you for your help.
service namespace "sap.hana.test.service"
{ "SYS" , "AFL_AREAS_" as "TEST";Hi,
I tried creating the same. I was able to activate all three files i.e. .xsapp,.xsaccess,*.xsodata. The three file contents are mentioned below. The data might not be displayed in the browser due to privileges issue as it is SYS table.
.xsapp contains
.xsaccess contains
"exposed" : true
*.xsodata contains
service
"SYS"."AFL_AREAS_" as "mytable"; -
Syntax error while creating tax codes for sales n purchases
Hi all,
While creating the tax codes for sales and purchases, i got the below error:
Report RB13A003 has a syntax error.
What should be done?
Thank youHi,
I believe, it's RV13A003 report and not RB13A003... What is the exact error message (or is it a dump)?
Regards,
Eli -
Syntax Error with JSON.Parse method to parse SharePoint List Items
Hi All,
I want to get SharePoint List data and bind that retrived data to the JQuery Grid Control.
For this I used SPServices to get the SharePoint List data in SOAP Envelope. Now I need to parse the soap envelope and store the retrieved items in array to pass it to the Grid Control.
While using the JSON.Parse(resporseText) method, Iam consistenly getting an Syntax Error!
Could anyone help me with this ?
Please find the SOAP Envelope I received from SP List as below:
"<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><GetListItemsResult><listitems xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<rs:data ItemCount="2">
<z:row ows_OBNumber='112211.000000000' ows_Project_x0020_Name='Project 1' ows_MetaInfo='11;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='Project 1' ows_ID='11' ows_UniqueId='11;#{FBBCBCF9-666D-42F9-92D7-67188C51BC9B}' ows_owshiddenversion='1' ows_FSObjType='11;#0' ows_Created='2015-01-12 10:25:06' ows_PermMask='0x7fffffffffffffff' ows_Modified='2015-01-12 10:25:06' ows_FileRef='11;#sites/Lists/Projects/11_.000' />
<z:row ows_OBNumber='1122343.00000000' ows_Project_x0020_Name='Project 2 ' ows_MetaInfo='12;#' ows__ModerationStatus='0' ows__Level='1' ows_Title='Project 2' ows_ID='12' ows_UniqueId='12;#{0D772B76-68E4-4769-B6FF-6A269F9C7ABD}' ows_owshiddenversion='1' ows_FSObjType='12;#0' ows_Created='2015-01-12 10:33:48' ows_PermMask='0x7fffffffffffffff' ows_Modified='2015-01-12 10:33:48' ows_FileRef='12;#sites/Lists/Projects/12_.000' />
</rs:data>
</listitems></GetListItemsResult></GetListItemsResponse></soap:Body></soap:Envelope>"
Any help on this will be greatly appreciated.
Thanks In Advance.!Hi,
According to your description, there is an issue when parsing result from the data retrieved using SPServices.
By default, SPServices returns data as XML format, however, the JSON.parse() method “Throws a SyntaxError exception if the string to parse is not valid JSON”:
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
To extract the data needed from the response, you can either take the demo below for as a reference:
http://spservices.codeplex.com/wikipage?title=GetListItems
Or use the jQuery.parseXML() function:
http://api.jquery.com/jquery.parsexml/
Best regards
Patrick Liang
TechNet Community Support -
Syntax error when creating database
Not sure if this is the correct forum, but here goes..
Using a sample at:
Technet Link
I get a "Syntax error near GO" when I try to execute the following SQL Command.
USE master
GO
CREATE DATABASE testdb
ON
( NAME = testdb,
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\testdb.mdf' )
GO
I am using a function to create this database. It is a temporary database that gets recreated or altered frequently.
The code checks for SQL Server, gets it's version number in order to use the default SQL Server path. If SQL Server isn't available, ACE / OLEDB is used to create and manage the database (this part works fine).
The code used to check for and create the database follows.
private Boolean CheckForSQLServer()
SqlConnection cnx = null;
Int32 dbExists = 1;
SqlCommand sql;
String SSData = String.Empty;
// Check for SQL Server. If it exists, use it.
String login = UserPrincipal.Current.UserPrincipalName;
login = login.Substring(0, login.IndexOf("@"));
try {
cnx = new SqlConnection(
String.Format("server={0};user={1};Trusted_Connection=Yes;", Prop.SQLConnection, login));
cnx.Open();
hasSQLServer = true;
} catch (Exception) {
hasSQLServer = false;
return true;
if (hasSQLServer) {
try {
String ServerVersion = cnx.ServerVersion;
String SSPath = String.Format(@"C:\Program Files\Microsoft SQL Server\MSSQL{0}.MSSQLSERVER\MSSQL\DATA\",
ServerVersion.Substring(0, ServerVersion.IndexOf('.')));
SSData = String.Format(
"USE master\nGO\nCREATE DATABASE {0}\nON\n( NAME = '{1}',\nFILENAME = '{2}{1}.mdf' )\nGO",
Prop.SQLDBName, Prop.SQLDBName, SSPath);
String s = String.Format(
"SELECT COUNT(*) FROM (SELECT DB_ID('{0}') AS DbID) t WHERE DbID IS NOT NULL", Prop.SQLDBName);
sql = new SqlCommand(s, cnx);
SqlDataReader sr = sql.ExecuteReader();
if (sr.Read())
dbExists = (Int32)sr[0];
sr.Close();
} catch (Exception) { }
if (dbExists == 0) {
try {
sql = new SqlCommand(SSData, cnx);
sql.ExecuteNonQuery();
} catch (Exception) { }
} else {
try {
sql = new SqlCommand(String.Format("drop database {0};", Prop.SQLDBName), cnx);
sql.ExecuteNonQuery();
sql = new SqlCommand(SSData, cnx);
sql.ExecuteNonQuery();
} catch (Exception) { }
cnx.Close();
return false;
Comparing the generated SQL string to sample E at the link above shows them to be identical except for the database name and file pathname, but the paths do exist although the files do not.
The SQL Exception occurs at the first
sql = new SqlCommand(SSData, cnx);
statement in the code. I would think this can be done as a single string even though a .sql file is referenced in the article.
AndyWorks correctly in SQL Server 2014 Management Studio:
USE master
GO
CREATE DATABASE testdb
ON
( NAME = testdb,
FILENAME = 'F:\temp\testdb.mdf' )
GO
DROP DATABASE testdb
GO
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014
Maybe you are looking for
-
No choice, need to reinstall OS from scratch, but... Help!
I've been dealing with a disk error that has tripped up every application I've used to correct it. Disk First Aid could nothing. I tried Disk Warrior, but that's taking centuries to run and still won't solve the end problem (according to a DW techie)
-
How do I resize a photo in iphoto and keep it in iphoto library
So in windows I can resize a photo and leave it where it is. Why can't I do this in iphoto?
-
I downloaded Final cut pro x, how do i get hard copy disks?
I recently downloaded Final Cut Pro X from the App store to my MacBook Pro (OS X-10.9.5). I need to move it and the projects to a different MBP in the office. Do I need the hardcopy disks in order to move the application? If so, how do I get them?
-
Dear Sir, We have ETO scenario and are in the business of manufacturing "Industrial Machinery" . We are using Project System (PS) also . After the final assembly the FERT Equipment gets ready and then it is put on trial for testing . After the succe
-
ADF pivot table aggregate column
HI, Is it possible to create an average column in the dvt:pivotTable that contains the average of all the columns regardless of the category the columns are in ? i tried to add a "Data Aggregation" in the binding of the pivot table but unfortunately