cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP code for not overwriting existing value while loading to cube.

former_member194898
Active Contributor
0 Kudos
835

Hi,

How to prevent transformation from overwriting existing value in the given field when there's nothing to load ie loaded value is initial or "" WHILE LOADING transactional data from 0figl_O14 to data cube.

I tried to use code like this

but RAISE EXCEPTION TYPE CX_RSOUT_SKIP_RECORD instruction can't be used as it causes not loading entire record.

What can be use instead of that RAISE... instruction ???

Regards, Leszek

View Entire Topic
anish_samuel
Explorer
0 Kudos

Leslaw,

Could you please mention the logic in word, so i can write abap code for the logic.

Thanks,

Anish Samuel

former_member194898
Active Contributor
0 Kudos

Hi, some more explanation:

Data should be loaded from DSO to data cube.

There is a source field in dso and destination field in cube.

The loads works on document number l(doc no) evel as many times as document positions (doc pos) exists.

The problem is that sometimes loading from first position of the document fetches proper value and then in the second position of the same dokument there's unwanted value ie "" or initial and that overwrites what has been written to that field before.

The proper value should not be overwritten by that "" or initial like in the picture below.

Regards, Leszek  

Former Member
0 Kudos

Do you have document position in Target. As shown in your scren above doesnt have Doc Pos in Target.

Madhu.

anindya_bose
Active Contributor
0 Kudos

Hi Leslaw

I assume your Data Flow is like  DataSource---->DSO----->Cube

It seems you want REF_DOC_NUM to be populated for a doc , if for a particular position REF_DOC is blank but is has the value for some other position .

In  transformation DSO --->Cube , create a start routine which would read like this...

Select Doc Num  ref_doc_num from DSO into table it_doc where ref_doc_num != ' '

for all entries in SOURCE_PACKAGE where DOC_NUM = SOURCE_PACKAGE-DOC_NUM.

In the field routine read this internal table if your SOURCE_FIELD is blank .

Instead of field routine, complete logic can be implemented in start or end routine for better performance. Here we are reading the same source DSO and see if the value is populated .

Note: Cube does not overwrite record , for every load it would create a separate record.

Regards

Anindya

Former Member
0 Kudos

Hi Leszek,

This can be achieved with few lines of code, however I believe your requirement is little ambiguous.

Because when you have just 2 records with source field one populated and other blank then we can assign the filled value to blank value however if you have more than 1 filled values similar like below then how you expect it to work?

When you clarify this doubt then its easy to handle actually .

Thanks

Amit