‎2006 Dec 22 10:43 AM
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...
‎2006 Dec 22 10:47 AM
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
‎2006 Dec 22 10:48 AM
‎2006 Dec 22 10:49 AM
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
‎2006 Dec 22 11:10 AM
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
‎2006 Dec 22 11:15 AM
You can use field symbols. Have a look at the help for the command
ASSIGN COMPONENT sy-index of STRUCTURE I_DATA TO <FIELD>.
‎2006 Dec 22 11:41 AM
You can compare like this.
If structure1 = structure2.
If useful reward.
Thanks,
Alex.