‎2010 May 05 10:58 AM
Hi,
I have to find the fields that are differrent in two big structures.
Rather than comparing all fileds one by one, i was wondering if there is quicker way to do it?
Or maybe a Function module?
Thanks for your help.
Olivier D.
‎2010 May 05 11:14 AM
hello O ,
try something like this
type-pools: abap.
data: gt_comp1 type standard table of abap_componentdescr,
gt_comp2 type standard table of abap_componentdescr,
gs_comp type abap_componentdescr,
go_struct type ref to cl_abap_structdescr.
go_struct ?= cl_abap_typedescr=>describe_by_name( 'BKPF' ).
gt_comp1 = go_struct->get_components( ).
go_struct ?= cl_abap_typedescr=>describe_by_name( 'BSEG' ).
gt_comp2 = go_struct->get_components( ).
if gt_comp1[] ne gt_comp2[].
write: / 'Error'.
endif.
regards
Prabhu
‎2010 May 05 11:17 AM
You can create a small custom program for this. You can get all the fields in the structure using FM DDIF_FIELDINFO_GET. Now, compare the both the internal tables and delete the duplicate entries using read inside loop.