on 12-03-2013 5:36 PM
We have an event handler that is based on non-SAP events. All of these events are currently configured as unexpected. We want to create an expected event with the planned date/time of XX days after event handler creation. Is there a way to do this? If not, is there a way to set the planned date/time for XX days after an unexpected event is reported? Since these events are non-SAP we can't configure an expected event based on the 'Application System'.
Hello Steven,
you can also create, update and delete expected events by sending an Event Message.
You have to fill structure TRACKEEMODIFY of the BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02.
And you need activity EVM_EE_UPDATE in your rule set.
How to fill the structure is described below in the docu.
To define your EE date based on EH creation you need maybe an own activity. The creation date you find in the EH Header structure which is available in the activity interface.
Best regards,
Steffen
Update EE List from Event Message EE MODIFY Table
This method updates the expected event list based on the expected event
modification data sent in an event message.
When calling BAPI /SAPTRX/BAPI_EH_ADDEVENTMSG_02, the activity checks table
TRACKEEMODIFY to see whether expected event modification data was sent with the
event message.
This table can be used to create new expected events, to delete or update
existing expected events.
This method can only be used within rule activities. Two optional parameters
can be set to provide an expected event profile to the method:
Fill the structure TRACKEEMODIFY as follows:
Delete, insert, and update the expected event list are supported. The key for
this processing is the internal event code(EVTID)(mapped from the
external event code set and ID), the location code set(LOCCOD) ,code
ID1(LOCID1) and ID2(LOCID2), and the partner code
set(PARCOD) and code ID(PARID).
Field EVTACT specifies the action that is to be performed for this
data set:
The expected events date are inserted/updated according to fields
"ETXDAT, ETXTIM and ETXZON " or "ETXTST (UTC
timestamp) and ETXZON ". For earliest expected events date,
use "ETEADT, ETEATI and ETXZON " or "ETEATS
(UTC timestamp) and ETXZON " and for latest expected events date,
use "ETLTDT, ETLTTI and ETXZON " or "ETLTTS
(UTC timestamp) and ETXZON "
The expected message events date are inserted/updated according to fields
"MSGDAT, MSGTIM and MSGZON " or "MSGTST (UTC
timestamp) and "MSGZON ". For earliest expected message events date,
use "MSEADT, MSEATI and MSGZON " or "MSEATS
(UTC timestamp) and MSGZON" and for latest expected events date,
use "MSLTDT, MSLTTI and MSGZON " or "MSLTTS
(UTC timestamp) and MSGZON "
Field MODREF references another entry in this table for
delete-inserts, that is, if a new expected event is to be inserted at the same
position in the expected event list as an expected event that was previously
deleted.
Return code:
0: Success
1: Mapping of event code failed
2: Expected event already exists.
3: Referenced expected event was not passed with event message
4: Referenced expected events does not exist
5: No expected date available
6: Expected event insertion failed
7: Expected event for update does not exist
8: Expected event update failed
9: Expected event for deletion does not exist
10: Expected event deletion failed
11: Add duration failed
12: No time zone provided
13: Date conversion failed
14: Expected event profile does not exist
MODCNT EVTACT EVTID LOC ID1 MODREF
1 | D | ARRIVAL | LOC1 | |
2 | D | DEPARTURE | LOC1 | |
3 | I | ARRIVAL | LOC2 | 1 |
4 | I | DEPARTURE | LOC2 | 2 |
5 | U | ARRIVAL | LOC3 | |
6 | U | DEPARTURE | LOC3 |
In this example, the existing expected events ARRIVAL at LOC1 and
DEPARTURE at LOC1 are replaced by the expected events ARRIVAL at
LOC2 and DEPARTURE at LOC2 at the former positions in the
expected event list. If no MODREF is specified, the position is
determined by the estimated date and time. If more expected events have to be
added than there are existing expected events to replace, MODREF can be
used multiple times. Events are added in sequence of MODCNT and then at
the position of MODREF. A blank EVTACT indicates that the
expected event is not updated, but used as a reference for other expected events
to be inserted.
If a change to the expected event list needs to be sent independently from
reporting expected events, a certain internal event code (for example,
DDLCHANGE - deadline change) can be set up and then used to send an
unexpected event with the updates to the expected event list.
All the date/time/time zone field will not be updated, if the given entry is
initial. If you also need to update e.g. Date field to initial, please create
your own rule activity based on this activity.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steffen,
Iam exploring on the above option what has been suggested..
Config
1. Creates and expected event YAUTO_TNT_DEACT
1a. created a EE Profile for YAUTO_TNT_DEACT with Expected Event date set to 1. Applciation System.
2. In the Activity FM , created a new acitivty FM to set the number of days for the expected event YAUTO_TNT_DEACT.
3. Finally in the rule set for the unexpected event YCARRIER_POD..
a. iam caling the multi task activity to call the above activity FM
b. and in the main rule set, afterYCARRIER_POD, i have added
RULE Condition Activity True Rule
185 PARAMETER_AND_EEM PARAMETER_CHANGE EVM_EE_UPDATE
190 EVM_EE_UPDATE EVM_EE_UPDATE BW_UPLOAD
200 BW_UPLOAD BW_UPLOAD
But when the POD event is posted, i dont see the YAUTO_TNT_DEACT event being created in the /SAPTRX/EH_EXPEV table hence not able to see the expected event.
LEt me know if iam missing anything.
Thanks
Radhika
Hello Radhika,
you want to create an EE by sending an Event Message?
Then you don't need the EE in the EE profile. Yo have to sent an Event Message and fill TRACKEEMODIFY structure and you need as you already have EVM_EE_UPDATE activity.
Example is Multi Task activity OBP20_ASN
To test it just create an report and send an event message:
Fill the header structure
e.g.
ls_header-evtcnt = '001'.
ls_header-evtid = 'ADD_NEW_EE'.
ls_header-trxcod = 'TEST'.
ls_header-trxid = '4711'.
ls_header-evtdat = sy-datlo.
ls_header-evttim = sy-timlo.
and the TRACKEEMODIFY
e.g. with this an Event is added
ls_eemodify-evtcnt = '001'.
ls_eemodify-modcnt = '001'.
ls_eemodify-evtid = 'EVENT_CODE_TO_BE_ADDED_TO_EH'.
ls_eemodify-evtact = 'I'.
ls_eemodify-etxdat = '20151124'.
ls_eemodify-etxtim = '123000'.
ls_eemodify-etxzon = 'CET'.
Adapt the IDs and Codesets to your needs. Event Codes to be added must be available in the Event Code customizing /SAPTRX/TSC0EC.
Afterwards Event Code 'EVENT_CODE_TO_BE_ADDED_TO_EH' should be availabe in you EH.
Best regards,
Steffen
Hi Radhika,
according to your example:
1. EVENT_CODE_TO_BE_ADDED_EH = YAUTO_TNT_DEACT
2. ADD_NEW_EE = YCARRIER_POD
You don't need to enhance the EE profile for that as you create the new EE YAUTO_TNT_DEACT by an event message.
For the unexpected event code YCARRIER_POD that triggers the creation you maybe need to enhance the EH Type and allow this event code as unexpected event code.
Best regards,
Steffen
Hi Steffen,
We followed the same steps what you mentioned in this thread, the below is the code what we wrote but still no luck. Will appreciate your help in guiding us,
l_trackingheader-evtcnt = '001'.
l_trackingheader-evtcod = 'YCARRIER'.
l_trackingheader-trxcod = 'YTRACK_NO'.
l_trackingheader-trxid = l_trkid-trackingid.
l_trackingheader-evtid = 'POD'.
l_trackingheader-evtdat = '20131212'.
l_trackingheader-evttim = '080000'.
l_trackingheader-evtzon = 'PST'.
l_trackemodify-evtcnt = '001'.
l_trackemodify-modcnt = '001'.
l_trackemodify-evtid = 'YAUTO_TNT_DEACT'.
l_trackemodify-evtact = 'I'.
l_trackemodify-etxdat = '20131230'.
l_trackemodify-etxtim = '000000'.
l_trackemodify-etxzon = 'PST'.
APPEND l_trackemodify TO lt_trackemodify.
APPEND l_trackingheader TO lt_trackingheader.
CALL FUNCTION '/SAPTRX/BAPI_EH_ADDEVENTMSG_02'
EXPORTING
simulate = ' '
synchronous = 'X'
TABLES
trackingheader = lt_trackingheader
trackeemodify = lt_trackemodify
return = lt_bapiret2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
Hi Steffen,
Just to add to Santosh's code, from configuration YCARRIER_POD is added as unexpected event code.
From rule set as i had already mentioned on trigger of YCARRIER_POD a multi task activity will call the above Activity FM.
Activity : YTNT_DEACT_EVM ( Activity FM name)
Event ID: POD
Tracking ID CS: YTRACK_NO
Event_Code : YCARRIER
We still are not able to see YTNT_AUTO_DEACT in the EH as when i try to Reproces the event message in Simualtion mode, there are no errors, but the EH_EXPEV_DYN structure with all the date/time fields are coming as 000000000000.
Please let us know if there is somethign else we need to do..
thanks
Radhika
User | Count |
---|---|
13 | |
4 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.