cancel
Showing results for 
Search instead for 
Did you mean: 

I Need help on Sequences

Former Member
0 Kudos

Hello,

I'm new to ABAP programming and I'm creating a system from scratch. I'm using SAP netweaver trial with the default user known as "bcuser". I am creating a custom table and basically what I want is to have a primary key that auto-increments. I want to use "SEQUENCES" to do it but then I'm having a problem. I don't see much tutorial about MaxDB over the internet so I guess someone here might assist me.

So I tried the example "CREATE SEQUENCE xxx", and I'm getting an error like the "SEQUENCE" keyword can't be understood by the compiler. To be specific, error is something like

"Unable to interpret "SEQUENCE". Possible causes: Incorrect spelling or comma error."

I tried to google this error but to no avail. It seems like SAP errors are unknown to the world.

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Hi again.

You should have mentioned that you want to use MaxDB from ABAP and want to do custom development.

SEQUENCES are dbms-dependent objects, which don't have a direct equivalent in ABAP.

In ABAP what most people to to get some random but unique number is to either use number range objects (check the abap documentation for this) or to use GUIDs.

The number range objects can be buffered and when they are, locking occurs rather seldom.

Another thing you should think of is: why do you need such a number? Quite often having surrogate keys is done due to a design mistake in your data design.

Concerning documentation... have you tried the search field in the upper right corner? I don't think so.

Have you checked http://maxdb.sap.com/documentation ? Doesn't look like you did.

What about http://help.sap.com ?

regards,

Lars