cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve different Stages of a Freight Order via OData

jmattfeld
Participant
0 Kudos

A freight order can have a couple of freight units assigned, ready to be picked up at different locations and to be delivered to another - resulting in different stages for the freight order:

I'd like to retrieve that stages via EM OData service with additional information like sequence (stage number) and source/destination addresses.

Is that possible with the standard implementation? My approach would be to use the /FreightOrderEventHandlerDetails path and look for the ExpectedEventSequeceNumber and EventLocation. I would then retrieve the corresponding freight units via /FreightOrderAssignedFreightUnits and the FreightUnitLoadingLocation.

Might there be a more elegant way?

Regards,

Jan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186607
Active Contributor
0 Kudos

Hi Jan,

you have to differentiate here between data that is available in SAP TM and data available in SAP EM.

All the data you want to retrieve with the EM OData service has to be available as event handler data in SAP EM. Therefore you have to extract all the necessary data first from SAP TM to SAP EM, e.g. additional parameters for stage number and the location data.

I would suggest that for your requirements you extract all the additional data for the stages as control or info parameters for the freight order event handler. All the parameters that belong to one stage should have the same index number. By this you can create new 'Event Handler Indexed Parameter' in the display profile that you are using for the EM OData service. Leading Parameter could be the stage number. You can then add configured fields for each additional stage related parameter. You will then get new entity type, e.g. ZFreightOrderStages in the EM OData service (with 'ZFreightOrder' being the OData ID in your user profile and 'Stages' the collection ID for the Event Handler INdexed Parameter).  By this you could display a table for all the stage related information in your Fiori app - one line for each stage.

Best regards, Daniel

jmattfeld
Participant
0 Kudos

Hi Daniel,

that makes sense, thanks for your reply.

I am able to customize the EM OData service

  • Creating new fields based on EM attributes
  • Defining and setting user profiles
  • Adding indexed parameters for the event handler

This document was really helpful:

However, before customizing the OData service, I need the new EM attributes. So I followed the standard customizing path

Event Management

     -> Event Handlers and Event Handler Data

          -> Parameters

Define System Parameters and Define Parameter Mapping seem to be interesting here: I would create a new info parameter and then continue to map it to an application system parameter.

To get that application system parameter I followed the customizing path

Integration with Other SAP Components

     -> Event Management Interface

          -> Define Application Interface

               -> Define SAP EM Extraction Functions

There I found the Info Parameter Extractor for ODT40_TO: /SCMTMS/EXTR_IPARAMS_TOR40.


Is this the way to go to extract additional TM information and finally add it to the EM OData service? Is there any additional documentation of this process?

Best regards,

Jan

former_member186607
Active Contributor
0 Kudos

Hi Jan,

yes, on application side you have to decide if you extract a value as info or control data (2 different extraction functions). On EM side you then have create corresponding parameters as well. If you extract as info data you have to create an info parameter, if you extract as control data you can either use control parameter (stored as name-value pair in generic table /SAPTRX/EH_CNTRL) or as system parameter in custom table (some more customizing needed).

Best regards, Daniel