Application Development and Automation 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: 
Read only

FM COMPARE_STRUCTURE_DATA

Former Member
0 Likes
1,223

Hi all,

Can any one explain me how to use FM COMPARE_STRUCTURE_DATA and what means each parameter.

Thanks

Edited by: moussaid mohammed on Oct 29, 2008 4:06 PM

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
685

This FM first extract the field list from the I_DDIC_NAM dictionary structure.

Then it compare the two data structure I_REC_OLD and I_REC_NEW for each field of the DDIC that exists on both structure.

If I_CHECK_MODE equal 'X' it stop at the first changed field, else it compare every common fields of the two structure parameters.

Sample

DATA field1 TYPE mara,
     field2 type marc,
     is_diff.
* compare
CALL FUNCTION 'COMPARE_STRUCTURE_DATA'
     EXPORTING
          i_ddic_name  = 'MARA'
          i_rec_old    = field1
          i_rec_new    = field2
          i_check_mode = 'Y'
     IMPORTING
          e_is_diff    = is_diff.

The FM will compare each subfield of field2 (structure MARC) and field1 (structure MARA) that exists in database MARA and MARC, if any field value differs, it will return is_diff = 'X'.

Regards

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
686

This FM first extract the field list from the I_DDIC_NAM dictionary structure.

Then it compare the two data structure I_REC_OLD and I_REC_NEW for each field of the DDIC that exists on both structure.

If I_CHECK_MODE equal 'X' it stop at the first changed field, else it compare every common fields of the two structure parameters.

Sample

DATA field1 TYPE mara,
     field2 type marc,
     is_diff.
* compare
CALL FUNCTION 'COMPARE_STRUCTURE_DATA'
     EXPORTING
          i_ddic_name  = 'MARA'
          i_rec_old    = field1
          i_rec_new    = field2
          i_check_mode = 'Y'
     IMPORTING
          e_is_diff    = is_diff.

The FM will compare each subfield of field2 (structure MARC) and field1 (structure MARA) that exists in database MARA and MARC, if any field value differs, it will return is_diff = 'X'.

Regards