Hi guyz,
Just want to ask how can I enhance the standard datasource 0RT_PA_TRAN_CONTROL with the field name FIELDGROUP, FIELDNAME, and FIELDVALUE from /POSDW/TLOGF table?
I already appended the three (3) fields (using the /POSDW/EXTENSIONS_FD structure) in the extract structure of 0RT_PA_TRAN_CONTROL (see images above)..
Afterwards, I created a BADI based on the document below:
method IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM.
CHECK i_datasource = '0RT_PA_TRAN_CONTROL'.
DATA: lt_data TYPE TABLE OF /POSDW/BW_RETAIL_CONTROL.
FIELD-SYMBOLS: <ls_data> TYPE /POSDW/BW_RETAIL_CONTROL.
*----------------------------------------------------------------*
* Internal table for /POSDW/TLOGF
*----------------------------------------------------------------*
TYPES:
BEGIN OF ty_tran_control,
FIELDGROUP TYPE /POSDW/BW_RETAIL_CONTROL-FIELDGROUP,
FIELDNAME TYPE /POSDW/BW_RETAIL_CONTROL-FIELDNAME,
FIELDVALUE TYPE /POSDW/BW_RETAIL_CONTROL-FIELDVALUE,
RETAILSTOREID TYPE /POSDW/BW_RETAIL_CONTROL-RETAILSTOREID,
BUSINESSDAYDATE TYPE /POSDW/BW_RETAIL_CONTROL-BUSINESSDAYDATE,
TRANSINDEX TYPE /POSDW/BW_RETAIL_CONTROL-TRANSINDEX,
END OF ty_tran_control.
DATA:
lt_tran_control type standard table of ty_tran_control,
ls_tran_control type ty_tran_control.
lt_data[] = c_t_data[].
*----------------------------------------------------------------*
* Read data into internal memory
*----------------------------------------------------------------*
select
FIELDGROUP
FIELDNAME
FIELDVALUE
RETAILSTOREID
BUSINESSDAYDATE
TRANSINDEX
from /POSDW/TLOGF
into table lt_tran_control
for all entries in lt_data
where
RETAILSTOREID = lt_data-RETAILSTOREID and
BUSINESSDAYDATE = lt_data-BUSINESSDAYDATE and
TRANSINDEX = lt_data-TRANSINDEX.
LOOP AT lt_data ASSIGNING <ls_data>.
read table lt_tran_control into ls_tran_control
with key
RETAILSTOREID = <ls_data>-RETAILSTOREID
BUSINESSDAYDATE = <ls_data>-BUSINESSDAYDATE
TRANSINDEX = <ls_data>-TRANSINDEX.
if sy-subrc eq 0.
<ls_data>-FIELDGROUP = ls_tran_control-FIELDGROUP.
<ls_data>-FIELDNAME = ls_tran_control-FIELDNAME.
<ls_data>-FIELDVALUE = ls_tran_control-FIELDVALUE.
MODIFY lt_data FROM <ls_data>.
endif.
ENDLOOP.
REFRESH c_t_data.
c_t_data[] = lt_data[].
endmethod.
Did I do it right? How can I test if the BADI is working? I tried to run a DELTA infopackage in BW but no data was extracted.
Do I need to create a new transaction from POSDM? If yes, how will I do it? Sorry I'm not familiar with POSDM, I'm a BW developer..
Also, while searching for other documents, I saw this document..
Enhancements for 0RT_PA_TRAN_CONTROL POS Analytics (POSDM) Datasources
Are they the same? Will they both work? Which is better to implement?
Thank you.
Loed