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

Comparing 2 structures

Former Member
0 Likes
2,757

Hi All,

When I compare 2 simple structures, if they are not equal, I want to know if there is any way to know which field in the structure was different during comparison.

Thanks...

6 REPLIES 6
Read only

Former Member
0 Likes
1,331

if u r talking abt to compare the fields of structures instead of Values then first find the fields in the structures via FM -GET_COMPONENT_LIST

and then compare fields of both via programming logic..having loop at and all

reward if helpfull

amit

Read only

0 Likes
1,331

Hi all,

I want to compare the data....

thanks...

Read only

Former Member
0 Likes
1,331

I think <b>COMPARE_STRUCTURE_DATA </b>will be helpful to you

You can also check the following Function modules:-

/SAPPCE/JVA_COMPARE_STRUCTURES

CATSXT_COMPARE_STRUCTURES

FVD_API_COMPARE_STRUCTURES

RKE_COMPARE_ERKRS_STRUCTURE

SVRS_COMPARE_STRUCTS

Read only

Former Member
0 Likes
1,331

The two structures are having only one entry ..

and these are populated only at the time of runtime .

so u can compare these entries

all the fields are same except adrnr field

like VBDKL-ADRNR = 9000120211

AND VBADR-ADRNR = 9000120200 SUPPOSE

IF VBDKL-ADRNR = VBADR-ADRNR.

ELSE.

MOVE ADRNR TO F1.

APPEND THIS F1 TO AN INTERNAL TABLE.

regards,

vijay

Read only

0 Likes
1,331

You can use field symbols. Have a look at the help for the command

ASSIGN COMPONENT sy-index of STRUCTURE I_DATA TO <FIELD>.

Read only

0 Likes
1,331

You can compare like this.

If structure1 = structure2.

If useful reward.

Thanks,

Alex.