Hi Ashok, We initially thought this, hence i updated the forum saying this issue we replicated in our Test system also, where we are analysis now.
Start routine:
PROGRAM trans_routine.
*---------------------------------------------------------------------*
* CLASS routine DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
* Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
* Available information: Refer to methods of
* interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
* Rule specific types
TYPES:
BEGIN OF _ty_s_SC_1,
* InfoObject: 0SOURSYSTEM Source system ID.
SOURSYSTEM TYPE RSSOURSYSID,
* InfoObject: 0LOGSYS Source System.
LOGSYS TYPE RSDLOGSYS,
* InfoObject: D00014532 Performance Measurement.
/BIC/D00014532 TYPE /BIC/OID00014532,
* InfoObject: D00026888 Event type.
/BIC/D00026888 TYPE /BIC/OID00026888,
* InfoObject: D00026889 Event counter.
/BIC/D00026889 TYPE /BIC/OID00026889,
* InfoObject: D00026891 Version type.
/BIC/D00026891 TYPE /BIC/OID00026891,
* InfoObject: D00026892 Version no..
/BIC/D00026892 TYPE /BIC/OID00026892,
* InfoObject: D00026887 Header handle.
/BIC/D00026887 TYPE /BIC/OID00026887,
* InfoObject: 0RECORDMODE BW Delta Process: Update Mode.
RECORDMODE TYPE RODMUPDMOD,
* InfoObject: D00009899 UTC End Time.
/BIC/D00009899 TYPE /BIC/OID00009899,
* Field: RECORD.
RECORD TYPE RSARECORD,
END OF _ty_s_SC_1.
TYPES:
_ty_t_SC_1 TYPE STANDARD TABLE OF _ty_s_SC_1
WITH NON-UNIQUE DEFAULT KEY.
*$*$ begin of global - insert your declaration only below this line *-*
... "insert your code here
*$*$ end of global - insert your declaration only before this line *-*
METHODS
start_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
segid type rsbk_segid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
SOURCE_PACKAGE type _ty_t_SC_1
RAISING
cx_rsrout_abort
cx_rsbk_errorcount.
METHODS
inverse_start_routine
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
I_R_SELSET_OUTBOUND TYPE REF TO CL_RSMDS_SET
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO CL_RSMDS_UNIVERSE
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO CL_RSMDS_SET
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
*$*$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
** For OTIF Reason Code Project** 16th Nov 2011 By t608412**
TYPES: BEGIN OF t_reason_code,
event_handle TYPE /bic/adomdo52600-/bic/D00026887,
event_type TYPE /bic/adomdo52600-/bic/D00026888,
event_count TYPE /bic/adomdo52600-/bic/D00026889,
reason_line TYPE /bic/adomdo52600-/bic/D00021401,
Event_Point type /bic/adomdo52600-/bic/D00021426,
END OF t_reason_code.
DATA: i_reason_code TYPE STANDARD TABLE OF t_reason_code,
wa_reason_code TYPE t_reason_code.
data: t_event type /BIC/OID00026888.
***range table declaration
data : r_event like range of t_event.
***Work area for range table
data : w_event like line of r_event.
***pass values in workarea which you want to delete one by one and
*append in range table
DATA: i_source type standard table of /bic/adomdo50800,
wa_source like line of i_source.
* modified on 13th June*
DATA: i_source1 type standard table of /bic/adomdo50800,
wa_source1 like line of i_source1.
*************************************
* Charm:- 8000030211
* User:- U334859
* Changes to capture event date for all event type
**************************************
DATA: i_source_ORD type standard table of /bic/adomdo50800,
wa_source_ORD like line of i_source_ORD.
DATA: i_source_PROD type standard table of /bic/adomdo50800,
wa_source_PROD like line of i_source_PROD.
DATA: i_source_LOG type standard table of /bic/adomdo50800,
wa_source_LOG like line of i_source_LOG.
DATA: i_source_trans type standard table of /bic/adomdo50800,
wa_source_trans like line of i_source_trans.
DATA : i_source_atdloadport type standard table of /bic/adomdo50800,
wa_source_atdloadport like line of i_source_atdloadport.
DATA : i_source_etadestport type standard table of /bic/adomdo50800,
wa_source_etadestport like line of i_source_etadestport.
DATA : i_source_etdloadport type standard table of /bic/adomdo50800,
wa_source_etdloadport like line of i_source_etdloadport.
DATA : i_source_etatransitport type standard table of /bic/adomdo50800,
wa_source_etatransitport like line of i_source_etatransitport.
DATA : i_source_atatransitport type standard table of /bic/adomdo50800,
wa_source_atatransitport like line of i_source_atatransitport.
DATA : i_source_etdtransitport type standard table of /bic/adomdo50800,
wa_source_etdtransitport like line of i_source_etdtransitport.
DATA : i_source_atdtransitport type standard table of /bic/adomdo50800,
wa_source_atdtransitport like line of i_source_atdtransitport.
DATA : i_source_ataloadport type standard table of /bic/adomdo50800,
wa_source_ataloadport like line of i_source_ataloadport.
DATA : i_source_actdestport type standard table of /bic/adomdo50800,
wa_source_actdestport like line of i_source_actdestport.
DATA : i_source_exparrvport type standard table of /bic/adomdo50800,
wa_source_exparrvport like line of i_source_exparrvport.
DATA : i_source_actarrvport type standard table of /bic/adomdo50800,
wa_source_actarrvport like line of i_source_actarrvport.
DATA : i_source_goodreceipt type standard table of /bic/adomdo50800,
wa_source_goodreceipt like line of i_source_goodreceipt.
DATA : i_source_atadestport type standard table of /bic/adomdo50800,
wa_source_atadestport like line of i_source_atadestport.
DATA : i_source_planpickup type standard table of /bic/adomdo50800,
wa_source_planpickup like line of i_source_planpickup.
DATA : i_source_actpickup type standard table of /bic/adomdo50800,
wa_source_actpickup like line of i_source_actpickup.
*************************************************************
*$*$ end of 2nd part global - insert your code only before this line *
*---------------------------------------------------------------------*
* CLASS routine IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_transform IMPLEMENTATION.
*----------------------------------------------------------------------*
* Method start_routine
*----------------------------------------------------------------------*
* Calculation of source package via start routine
*----------------------------------------------------------------------*
* <-> source package
*----------------------------------------------------------------------*
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE _ty_s_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
DATA: i_package TYPE STANDARD TABLE OF _ty_s_SC_1,
wa_package TYPE _ty_s_SC_1.
clear : w_event.
***Event ATD
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'WSHDR0006'.
append w_event to r_event.
***Event ICRAD/ACRAD
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'WSHDR0008'.
append w_event to R_event.
***Event production
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0010'.
append w_event to R_event.
***Event Site Logistics
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0011'.
append w_event to R_event.
***Event Transportation
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0012'.
append w_event to R_event.
***Event Order Management
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0013'.
append w_event to R_event.
***Event First Confirmed Delivery date
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0016'.
append w_event to R_event.
** Addition of more Events for LogVis**
** Changed By : T587223 .
** Date : 13-12-2012.
***Event ATD Loading Port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'WSHDR0006'.
append w_event to R_event.
***Event ATA Destination Port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'WSHDR0007'.
append w_event to R_event.
***Event ETA Destination port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0014'.
append w_event to R_event.
***Event ETD Loading port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0015'.
append w_event to R_event.
***Event ETA Transit port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0021'.
append w_event to R_event.
***Event ATA Transit port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0022'.
append w_event to R_event.
***Event ETD TRansit port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0023'.
append w_event to R_event.
***Event ATD Transit Port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0024'.
append w_event to R_event.
***Event ATA Loading port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0025'.
append w_event to R_event.
***Event Actual pick up , Destination port
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0026'.
append w_event to R_event.
***Event Expected arrival at door
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0027'.
append w_event to R_event.
***Event Actual arrival at door
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0028'.
append w_event to R_event.
***Event Goods Receipt
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'YSHDR0029'.
append w_event to R_event.
***Planned/Actual Pick Up by Haulier
w_event-sign = 'I'.
w_event-option = 'EQ'.
w_event-low = 'WSHDR0001'.
append w_event to r_event.
** For OTIF Reason Code Project** 16th Nov 2011 By t608412**
********* For Event Type ******************
REFRESH: i_reason_code.
IF SOURCE_PACKAGE IS NOT INITIAL.
***Deleting rest of the events which are not in R_event.
Delete SOURCE_PACKAGE[] where /BIC/D00026888 NOT in r_event.
*******START ( 13.06.2012 )*******
Delete SOURCE_PACKAGE[] where /BIC/D00026891 NE '0'.
SORT SOURCE_PACKAGE[] BY /BIC/D00014532 /BIC/D00026888
/BIC/D00026889
DESCENDING.
DELETE ADJACENT DUPLICATES FROM SOURCE_PACKAGE[] COMPARING
/BIC/D00014532.
***********************************
***Deleting source package where the version type is not equal to plan.
*Delete SOURCE_PACKAGE[] where /BIC/D00026891 NE '0'.
*
***Sort the source comparing Delivery , event and event type descending.
*SORT SOURCE_PACKAGE[] BY /BIC/D00014532 /BIC/D00026888 /BIC/D00026889
*DESCENDING.
**Deleting will remove the duplicate events and will get the highest
**counter
*DELETE ADJACENT DUPLICATES FROM SOURCE_PACKAGE[] COMPARING
*/BIC/D00014532 /BIC/D00026888.
Select *
from /BIC/ADOMDO50800
into table i_source
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026891 = '0'.
***Deleting rest of the events which are not in R_event.
Delete I_SOURCE[] where /BIC/D00026888 NOT in r_event.
**Sort the source comparing Delivery , event and event type descending.
SORT I_SOURCE[] BY /BIC/D00014532 /BIC/D00026888 /BIC/D00026889
DESCENDING.
*Deleting will remove the duplicate events and will get the highest
*counter
DELETE ADJACENT DUPLICATES FROM I_SOURCE[] COMPARING
/BIC/D00014532 /BIC/D00026888.
*modified on 13th June*
Select *
from /BIC/ADOMDO50800
into table i_source1
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'WSHDR0006'
and /BIC/D00026891 = '1'.
SORT I_SOURCE1[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
************
SELECT /bic/d00026887
/bic/d00026888
/bic/d00026889
/bic/d00021401
/bic/D00021426
INTO TABLE i_reason_code
FROM /BIC/ADOMDO52600
FOR ALL ENTRIES IN SOURCE_PACKAGE[]
WHERE /bic/d00026887 = SOURCE_PACKAGE-/bic/d00026887.
SORT i_reason_code BY event_handle event_type event_count
DESCENDING.
*************************************
* Charm:- 8000030211
* User:- U334859
* Changes to capture event date for all event type
**************************************
* Order managment
Select *
from /BIC/ADOMDO50800
into table i_source_ORD
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0013'
and /BIC/D00026891 = '0'.
SORT i_source_ORD[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Production managment
Select *
from /BIC/ADOMDO50800
into table i_source_PROD
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0010'
and /BIC/D00026891 = '0'.
SORT i_source_PROD[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Site Logistics
Select *
from /BIC/ADOMDO50800
into table i_source_LOG
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0011'
and /BIC/D00026891 = '0'.
SORT i_source_LOG[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Transportation
Select *
from /BIC/ADOMDO50800
into table i_source_trans
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0012'
and /BIC/D00026891 = '0'.
SORT i_source_trans[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
** Changes made for Log Vis .
** Changed By : T587223.
** Date : 13-12-2012.
* ATD Loading port
Select *
from /BIC/ADOMDO50800
into table i_source_atdloadport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'WSHDR0006'
and /BIC/D00026891 = '1'.
SORT i_source_atdloadport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ATA Destination port
Select *
from /BIC/ADOMDO50800
into table i_source_atadestport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'WSHDR0007'
and /BIC/D00026891 = '1'.
SORT i_source_atadestport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ETA Destination port
Select *
from /BIC/ADOMDO50800
into table i_source_etadestport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0014'
and /BIC/D00026891 = '1'.
SORT i_source_etadestport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ETD Loading port
Select *
from /BIC/ADOMDO50800
into table i_source_etdloadport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0015'
and /BIC/D00026891 = '1'.
SORT i_source_etdloadport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ETA Transit port
Select *
from /BIC/ADOMDO50800
into table i_source_etatransitport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0021'
and /BIC/D00026891 = '1'.
SORT i_source_etatransitport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ATA Transit port
Select *
from /BIC/ADOMDO50800
into table i_source_atatransitport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0022'
and /BIC/D00026891 = '1'.
SORT i_source_atatransitport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ETD Transit port
Select *
from /BIC/ADOMDO50800
into table i_source_etdtransitport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0023'
and /BIC/D00026891 = '1'.
SORT i_source_etdtransitport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ATD Transit port
Select *
from /BIC/ADOMDO50800
into table i_source_atdtransitport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0024'
and /BIC/D00026891 = '1'.
SORT i_source_atdtransitport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* ATA Loading port
Select *
from /BIC/ADOMDO50800
into table i_source_ataloadport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0025'
and /BIC/D00026891 = '1'.
SORT i_source_ataloadport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Actual Pick up Destination Port
Select *
from /BIC/ADOMDO50800
into table i_source_actdestport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0026'
and /BIC/D00026891 = '1'.
SORT i_source_actdestport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Expected Arrival at Door
Select *
from /BIC/ADOMDO50800
into table i_source_exparrvport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0027'
and /BIC/D00026891 = '1'.
SORT i_source_exparrvport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Actual Arrival at Door
Select *
from /BIC/ADOMDO50800
into table i_source_actarrvport
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0028'
and /BIC/D00026891 = '1'.
SORT i_source_actarrvport[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Goods Receipt
Select *
from /BIC/ADOMDO50800
into table i_source_goodreceipt
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'YSHDR0029'
and /BIC/D00026891 = '1'.
SORT i_source_goodreceipt[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Planned PickUp by Haulier
Select *
from /BIC/ADOMDO50800
into table i_source_planpickup
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'WSHDR0001'
and /BIC/D00026891 = '0'.
SORT i_source_planpickup[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
* Actual PickUp by Haulier
Select *
from /BIC/ADOMDO50800
into table i_source_actpickup
For all entries in SOURCE_PACKAGE[]
where /BIC/D00014532 = SOURCE_PACKAGE-/BIC/D00014532
and /BIC/D00026888 = 'WSHDR0001'
and /BIC/D00026891 = '1'.
SORT i_source_actpickup[] BY /BIC/D00014532 /BIC/D00026889
DESCENDING.
ENDIF.
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.
*$*$ end of routine - insert your code only before this line *-*
ENDMETHOD. "start_routine
*----------------------------------------------------------------------*
* Inverse method inverse_start_routine
*----------------------------------------------------------------------*
* This subroutine needs to be implemented only for direct access
* (for better performance) and for the Report/Report Interface
* (drill through).
* The inverse routine should transform a projection and
* a selection for the target to a projection and a selection
* for the source, respectively.
* If the implementation remains empty all fields are filled and
* all values are selected.
*----------------------------------------------------------------------*
* Customer comment:
*----------------------------------------------------------------------*
METHOD inverse_start_routine.
* IMPORTING
* i_r_selset_outbound TYPE REF TO cl_rsmds_set
* i_th_fields_outbound TYPE HASHED TABLE
* i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
* i_r_universe_inbound TYPE REF TO cl_rsmds_universe
* CHANGING
* c_r_selset_inbound TYPE REF TO cl_rsmds_set
* c_th_fields_inbound TYPE HASHED TABLE
* c_exact TYPE rs_bool
*$*$ begin of inverse routine - insert your code only below this line*-*
... "insert your code here
*$*$ end of inverse routine - insert your code only before this line *-*
ENDMETHOD. "inverse_start_routine
ENDCLASS. "routine IMPLEMENTATION
each field below is a code:
CLEAR: wa_source_etdloadport.
READ TABLE i_source_etdloadport INTO wa_source_etdloadport
WITH KEY /BIC/D00014532 = SOURCE_FIELDS-/BIC/D00014532
/BIC/D00026888 = 'YSHDR0015'.
IF SY-SUBRC EQ 0.
RESULT = wa_source_etdloadport-/BIC/D00009899.
ENDIF.
Regards,
Ganesh