05-14-2008 6:50 AM
Hi,
I have created a sequence in my SAP DB..We are using MAXDB database as our backend.
I have created a sequence in back end editor directly in database editor in server.
when we give query select apid_seq.nextval from dual means it will give the next value in the sequence..
Now i wrote this query in abap editor and execute it to get the maximum of sequence..but it is throwing error..
how to get the sequence through query..
can any body help me in this
05-14-2008 9:41 AM
Hi Mahesh,
in standard Open SQL ABAP you can only access fields that are defined in the ABAP DDIC. If you create something directly in the DB, bypassing the DDIC, Open SQL will not know about the field(s), which will cause an error.
From my point of view, you can do one of two things:
1. Use native SQL (EXEC SQL. ... ). However, this would make your code non-portable across different RDBMSs.
2. Use ABAP number ranges. These are the ABAP equivalent to database sequences and are portable across database systems.
I would strongly suggest to use number ranges. Have a look on help.sap.com for the details.
Kind regards, Joerg Wegener
05-14-2008 9:45 AM