Skip to Content
avatar image
Former Member

Retrieve different Stages of a Freight Order via OData

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?



fo stages.PNG (4.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 30, 2015 at 07:47 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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