Syntax error in modify statement
Hi Friends,
There is an Internal table IT_STATUS which is the Parameter in BADI Method IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE.
Below is the code i have written
Data: wa_status type cobai_s_status,
stat TYPE TABLE OF jstat,
wa_stat type jstat.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = gv_objnr
* ONLY_ACTIVE = ' '
* IMPORTING
* OBTYP =
* STSMA =
* STONR =
TABLES
status = stat
EXCEPTIONS
object_not_found = 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.
ELSE.
loop at it_status into wa_status.
read table stat into wa_stat with key STAT = wa_status-stat.
if sy-subrc = 0.
wa_status-stat = wa_stat-stat.
wa_status-INACT = wa_stat-INACT.
modify it_status from wa_status transporting stat inact.
endif.
endloop.
ENDIF.
At Modify statement it is giving a syntax error 'The <b>field "IT_STATUS" cannot be changed.-</b>'. what could be the reason?
Please provide me the solution.
Thanks & Regards,
Satish
Hi Rob,
This is the whole code which i had written in method
METHOD if_ex_workorder_update~before_update.
DATA: gv_aufnr TYPE afih-aufnr,
gv_objnr TYPE jest-objnr,
stat TYPE TABLE OF jstat,
wa_stat TYPE jstat,
wa_header TYPE cobai_s_header,
wa_status TYPE cobai_s_status,
it_status_new TYPE cobai_t_status.
DATA: status_index TYPE sy-tabix.
BREAK-POINT.
LOOP AT it_header INTO wa_header.
SELECT SINGLE aufnr FROM afih INTO gv_aufnr WHERE warpl = wa_header-warpl AND abnum = 1.
IF sy-subrc = 0.
CONCATENATE 'OR' gv_aufnr INTO gv_objnr.
CALL FUNCTION 'STATUS_READ'
EXPORTING
client = sy-mandt
objnr = gv_objnr
* ONLY_ACTIVE = ' '
* IMPORTING
* OBTYP =
* STSMA =
* STONR =
TABLES
status = stat
EXCEPTIONS
object_not_found = 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.
ELSE.
LOOP AT it_status INTO wa_status.
status_index = sy-tabix.
READ TABLE stat INTO wa_stat WITH KEY stat = wa_status-stat.
IF sy-subrc = 0.
wa_status-stat = wa_stat-stat.
wa_status-inact = wa_stat-inact.
MODIFY it_status INDEX status_index FROM wa_status TRANSPORTING stat inact.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
Hope it will get resolved
Regards,
Satish
Similar Messages
-
Hi,
I am getting following error message ,
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
When run this code.
<%@ page import= "java.sql.*"%>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
Statement st = con.createStatement();
st.executeUpdate("update tscipshift set 11-Aug-08='M' where TechN='Elamparuthi'");
%>
tscipshift=table ,column=11-Aug-08 are all exist.
I dont know why I am getting error mesage.
Any idea why?Shahbaz2008 wrote:
you haven't set your user name and password hereI don't believe that's necessary with Access. Then again, it's not an enterprise database.
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb");
change it to this
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","+username+","+password+");
here pass your username and password...
In Oracle default user name and password is
username = scott
password = tigerSo who uses that? Only an eejit would leave that account open.
So the statement would be
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","scott","tiger");
or In Mirosoft Access there is no user name and password so the statement will be Like I said - unnecessary, and not the reason the OP is having problems.
Connection con = DriverManager.getConnection("jdbc:odbc:bspipdb","","");>
Besides this change your table name 11-Aug-08 to anything that is not start with number or any special symbols.
for example aug112008 is good or aug is too good.No, it's still not good if you understand ANYTHING about relational databases and normalization.
I think it would work.I think you're just as stup!d as the OP.
% -
JDBC: Syntax error in UPDATE statement???
Hi,
I have been trying to solve this seemingly simple problem for the past 4 hours, and I had no success. I am working on a jdbc:odbc connection which utilizes MS Access. I have been constantly getting "Syntax error in UPDATE statement", and this is the statement
(name of the table is CDs, columns are number, artist, album, label and date - all strings):
query = "UPDATE CDs SET artist = '" + fields.artist.getText() +"', album = '" +
fields.album.getText() + "', label = '" +
fields.label.getText() + "', date = '" +
fields.date.getText() + "' WHERE number = '" + fields.number.getText() + "'";
Can anybody recognize an error? Thank you,
mirkokrugA couple of possibilities.
If the column NUMBER is numeric then it wouldn't need quotes around the data value. Also if the column DATE is a date or date/time type then the format from the textbox may not be correct.
Col -
Unicode error free MODIFY statement
HI All,
I have midify statement in a loop like this.
loop at itab into wa_itab.
modify itab from wa_itab index tabx.
endloop.
I am working in ECC 6.0. It is showing unicode error at modify statement. Please suggest me the correct statemnt.ANy extension for modify statemnt..?
Thanks,
kishoreLOOP AT IT_VBRK.
<b> CTAB = SY-TABIX.</b>
LOOP AT IT_T001 WHERE BUKRS = IT_VBRK-BUKRS.
IF SY-SUBRC = 0.
IT_VBRK-BUTXT = IT_T001-BUTXT.
<b> MODIFY IT_VBRK INDEX CTAB.</b>
CLEAR CTAB.
ENDIF.
ENDLOOP.
ENDLOOP.
The problem may be with SY-TABIX, check the above code -
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. -
Hi,
When i am trying to update a z table by using modify statement, i am getting the following error:
Short text
SQL error in the database when accessing a table.
What happened?
When writing a data record to the database (i.e. when
updating the database), only part of the data field was
written (updated). The rest was truncated.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The problem has arisen because, within the database interface,
one of the data buffers made available for the INSERT (UPDATE)
is longer than the maximum defined in the database.
On the other hand, it may be that the length in the NAMETAB
does not match the maximum length defined in the database.
(In this case, the length in the NAMETAB is longer.)
Please guide me how this error can be resolved.
Thanks and RegardsHi,
The error message is as follows:
Short text
SQL error in the database when accessing a table.
What happened?
When writing a data record to the database (i.e. when
updating the database), only part of the data field was
written (updated). The rest was truncated.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The problem has arisen because, within the database interface,
one of the data buffers made available for the INSERT (UPDATE)
is longer than the maximum defined in the database.
On the other hand, it may be that the length in the NAMETAB
does not match the maximum length defined in the database.
(In this case, the length in the NAMETAB is longer.)
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of dump
Edited by: Rob Burbank on May 1, 2010 5:59 PM -
Syntax Error in Update Statement
Would a smart and kind CF pro mind putting a fresh pair of
eyes on this code and tell me where the syntax error is? All the
fields in the statement are numeric except the last one (comments).
I have enclosed them in val() to ensure they are numeric when
inserted into the DB. The fields they're being inserted into are
numeric. I need to be numeric because I will be doing calculations
on them. Also, I have triple-checked to ensure the datasource,
table, and field names all match.
Thanks,
GwenHTry using <cfqueryparam>
<cfquery datasource="reviews">
UPDATE evals
SET focus = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.focus#">
, strengths = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.strengths#">
, tailored = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.tailored#">
, badinfo = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.badinfo#">
, format = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.format#">
, visual = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.visual#">
, grammar = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.grammar#">
, pronouns = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.pronouns#">
, written = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.written#">
, achieve = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.achieve#">
, sell = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.sell#">
, negative = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.negative#">
, top = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.top#">
, general = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.general#">
, intro = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.intro#">
, orientation = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.orientation#">
, paragraphs = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.paragraphs#">
, two = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.two#">
, length = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.length#">
, none = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.none#">
, comments = <cfqueryparam cfsqltype="cf_sql_clob"
value="#form.comments#">
WHERE resumeID = <cfqueryparam cfsqltype="cf_sql_numeric"
value="#form.resumeID#">
</cfquery>
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Adobe Certified Expert - Dreamweaver CS3
Adobe Certified Expert - ColdFusion 8
Fordwebs, LLC
http://www.fordwebs.com
"GwenH" <[email protected]> wrote in message
news:[email protected]...
> Would a smart and kind CF pro mind putting a fresh pair
of eyes on this
> code
> and tell me where the syntax error is? All the fields in
the statement are
> numeric except the last one (comments). I have enclosed
them in val() to
> ensure
> they are numeric when inserted into the DB. The fields
they're being
> inserted
> into are numeric. I need to be numeric because I will be
doing
> calculations on
> them. Also, I have triple-checked to ensure the
datasource, table, and
> field
> names all match.
>
> Thanks,
> GwenH
>
> <cfquery datasource="reviews">
> UPDATE evals
> SET
> focus = val(#form.focus#)
> , strengths = val(#form.strengths#)
> , tailored = val(#form.tailored#)
> , badinfo = val(#form.badinfo#)
> , format = val(#form.format#)
> , visual = val(#form.visual#)
> , grammar = val(#form.grammar#)
> , pronouns = val(#form.pronouns#)
> , written = val(#form.written#)
> , achieve = val(#form.achieve#)
> , sell = val(#form.sell#)
> , negative = val(#form.negative#)
> , top = val(#form.top#)
> , general = val(#form.general#)
> , intro = val(#form.intro#)
> , orientation = val(#form.orientation#)
> , paragraphs = val(#form.paragraphs#)
> , two = val(#form.two#)
> , length = val(#form.length#)
> , none = val(#form.none#)
> , comments = '#form.comments#'
> WHERE resumeID = #form.resumeID#
> </cfquery>
> -
Syntax error in INSERT STATEMENT
A problem on the date part of the query but why I don´t
know, Thanks for any pointers,
TIA
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, date)
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC
Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
INSERT INTO statement.
The error occurred in uploadmember.cfm: line 28
26 : INSERT INTO imagesproducts
27 : (title, info, date)
28 : VALUES ( '#form.title#', '#form.info#',
'#DateFormat(Now())#' )
29 : </cfquery>
30 :
SQL INSERT INTO imagesproducts (title, info, date) VALUES (
'News test', 'Testing news info', '12-Jul-07' )
DATASOURCE trevor_SecurityDB
VENDORERRORCODE -3502
SQLSTATE 42000Perhaps it is a reserved word issue with the date column,
since
date is an ODBC Reserved Keyword. You might try enclosing it
within brackets [ ].
<cfquery name="update1" datasource="trevor_SecurityDB">
INSERT INTO imagesproducts
(title, info, [date])
VALUES ( '#form.title#', '#form.info#', '#DateFormat(Now())#'
</cfquery>
Or, if that doesn't help, you might try using a cfqueryparam
tag for the '#DateFormat(Now())#' value using a cfsqltype =
"CF_SQL_TIMESTAMP" (assuming a date/time datatype on the column).
Also, you might look into using one of the CreateODBCDateTime() or
CreateODBCDate() functions.
Phil -
Help! Syntax Error in SQL statement
Hello. I'm getting an error message and I'm just not seeing
where I went wrong. The SQL statement is:
updateSQL = "UPDATE TrainingHistory SET Status='" &
fFormat(Request.Form(cStatus)) & "', StatusComments='" &
fFormat(Request.Form(cStatusComments)) & " WHERE Training_ID="
& fFormat(Request.Form(cTrainingID))
The error message is:
[Microsoft][ODBC Microsoft Access Driver] Syntax error in
string in query expression '' WHERE Training_ID=9054'.
I've been looking at it for a while. Not sure where I went
wrong. Here is a more complete version of the code:
<%
Function fFormat(vText)
fFormat = Replace(vText, "'", "''")
End Function
Sub sRunSQL(vSQL)
set cExecute = Server.CreateObject("ADODB.Command")
With cExecute
.ActiveConnection = MM_coldsuncrea_lms_STRING
.CommandText = vSQL
.CommandType = 1
.CommandTimeout = 0
.Prepared = true
.Execute()
End With
End Sub
If Request.Form("action")="update" Then
'Set variables for update
Dim updateSQL, i
Dim cTrainingID, cStatus, cStatusComments
'Loop through records on screen and update
For i = 1 To fFormat(Request.Form("counter"))
'Create the proper field names to reference on the form
cTrainingID = "Training_ID" & CStr(i)
cStatus = "Status" & CStr(i)
cStatusComments = "StatusComments" & CStr(i)
'Create the update sql statement
updateSQL = "UPDATE TrainingHistory SET Status='" &
fFormat(Request.Form(cStatus)) & "', StatusComments='" &
fFormat(Request.Form(cStatusComments)) & " WHERE Training_ID="
& fFormat(Request.Form(cTrainingID))
'Run the sql statement
Call sRunSQL(updateSQL)
Next
'Refresh page
Response.Redirect("ClassUpdateRoster.asp?Training_ID=") &
(rsClassDetails.Fields.Item("event_ID").Value)
End If
%>You need another single quote after the double quote before
the WHERE clause. You are not closing the single quote you used to
delimit the value for StatusComments. -
Syntax error using try statement in WLST
Hi All,
I have a WLST script to create some JMS resources.
I want to implement exception handling in such a way that if the script fails at any point, all the changes done should be reverted back.
However, whenever I am trying to put a try block, the script is throwing syntax error on the first line after the try statement.
Please find below the script I am using. Please suggest
import sys
from java.lang import System
*# Putting a try statement here results in a syntax error at the below line*
print "Starting the script ..."
connect('weblogic',password,'t3://osbdev:7001')
edit()
startEdit()
servermb=getMBean("Servers/osb_server")
if servermb is None:
print 'Value is Null'
else:
+# Creating the JMS Server+
jmsserver1mb = create('WLSTJMSServer','JMSServer')
jmsserver1mb.addTarget(servermb)
+# Creating the JMS Module+
jmsMySystemResource = create("WLSTJmsSystemResource","JMSSystemResource")
jmsMySystemResource.addTarget(servermb)
subDep1mb = jmsMySystemResource .createSubDeployment('WLSTJMSSubDeployment')
subDep1mb.addTarget(jmsserver1mb)
theJMSResource = jmsMySystemResource.getJMSResource()
connfact1 = theJMSResource.createConnectionFactory('WLSTConnFact1')
connfact1.setJNDIName('jms.WLSTConnFact1')
connfact1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue1..."
jmsqueue1 = theJMSResource.createQueue('WLSTJMSQueue1')
jmsqueue1.setJNDIName('jms.WLSTJMSQueue1')
jmsqueue1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue2..."
jmsqueue2 = theJMSResource.createQueue('WLSTJMSQueue2')
jmsqueue2.setJNDIName('jms.WLSTJMSQueue2')
jmsqueue2.setSubDeploymentName('WLSTJMSSubDeployment')
*# try statement is working at only this point of the program*
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise
Edited by: Chintan Parekh on Mar 16, 2011 7:06 AMHi Chintan,
Try doing copy pasting the below code, you have to hit the tab or space after try or except to create its block and keep an eye on the alinement's of it.
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()Also I made the alinement's properly and the script is running properly with out any error.
print "Starting the script ..."
connect('weblogic','weblogic','t3://localhost:7001')
edit()
startEdit()
servermb=getMBean("Servers/AdminServer")
if servermb is None:
print 'Value is Null'
else:
# Creating the JMS Server
jmsserver1mb = create('WLSTJMSServer','JMSServer')
jmsserver1mb.addTarget(servermb)
# Creating the JMS Module
jmsMySystemResource = create("WLSTJmsSystemResource","JMSSystemResource")
jmsMySystemResource.addTarget(servermb)
subDep1mb = jmsMySystemResource .createSubDeployment('WLSTJMSSubDeployment')
subDep1mb.addTarget(jmsserver1mb)
theJMSResource = jmsMySystemResource.getJMSResource()
connfact1 = theJMSResource.createConnectionFactory('WLSTConnFact1')
connfact1.setJNDIName('jms.WLSTConnFact1')
connfact1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue1..."
jmsqueue1 = theJMSResource.createQueue('WLSTJMSQueue1')
jmsqueue1.setJNDIName('jms.WLSTJMSQueue1')
jmsqueue1.setSubDeploymentName('WLSTJMSSubDeployment')
print "Creating WLSTQueue2..."
jmsqueue2 = theJMSResource.createQueue('WLSTJMSQueue2')
jmsqueue2.setJNDIName('jms.WLSTJMSQueue2')
jmsqueue2.setSubDeploymentName('WLSTJMSSubDeployment')
# try statement is working at only this point of the program
try:
save()
activate(block="true")
print "script returns SUCCESS"
except:
save()
cancelEdit(defaultAnswer="y")
print "Error while trying to connect to server !!!"
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()Below is the output
java weblogic.WLST test.py
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Starting the script ...
Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'Domain_7001'.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().
For more help, use help(edit)
You already have an edit session in progress and hence WLST will
continue with your edit session.
Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
MBean type JMSServer with name WLSTJMSServer has been created successfully.
MBean type JMSSystemResource with name WLSTJmsSystemResource has been created successfully.
Creating WLSTQueue1...
Creating WLSTQueue2...
Saving all your changes ...
Saved all your changes successfully.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed
script returns SUCCESSRegards,
Ravish Mody
http://middlewaremagic.com/weblogic
Come, Join Us and Experience The Magic…
Edited by: Ravish Mody-MiddewareMagic on Mar 16, 2011 8:33 PM -
SYntax error - on Perform Statement
Hello friends,
I have a syntax error in the following code.
the error is The field "P_I_PA0000" is unknown, but there are the following fields
in the function module.
Any suggestions.
Thanks,
Raju.
PARAMETERS: ps_file1like rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE,
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file USING ps_file1
CHANGING i_pa0000[].
*& Form upload_local_file
text
-->P_PS_FILE1 text
<--P_I_PA0000 text
FORM upload_local_file USING p_ps_file1
CHANGING p_i_pa0000[].
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000[]
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
ENDFORM. " upload_local_fileIf it doesn't work, why did you mark it as "solved"?
I think this is what you are trying to do:
PARAMETERS: ps_file1 LIKE rlgrap-filename " Incoming file 1
DEFAULT 'c:\HR\ZCNV0008.txt' LOWER CASE.
DATA: BEGIN OF i_pa0000 OCCURS 100.
INCLUDE STRUCTURE pa0000.
DATA: END OF i_pa0000.
PERFORM upload_local_file
TABLES i_pa0000
USING ps_file1.
*& Form upload_local_file
* text
FORM upload_local_file
TABLES p_i_pa0000
USING p_ps_file1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_ps_file1
filetype = 'ASC'
TABLES
data_tab = p_i_pa0000
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
ENDFORM. " upload_local_file
Rob -
Syntax Error in SELECT statement
Hi,
My ABAP statement is:
select b1~fa a1~fb
INTO CORRESPONDING FIELDS OF TABLE it_1
from (table_nm) as a1 inner join db_tab2 as b1
on a1~fb = b1~fb.
For this statement it gives me following error in syntax check:
*Wrong expression "INNER" in FROM clause. WHERE condition. *
Thanks,
CDHi
Try something like this:
DATA: BEGIN OF ITAB OCCURS 0,
A,
B,
END OF ITAB.
DATA: TABLENAME(30).
DATA: WA_FTAB(72) TYPE C,
FTAB LIKE TABLE OF WA_FTAB.
WA_FTAB = 'A'. APPEND WA_FTAB TO FTAB.
SELECT (FTAB) FROM (TABLENAME) INTO TABLE ITAB.
LOOP AT ITAB.
SELECT SINGLE A FRO <TABLE 2>
INTO ITAB-B
WHERE A = ITAB-A.
MODIFY ITAB.
ENDLOOP.
See this sample:
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
VKORG LIKE VBAK-VKORG,
END OF ITAB.
DATA: TABLENAME(30) VALUE 'VBAP'.
DATA: WA_FTAB(72) TYPE C,
FTAB LIKE TABLE OF WA_FTAB.
WA_FTAB = 'VBELN'. APPEND WA_FTAB TO FTAB.
WA_FTAB = 'POSNR'. APPEND WA_FTAB TO FTAB.
SELECT (FTAB) UP TO 10 ROWS FROM (TABLENAME) INTO TABLE ITAB.
LOOP AT ITAB.
SELECT SINGLE VKORG FROM VBAK INTO ITAB-VKORG
WHERE VBELN = ITAB-VBELN.
MODIFY ITAB.
ENDLOOP. -
Time Out Error in Modify statement
Hi ,
While executing the following statement in standard program, timeout error occurs.
Program SAPLSBAL_DB_INTERNAL
Include LSBAL_DB_INTERNALU02
Row 72
Module type (FUNCTION)
Module Name BAL_DB_INTERNAL_NO_UPDATE_TASK
update all tables specified
IF NOT c_s_db_tables-baldat_u IS INITIAL.
MODIFY baldat CLIENT SPECIFIED FROM TABLE c_s_db_tables-baldat_u.
ENDIF.
Internal Table c_s_db_tables-baldat_u
MANDANT RELID LOG_HANDLE BLOCK SRTF2 CLUSTR CLUSTD
120 AL FYsqIm1SE6hX00002WF87m 112 0 512 hfdfgdfgdfdgd........
120 AL FYsqIm1SE6hX00002WF87m 112 1 512 ...
120 AL FYsqIm1SE6hX00002WF87m 112 2 512
120 AL FYsqIm1SE6hX00002WF87m 112 3 512
120 AL FYsqIm1SE6hX00002WF87m 112 4 370
CLUSTD having values like the one below FF060201020280003431303300000000218F0000121F9D02A37CF3F98DE2C8E2784D777B3CA3A0687E787E705919E3181F38B867EC9E6E8903C6C6369293187B00FB149265132271C0594780C4011C58
Please help.I am not a developper, so I cannot answer your question about the modify-directly-on-db-issue - but look at the FM BAL_DB_INTERNAL_NO_UPDATE_TASK - as the shorttext says: Application-Log: Database: Internal: Protocolls without Update Task - maybe it has to do with the way this modify is processed?
Just so. It will not help you - of course you can open a Call with SAP on this special function and see if they come up with an explanation and/or a correction - in the meantime, consider my proposals as possible workarounds.
Another thought: if you are so interested in that FM, why not post a question in the Abap-performance forum - there's a tough group of guys over there who might be interested to study that FM. -
Syntax Error while writing VBScript in OFT 9.1
Hi All,
I am new to OFT 9.1 (not using OpenScript). I have a simple VBScript code which I have copied inside Test Scriptlet After Page. After pasting code, I click "Done" button and then save the script. While doing this the script pane shows me syntax error but does not tell me what it is but highlights it with red color. I am even able to execute this VBScript code and get the desired result.
Below is the code:
Dim blnVal1
Dim strVal
Dim strTemp
Function fn1(strTemp)
MsgBox strTemp
fn1 = True
End Function
strVal = "Hello World"
blnVal1 = fn1(strVal)
I get a syntax error for the statement where MsgBox line of code is written.
Please can anyone help me why I am getting this syntax error. This is driving me nuts. Thanks.
Regards,
HarmanMy guess is that it doesn't like the Function statement and that you will have to just write your code page by page without the use of a function
-
This statement return an SQLException which says:
Syntax error in INSERT INTO statement
String mySql_1 = " INSERT INTO MEAL(MEAL_AMT_LOADED)"
"WHERE MEAL.STU_NUM = '" jtfStNo.getText().trim()
"'VALUES('"+jtfAmLd.getText().trim()+"')";
I want the following query statement to allow me to insert a meal amount of a particular student through jtfAmLd into the MEAL table whereby a student must be identified by a student number also to be provided in jtfStNo.
I'll be glad if you can help me with this statement
Cool.I want to know how am i going to update the second table MEAL which
contains a foreign key STU_NUM which referenced STUDENT the table which contains STU_NUM as a primary key using the criteria of a STU_NUM.
Duffymo and DrClap i have tried UPDATE as follows:
String query = "UPDATE STUDENT,MEAL"+
"SET MEAL.MEAL_AMT_LOADED = '" + jtfAmLd.getText().trim() +"',"+
"MEAL.MEAL_REL_MADE = '"+jtfRM.getText().trim()+ "' "+
"WHERE STUDENT.STU_NUM = MEAL.STU_NUM"+
"AND STUDENT.STU_NUM = '" + jtfStNo.getText().trim() + "'";
But it returns an error which says:
Failed to insertjava.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
Maybe you are looking for
-
What's the best out-of-the-box web interface for a SQL DB?
I'm developing a Java web application that will be backed by an Oracle database. Users would like a simple web interface that allows them to accomplish what they could with SQL queries without knowing SQL. The basic operations would be: * displaying
-
Help on refreshing...
I am using the code from http://jeffkemponoracle.blogspot.com/2006/10/apex-tip-page-auto-refresh.html It works great when my form opens up( i can see the curser moving every 60 sec). let me explain the problem. my application is a simple one, one pag
-
Course detecting SCORM 2004 but sending 1.2 commands
I've been testing Captivate 2.0 courses within SABA 5.2.0.2. Everything works correctly but when the course is successfully completed, it won't move to transcript. I contacted SABA and provided them with the course to test in their lab. Here is was t
-
No configured airport base stations have been found
I just purchased a new Time Capsule and tried to set it up according to the included instructions. After the initial set up Airport Utility give the following error message: "No configured AirPort base stations have been found. The only way I can con
-
Trying to make a photo contest need some help
Trying to make a photo contest need some help. I am running a fish photo contest on my website and was wondering if any of you could give me some advice on some good extensions to help me do this easier. Basically I want a page where people upload a