Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Comparison Expressions →  rel_exp - Comparison Rules 

rel_exp - Comparing Meshes

Meshes can only be compared with meshes that are fully compatible. The comparison is performed component by component, as for the corresponding structure. The rules for internal tables also apply when comparing components.

Other versions: 7.31 | 7.40 | 7.54


Example

After mesh1 has been assigned to mesh2, both meshes are the same. After the number of rows of component node2 has been increased in mesh2, this mesh is larger than mesh1.

TYPES: 
  BEGIN OF line1, 
    col1 TYPE i, 
  END OF line1, 
  t_itab1 TYPE SORTED TABLE OF line1 
               WITH UNIQUE KEY col1, 
  BEGIN OF line2, 
    col1 TYPE i, 
    col2 TYPE i, 
  END OF line2, 
  t_itab2 TYPE SORTED TABLE OF line2 
               WITH UNIQUE KEY col1 col2, 
  BEGIN OF MESH t_mesh, 
    node1 TYPE t_itab1 
          ASSOCIATION _node2 TO node2 ON col1 = col1, 
    node2 TYPE t_itab2, 
  END OF MESH t_mesh. 

DATA: 
  mesh1 TYPE t_mesh, 
  mesh2 TYPE t_mesh. 

mesh1-node1 = VALUE t_itab1( 
  ( col1 = 1 ) ). 
mesh1-node2 = VALUE t_itab2( 
  ( col1 = 1 col2 = 11 ) 
  ( col1 = 1 col2 = 12 ) ). 

mesh2 = mesh1. 
ASSERT mesh2 = mesh1. 

mesh2-node2 = VALUE t_itab2( 
  BASE mesh2-node2 
  ( col1 = 1  col2 = 13 ) ). 
ASSERT mesh2 > mesh1.