Hi Gareth,
Let me summarize your solution:
DATASOURCE -> NEW_DSO: (i will add the Change_Flag field)
Customer - KEY
Status_Code - KEY
Status_Date - KEY
Flag_for_Deletion
Change_Flag
I will also add an end routine (is the routine correct?):
DATA: it_result_pack TYPE STANDARD TABLE OF _ty_s_TG_1,
wa_result_pack LIKE LINE OF it_result_pack,
l_t_new type standard table of NEW_DSO.
it_result_pack[] = RESULT_PACKAGE[].
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE l_t_new
FROM NEW_DSO WHERE flag_for_deletion <> 'X'.
LOOP AT it_result_pack INTO wa_result_pack where flag_for_deletion <> 'X'.
READ TABLE l_t_new with key
customer = wa_result_pack-customer
status_code = wa_result_pack-status_code
status_date = wa_result_pack-status_date
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
wa_result_pack-change_flag = 'X'.
ENDIF.
MODIFY RESULT_PACKAGE INDEX sy-tabix FROM wa_result_pack.
ENDLOOP.
Just a query, may I know the difference if I will use the field symbol instead of my revised code? I am just not used with field symbol..![]()
Are they the same?
Then I will create another DSO between SALES_DSO and CUBE..
SALES_DSO -> ANOTHER_DSO -> CUBE: (ANOTHER_DSO and CUBE will have the same fields)
Customer - KEY
Calday - KEY
Qty
Status_Code - KEY
Status_Date - KEY
In transformation level of SALES_DSO and ANOTHER_DSO, I will have these routines:
STATUS CODE
data: temp_date like sy-datum.
select single max( Status_Date) from NEW_DSO into temp_date
where Customer = SOURCE_FIELDS-Customer and Status_Date <=
SOURCE_FIELDS-Calday and Flag_for_DeletionNE 'X'.
select single Status_Codefrom NEW_DSO into RESULT
where Customer = SOURCE_FIELDS-Customer and Status_Date = temp_date
and Flag_for_DeletionNE 'X'.
STATUS DATE
select single max( Status_Date) from NEW_DSO into temp_date
where Customer = SOURCE_FIELDS-Customer and Status_Date <=
SOURCE_FIELDS-Calday and Flag_for_DeletionNE 'X'.
I will also add a self transformation for ANOTHER_DSO which will have a FULL DTP filter where I will lookup the list customers having an 'X' in their Change_Flag field and load its value from SALES_DSO..
May I ask for a sample code for this?
OR is this correct? Routine in the DTP of self load transformation of ANOTHER_DSO..
data: it_pack type STANDARD TABLE OF NEW_DSO,
wa_pack like LINE OF it_pack.
select Customer
from NEW_DSO
into CORRESPONDING FIELDS OF TABLE it_pack
where change_flag = 'X'.
delete ADJACENT DUPLICATES FROM it_pack.
loop at it_pack into wa_pack.
l_t_range-IOBJNM = 'Customer'.
l_t_range-FIELDNAME = 'Customer'.
l_t_range-sign = 'I'.
l_t_range-option = 'EQ'.
l_t_range-low = wa_pack-customer.
APPEND l_t_range.
endloop.
Did I miss something from your suggestions?
Thank you..
Loed