Hi,
I am working on ECC-EM creation where I have created a returns order and based on this I am trying to create a GR and monitor the event handlers there. However I am getting below enclosed error message.
Secondly I am using OBP20_DELIVERY where I want to monitor both inbound and outbound deliveries. But strangely when I am activating inbound deliveries, the outbound deliveries EH is not generated and vice versa.Can you tell me wheather the AOT OBP20_DELIVERY can be used for both inbound and outbound deliveries?
ZOBP20_DELIV copied from OBP20_DELIV, only used GI Event and GR Event by document type
For eg: EL (Inbound) LR (Outbound _ returns) both as GR specified in Expected event pgm
LF (Outbound) & LB has GI Events working fine.
ECC -Custom Pgm/FM for Expected event – Just added GR Event by copying below GI.
DATA:
* Definition of all application objects
ls_app_objects TYPE trxas_appobj_ctab_wa,
* Work Structure for Expected Event
ls_expeventdata TYPE /saptrx/exp_events,
* Milestone
lv_milestone TYPE /saptrx/appl_event_tag,
* Milestone Couneter
lv_milestonecnt TYPE /saptrx/seq_num VALUE 0,
* Event expected date/time
lv_tsmp TYPE /saptrx/event_exp_datetime,
* System Timezone
lv_timezone TYPE timezone.
FIELD-SYMBOLS:
* Delivery Header
<ls_xlikp> TYPE likpvb.
* <1> Read necessary application tables
* <2> Fill general data for all control data records
CLEAR ls_expeventdata.
* Logical System ID of an application system
ls_expeventdata-appsys = i_appsys.
* Application Object type
ls_expeventdata-appobjtype = i_app_obj_types-aotype.
* Login Language
ls_expeventdata-language = sy-langu.
* <3> Loop at application objects
LOOP AT i_app_objects INTO ls_app_objects.
CLEAR: lv_milestonecnt.
* Application Object ID
ls_expeventdata-appobjid = ls_app_objects-appobjid.
* Check if Main table is Delivery Header or not.
IF ls_app_objects-maintabdef >< 'DELIVERY_HEADER_NEW'.
PERFORM create_logtable_aot
TABLES e_logtable
USING ls_app_objects-maintabdef
space
i_app_obj_types-expeventfunc
ls_app_objects-appobjtype
i_appsys.
EXIT.
ENDIF.
* Read Main Table
ASSIGN ls_app_objects-maintabref->* TO <ls_xlikp>.
* Get System TimeZone
CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
IMPORTING
timezone = lv_timezone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
** < Picking Complete >
* ls_expeventdata-milestone = 'PICK_COMPL'.
* lv_milestonecnt = lv_milestonecnt + 1.
* ls_expeventdata-milestonenum = lv_milestonecnt.
** Get Planned Picking Complete date
* PERFORM set_local_timestamp
* USING <ls_xlikp>-kodat
* <ls_xlikp>-kouhr
* CHANGING ls_expeventdata-evt_exp_datetime.
* ls_expeventdata-evt_exp_tzone = lv_timezone.
** Get Warehouse Number
* ls_expeventdata-loctype = 'WH_NO'.
* ls_expeventdata-locid1 = <ls_xlikp>-lgnum.
* APPEND ls_expeventdata TO e_expeventdata.
IF <ls_xlikp>-lfart = 'LF' OR
<ls_xlikp>-lfart = 'LB' .
* < Goods Issued >
ls_expeventdata-milestone = 'GI'.
lv_milestonecnt = lv_milestonecnt + 1.
ls_expeventdata-milestonenum = lv_milestonecnt.
ls_expeventdata-evt_exp_tzone = <ls_xlikp>-tzonis.
* Get Planned GI date
PERFORM set_local_timestamp
USING <ls_xlikp>-wadat
<ls_xlikp>-wauhr
CHANGING ls_expeventdata-evt_exp_datetime.
ls_expeventdata-evt_exp_tzone = lv_timezone.
* Get Warehouse Number
ls_expeventdata-loctype = 'WH_NO'.
ls_expeventdata-locid1 = <ls_xlikp>-lgnum.
APPEND ls_expeventdata TO e_expeventdata.
ELSEIF <ls_xlikp>-lfart = 'LR' OR
<ls_xlikp>-lfart = 'EL' OR
<ls_xlikp>-lfart = 'ZEL'.
* < Goods Issued >
ls_expeventdata-milestone = 'GR'.
lv_milestonecnt = lv_milestonecnt + 1.
ls_expeventdata-milestonenum = lv_milestonecnt.
ls_expeventdata-evt_exp_tzone = <ls_xlikp>-tzonis.
* Get Planned GI date
PERFORM set_local_timestamp
USING <ls_xlikp>-wadat
<ls_xlikp>-wauhr
CHANGING ls_expeventdata-evt_exp_datetime.
ls_expeventdata-evt_exp_tzone = lv_timezone.
* Get Warehouse Number
ls_expeventdata-loctype = 'WH_NO'.
ls_expeventdata-locid1 = <ls_xlikp>-lgnum.
APPEND ls_expeventdata TO e_expeventdata.
ENDIF.
ENDLOOP.
ENDFUNCTION.