Skip to Content
0
Nov 30, 2009 at 12:18 PM

native sql && BUT000

54 Views

In my function I am using the following code:

DATA: lv_message TYPE string.
DATA: sql_error  TYPE REF TO cx_sy_native_sql_error.
DATA: dbcursor   TYPE c.

TRY.
  EXEC SQL.
    open :dbcursor for
    SELECT partner
    FROM but000
    WHERE UPPER(name_first) LIKE :name_first
  ENDEXEC.
  CATCH cx_sy_native_sql_error INTO sql_error.
    lv_message = sql_error->get_text( ).
    MESSAGE lv_message TYPE 'E'.
ENDTRY.

This is giving the error message: "You tried to work with the name of a table or view that does not exist in the database".

Same error message occurs when I add the declaration: TABLES but000.

How can this be solved?

Kind regards,

Lieselot