Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What are meshes really good for?

Sandra_Rossi
Active Contributor

Hello experts,

I can't find a good reason to use the ABAP meshes, because they do not really clarify the code compared to classic programming.

I have the feeling that they can be useful in the near future (like maybe code generation from CDS views), but right now I don't see. One of the big advantage I see is the code completion while typing a mesh path, it proposes the possible mesh nodes i.e. the possible relationships to other internal tables.

Do you have real use cases where meshes are really useful?

Thanks!

Sandra

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

Here's the best answer (although Kilian's is a good one). I simply forgot to check @Horst.Keller 's blog introducing the meshes (https://blogs.sap.com/2014/02/06/abap-news-for-release-740-sp05/😞

The full power of meshes will become more clear in the monent 
when associations will be supported by Open SQL for database
views (CDS views, see below) in the future.
4 REPLIES 4

kilian_kilger
Active Participant

The absolute "killer" feature of the mesh is the * operator. You can load hierarchical data into an itab and make a mesh out of it by using the hierarchy as association. With the * operator you can get the childs and grand-childs or parents very easily.

If the ORG management would use Meshes, they could get rid of one half of their coding ;-).

Just kidding, but I used meshes in a similar situation where I often needed the transitive hull of a hierarchy and it saved a few dozen lines of coding (noting that these few dozen lines of coding are pushed from ABAP into fast kernel C++).

But we need better support in Open SQL and DATA declaration for Meshes. Something like:

DATA foo TYPE MESH OF cds_view1 cds_view2 cds_view3.

would really be nice. How should the SELECT statement look like to fill this mesh?

0 Kudos

+1. You're right, I had forgotten the \asso[+|*] transitivity, I found it very impressive too!

Do you use the classic forward associations?

raghug
Active Contributor

I have a requirement coming up where the user wants to switch views on a tree structure based on material / batch or Storage Unit or Warehouse bin which are all inter-related. One option is to make 3 different programs and link them together (either as 3 different reports or essentially 3 programs in 1 report).

I am going to explore mesh-paths as a way to relate all this data and view it in different ways. I haven't had time to start exploring this yet. I will report back here once I do. By the general nature of your question, I don't think you would mind if I take a month or two on it 🙂

Sandra_Rossi
Active Contributor

Here's the best answer (although Kilian's is a good one). I simply forgot to check @Horst.Keller 's blog introducing the meshes (https://blogs.sap.com/2014/02/06/abap-news-for-release-740-sp05/😞

The full power of meshes will become more clear in the monent 
when associations will be supported by Open SQL for database
views (CDS views, see below) in the future.