Skip to Content
0
Former Member
Mar 28, 2008 at 01:35 PM

Error message: 'ORA-00926:missing VALUES keyword

278 Views

Hi Friends,

I am trying to update a database table in SAPR3.ORACLE database from CRM via an ABAP program.

I did required BDCON setup. But I get the error message : ORA-00926:missing VALUES keyword.

Looking forward your help to solve this problem. Anyone came across such issue?

below is my code and BDCON setup

DB Connection DB_CONNECT

DBMS ORA

User Name test_db

DB password

Conn. info sapde9db00a

Connection Limit 10

Optimum Conns 5

TABLES: BUT000.

DATA: EXC_REF TYPE REF TO CX_SY_NATIVE_SQL_ERROR,

ERROR_TEXT TYPE STRING.

DATA W_PARTNER TYPE BUT000-PARTNER.

TYPES: BEGIN OF TYP_PARTNER,

MANDT TYPE SY-MANDT,

PARTNER_NUMBER TYPE BU_PARTNER,

END OF TYP_PARTNER.

DATA: ZZ_TEST TYPE STANDARD TABLE OF TYP_PARTNER WITH HEADER LINE.

DATA: DBTYPE TYPE DBCON_DBMS,

DBCUR TYPE CURSOR,

T_BUT000 LIKE BUT000 OCCURS 0 WITH HEADER LINE.

SELECT * INTO CORRESPONDING FIELDS OF TABLE T_BUT000 FROM BUT000 ORDER BY PRIMARY KEY.

LOOP AT T_BUT000.

ZZ_TEST-MANDT = SY-MANDT.

ZZ_TEST-PARTNER_NUMBER = T_BUT000-PARTNER.

APPEND ZZ_TEST.

ENDLOOP.

TRY.

EXEC SQL.

SET CONNECTION 'DB_CONNECT'

ENDEXEC.

EXEC SQL.

CONNECT TO 'DB_CONNECT'

ENDEXEC.

  • LOOP AT ZZ_TEST.

EXEC SQL.

INSERT INTO SAPR3."ZZTEST_DB":

(mandt, partner_number) VALUES('220', '0000000253');

ENDEXEC.

IF SY-SUBRC <> 0.

ENDIF.

  • ENDLOOP.

CATCH CX_SY_NATIVE_SQL_ERROR INTO EXC_REF.

ERROR_TEXT = EXC_REF->GET_TEXT( ).

MESSAGE ERROR_TEXT TYPE 'I'.

ENDTRY.

EXEC SQL.

SET CONNECTION DEFAULT

ENDEXEC.

Thanks in advance for you help,

regards

DJ