Skip to content

Instantly share code, notes, and snippets.

@larshp
Created May 4, 2021 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larshp/32508a273616e1d4f486a8526ac29680 to your computer and use it in GitHub Desktop.
Save larshp/32508a273616e1d4f486a8526ac29680 to your computer and use it in GitHub Desktop.
DATA(lo_stru1) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( 'VEKPVB' ) ).
DATA(lo_stru2) = CAST cl_abap_structdescr( cl_abap_typedescr=>describe_by_name( 'E1EDL37' ) ).
DATA(lt_components1) = lo_stru1->get_components( ).
DATA(lt_components2) = lo_stru2->get_components( ).
DATA(lt_list1) = lo_stru1->get_ddic_field_list( p_including_substructres = abap_true ).
DATA(lt_list2) = lo_stru2->get_ddic_field_list( p_including_substructres = abap_true ).
DATA(lv_count) = 0.
LOOP AT lt_list1 INTO DATA(ls_list1).
IF line_exists( lt_list2[ fieldname = ls_list1-fieldname ] ).
lv_count = lv_count + 1.
WRITE: / ls_list1-fieldname.
ENDIF.
ENDLOOP.
WRITE: / lv_count, 'found'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment