cancel
Showing results for 
Search instead for 
Did you mean: 

Unique Number generation in XI

Former Member
0 Kudos

Hi,

In my scenario, the receiver database table has to update by a primary key.The <b>primary key/Unique</b> generation should be done in XI.The generated unique should be <b>16 digit NUMERIC value</b>. Could you please send me the pseudo code for the unique generation in mapping (User defined Function)?

Thank you,

Praveen Kumar

Accepted Solutions (1)

Accepted Solutions (1)

VijayKonam
Active Contributor
0 Kudos

Hi,

If you are using SQL Server database, in the table creation iteself you can specify a Column as seed and SQL Server automatically takes care of making this column unique. No code required even in the inserting SP.

I believe there must be some thing like that existing on Oracle as well, if you are working with Oracle.

Hope this helps.

Vijay

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

We had a similar requriement and instead of using XI to do this we use a Stored Procedure to Insert the data into the database.

The stored procedure used a sequence to update the data into the database for the key fields.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

Could you please eloborate on this

Regards

Praveen

Former Member
0 Kudos

Hi,

We can do it With Number sequence generation in R3,, it depends upon the module you are handling , if R3 is in your integration then better to use this option .

If this is not the case and some other oracle type of database then stored procedure or DB lookup options are possible ways to store the number in database and use it and update the sequence ..

Please let me know if i am not in track..

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Praveen,

You are dealing with JDBC adapter's right?

if yes, instead of doing a Direct Insert, send the data from XI to the Datatbase to invoke a Stored procedure. The stored procedure will / should genereate the unique primrary key as needed using Sequences in Database.

If you are pushing data to a SAP system using RFC / IDoc againg the unique value should be generated by the system when it is inserting the data and not by XI.

Regards

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

As commented, you need to have this value in a DataBase. XI per standard won't support you on that.

You could have it in WAS ABAP of XI and get it/update it with RFC lookup (and some simple ABAP in RFC). But when receiver side is DB (or SAP ABAP), you could have that procedure done in Receiver itself (with stored procedures, in DB; or with logic in RFC of receiver, if your receiver is ABAP).

Regards,

Henrique.