SAP AMDP GRAPH ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_AMDP - Graph Processing
This example demonstrates graph processing using a graph workspace and a graph procedure.

ABAP_SOURCE_CODE
DEMO CL_DEMO_AMDP_GRAPH_PROCESSING

ABAP_DESCRIPTION
This example accesses a graph procedure that is declared and implemented in the AMDP class CL_DEMO_AMDP_GRAPH.
The method GET_SHORTEST_PATH is a graph procedure that refers to the graph workspace CL_DEMO_AMDP_GRAPH=>GRAPH_WORKSPACE operating on a graph model which is a flight data model. The graph workspace includes the declaration of the vertex table and the edge table.
METH CL_DEMO_AMDP_GRAPH=>GRAPH_WORKSPACE
The graph procedure is a read-only procedure that is written in GraphScript. Its purpose is to return the shortest flight connection between two cities (representing two vertices ). The parameter ex_weight returns the overall flight time, and the parameter ex_route returns the a table showing some details of the round trip.
METH CL_DEMO_AMDP_GRAPH=>GET_SHORTEST_PATH
The example shows that the first method call is fine. The second method call does not show any data because the target city is not contained in the graph model. The third method call shows the message that is raised. In this case, neither of the two cities is contained in the graph model