Hi experts,
I have seen other threads about this issue, however few example code.I based my code in a thread but still no success.
Let me explain my problem. Im trying to make to two registers in destination for each one on the source.
Example:
Source ODS
CREDIT SECECO KF1 KF2
000001 ABC 5.5 10.1
000002 EFG 6.3 11.5
Expected Result: Destination ODS (Key Values = CREDIT, TYPE)
CREDIT SECECO TYPE KF3
000001 ABC 1 5.5
000001 ABC 2 10.1
000002 EFG 1 6.3
000002 EFG 2 11.5
Real Result 1:
CREDIT SECECO TYPE KF3
000001 00 1 5.5
000001 00 2 10.1
000002 00 1 6.3
000002 00 2 11.5
Im using a return table for Update routine KF3 and it is working fine. However SECECO (a characteristic) is getting blank values always.
Here my code:
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
RESULT_TABLE STRUCTURE /BIC/AZBI990400
USING COMM_STRUCTURE LIKE /BIC/CS8ZBI9905
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
ICUBE_VALUES LIKE /BIC/AZBI990400
CHANGING RETURNCODE LIKE SY-SUBRC "Do not use!
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
$$ begin of routine - insert your code only below this line -
fill the internal table "MONITOR", to make monitor entries
DATA:
RESULT_TABLE = ICUBE_VALUES.
RESULT_TABLE-/bic/KF3 = COMM_STRUCTURE-/BIC/KF1.
RESULT_TABLE-/bic/SECECO = COMM_STRUCTURE-/BIC/SECECO.
RESULT_TABLE-/bic/TYPE = 1.
APPEND RESULT_TABLE.
RESULT_TABLE-/bic/KF3 = COMM_STRUCTURE-/BIC/KF2.
RESULT_TABLE-/bic/SECECO = COMM_STRUCTURE-/BIC/SECECO.
RESULT_TABLE-/bic/TYPE = 2.
APPEND RESULT_TABLE.
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.[/code]
The Update Rules for SECECO is left as Blank. I tried mapping it to SECECO but the result was this:
Real Result 2:
CREDIT SECECO TYPE KF3
000001 ABC 0.0
000001 00 1 5.5
000001 00 2 10.1
000002 EFG 0.0
000002 00 1 6.3
000002 00 2 11.5
I have already tried with a fixed value like the one for TYPE, still no succees. The only difference between SECECO and TYPE is that TYPE is part of the key of the ODS Destiny. However SECECO must not be part of the key.
I also tried looping the RESULT_TABLE at the end and assigning the value directly to SECECO with the same result.
¿What else should I consider?
Thanks, I would award points.
DavidG