Skip to Content
0
Former Member
Oct 08, 2009 at 11:54 AM

How to "auto" generate "Primary Key" in custom table?

1088 Views

Hi Folks,

Requirement:

I need a function module or program that can create automatically a primary key.

Scenario:

I have a program that creates an entries and save it to a custom table at the same time, but a primary key should always be generated respective to the entries saved.

Example:

Material(MATNR) 4001001, Plant(WERKS) XX01, ID[Primary Key-auto generated]

(I'm thinking of a similar concept/logic on how a unique IDOC number is being generated or how SAP standard creates a unique entry)

I try to look for any SAP FM that can generate a PK, but there's no luck.

Thanks.

Regards,

Jun