cancel
Showing results for 
Search instead for 
Did you mean: 

Unique IDs in Dictionary Project (NW Developer Studio 7.0)

Former Member
0 Kudos

Hi all,

I am working with NWDS 7.0 and creating a table in Java Schema with a Dictionary Project.

What I need is a unique ID field with auto-increment value. How do I create such a field? Is this possible at all? Before we use workarounds such as java.rmi.server.UID, creating tables with Oracle, utilizing stored procedures, etc. we would like to know if this can be achieved with a standard dictionary project.

Any comments will be appreciated and rewarded.

Accepted Solutions (1)

Accepted Solutions (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Cuneyt,

how about using the ENQ API? It has a method called getUniqueIncreasingNumber()

see http://help.sap.com/javadocs/NW04S/current/en/index.html

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

if you use entity beans for O/R Mapping and your unique id will be the primary key you could also try and use automatic primary key generation. The documentation can be found here:

http://help.sap.com/saphelp_nw04s/helpdata/en/b3/b238bfd13a8f408958d70a6989d001/frameset.htm

However, I think you do not have much influence on how the keys will be generated.

Another possiblity if you use entity beans is the Entity Bean Primary Key Generator from Floyd Marinescu:

http://www.theserverside.com/patterns/thread.tss?thread_id=220

These solutions both do not rely on any special database requirements.

Best regards,

Stefan Brauneis