on 2016 Jun 10 12:03 PM
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
Request clarification before answering.
Leslaw,
Could you please mention the logic in word, so i can write abap code for the logic.
Thanks,
Anish Samuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
Hi Leslaw,
Use a continue statment in the else part this helps to skip the loop iteration.
See example below for make it clear how this works.
CONTINUE statement in ABAP is used for terminating the current loop iteration and start the next iteration. This statement can only used with the loops like
See the following sample code and its result for better understand.
DO 10 TIMES.
IF SY-INDEX >= 0 AND SY-INDEX <= 6. CONTINUE.
WRITE: SY-INDEX, ‘ ‘.
ENDIF.
…
ENDDO.
Its output will be:
7 8 9 10.
Thanks,
Madhu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.