2007 Jul 02 11:03 AM
Hi,
I am writing a program to update the record
iam getting the following error in the program that
ztab_ac is not expected.
TABLES WORK AREA
TABLES: ZTAB_AC.
ZTAB_AC-MANDT = SY-MANDT.
ZTAB_AC-SERAILNUMBER = '00020'.
ZTAB_AC-ACCOUNTNUMBER = 'A100'.
INSERTING RECORDS
INSERT ZTAB_AC.
IF SY-SUBRC EQ 0.
WRITE:/ 'NO OF RECORDS INSERTED', SY-DBCNT.
ENDIF.
UPDATING RECORDS
UPDATE:/ ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'.
IF SY-SUBRC EQ 0.
WRITE:/ 'NO OF RECORDS UPDATED', SY-DBCNT.
ELSE
WRITE:/ 'NO OF RECORDS UPDATED'.
ENDIF.
2007 Jul 02 11:17 AM
Hi
UPDATE<b>:/</b> ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'.
it should be
<b>UPDATE ZTAB_AC SET ACCOUNTNUMBER = 'AA100'
WHERE SERAILNUMBEER = '00020'.</b>
The bold content (:/) is the cause for the error.
Regards
Raj
Message was edited by:
Rajasekhar Dinavahi
Hi,
I am writing a program to update the record
iam getting the following error in the program that
ztab_ac is not expected.
TABLES WORK AREA
TABLES: ZTAB_AC.
ZTAB_AC-MANDT = SY-MANDT.
ZTAB_AC-SERAILNUMBER = '00020'.
ZTAB_AC-ACCOUNTNUMBER = 'A100'.
INSERTING RECORDS
INSERT ZTAB_AC.
IF SY-SUBRC EQ 0.
WRITE:/ 'NO OF RECORDS INSERTED', SY-DBCNT.
ENDIF.
UPDATING RECORDS
UPDATE:/ ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'.
IF SY-SUBRC EQ 0.
WRITE:/ 'NO OF RECORDS UPDATED', SY-DBCNT.
ELSE
WRITE:/ 'NO OF RECORDS UPDATED'.
ENDIF.
2007 Jul 02 11:06 AM
HI.
Check table ztab_ac is available or not in SE12.
I think so its not avaliable in se12.
Reward all helpfull answers.
Regards.
Jay
2007 Jul 02 11:08 AM
Hi,
ZTAB_AC IS avaialble. I am getting the error in the 24th row
UPDATE:/ ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'
2007 Jul 02 11:10 AM
Check the syntax
UPDATE:/ ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'
and also whether the entry is 'AA100' or 'A100'...i think you are trying to insert with a different entry and your check for update is different one..
PS:Reward points if helpful!!
Regards,
Krithiga.
2007 Jul 02 11:11 AM
2007 Jul 02 11:07 AM
What is thios ZTAB_AC...
If it is not a Dictionary table dont use as
TABLES: ZTAB_AC.also tell us where u r getting the error.
Reward points if usefull.
2007 Jul 02 11:09 AM
Hi
See the documnetaion of UPDATE,INSERT and MODIFY
MODIFY
... FROM { {wa} | {TABLE itab} }.
1. ... FROM wa
2. ... FROM TABLE itab
A wa data object that is not table-type or an itab internal table can be specified after FROM. On the one hand the content of the data objects determines whether the line(s) are inserted or changed, and on the other hand, which values are inserted or used for changes.
To insert or change several lines in a database table, use the following:
MODIFY <target> FROM TABLE <itab> .
Those lines of the internal table <itab> for which there is not already a line in the database table with the same primary key are inserted into the table. Those lines of the internal table <itab> for which there is already a line in the database table with the same primary key overwrite the existing line in the database table. The same rules apply to the line type of <itab> as to the work area <wa> described above.
SY-SUBRC is always set to 0. SY-DBCNT is set to the number of lines in the internal table
INSERT
... { {VALUES wa}
| {FROM wa|{TABLE itab [ACCEPTING DUPLICATE KEYS]}} }.
1. ... {VALUES wa} | {FROM wa} ...
2. ... FROM TABLE itab [ACCEPTING DUPLICATE KEYS] ...
After FROM and VALUES, you can specify a non-table-type data object wa. After FROM, you can also specify an internal table itab. The contents of the row(s) to be inserted are taken from these data objects
UPDATE
... { {SET set_expression [WHERE sql_cond]}
| {FROM wa|{TABLE itab}} }.
1. ... SET set_expression [WHERE sql_cond]
2. ... FROM wa
3. ... FROM TABLE itab
The specifications in source define which rows and columns are changed. Either individual columns are changed using the addition SET or entire rows are overwritten using the addition FROM.
After FROM, either a non-table-type data object wa or an internal table itab can be specified. The content of these objects determines - on the one hand - which row(s) is/are changed, and - on the other hand - which values are used to overwrite the row(s).
Check out these related threads
Reward points for useful Answers
Regards
Anji
2007 Jul 02 11:17 AM
Hi
UPDATE<b>:/</b> ZTAB_AC SET ACCOUNTNUMBER = 'AA100', WHERE SERAILNUMBEER = '00020'.
it should be
<b>UPDATE ZTAB_AC SET ACCOUNTNUMBER = 'AA100'
WHERE SERAILNUMBEER = '00020'.</b>
The bold content (:/) is the cause for the error.
Regards
Raj
Message was edited by:
Rajasekhar Dinavahi
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |