cancel
Showing results for 
Search instead for 
Did you mean: 

Update Rules - Creating Unique Record Identifier

Former Member
0 Kudos

Hello,

I am using 2LIS_03_UM and 2LIS_03_BF to load to a custom datastore.

The material movements data is coming across with no problem but the revaluation data is giving me a bit of a problem.

For example - I have 2 records in the PSA that are identical. When I load to the datastore, one will be overlaid. I have tweaked the datastore key until I can bring nothing else in that makes it unique thus the need for a unique number for each record.

The end users need all the revaluation data.

I have found that I can create a start routine in the update rule to create a unique identifier but I have another question. Is there any way that I can use the data packet and data record number coming in from the PSA and have that part of my key in the ods?

Also, is there an easier way?

This is more complicated than what I have had to do before.

Here is the other code that I found from the forum posted by Yogesh Kulkarni (thanks!).

TABLES: /bic/aODSNAME00,

/bic/aODSNAME40.

DATA: w_no(30) TYPE n,

w_unq_key00(30) TYPE n,

w_unq_key(30) TYPE n,

w_unq_key = 0.

w_unq_key00 = 0.

SELECT COUNT( * ) INTO w_no FROM /bic/aODSNAME40 UP TO 5 ROWS.

IF w_no EQ 0.

SELECT MAX( /BIC/ZCIAUNIQT ) INTO w_unq_key00 FROM /bic/aODSNAME00.

IF w_unq_key00 = '0' .

w_unq_key = 1.

ELSE .

w_unq_key = w_unq_key00 .

ENDIF.

ELSE.

SELECT MAX( /BIC/ZCIAUNIQT ) INTO w_unq_key FROM /bic/aODSNAME40.

ENDIF.

LOOP AT DATA_PACKAGE.

w_unq_key = w_unq_key + 1.

DATA_PACKAGE-/BIC/ZCIAUNIQT = w_unq_key.

MODIFY DATA_PACKAGE.

ENDLOOP.

________________________________________

Any help is appreciated,

Lynda

Accepted Solutions (1)

Accepted Solutions (1)

former_member192142
Contributor
0 Kudos

Hi,

Are you on BI 7.0? If so, then you could use a write optimized DSO. That type of DSO automatically creates a technical key consisting of Request GUID, Data Package and Record number. Just what you need 🐵

Best regards,

Jacob

Former Member
0 Kudos

Yes, we are on bi 7.0. I did not realize that - a big thank you.

I will start working on my solution with you answer!

Thanks!!!!

Lynda

Answers (0)