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

How two compare two dynamic internal tables fields

Former Member
0 Likes
1,440

Hi all,

pls provide me idea how two compare two dynamic internal tables fields'

i have two internal table <gt_itab1> & <gt_itab2> , how to compare these field for both case if both structure is same or different.

regards,

Hi all,

pls provide me idea how two compare two dynamic internal tables fields'

i have two internal table <gt_itab1> & <gt_itab2> , how to compare these field for both case if both structure is same or different.

regards,

4 REPLIES 4
Read only

Former Member
0 Likes
925

hiiii

refer to following link

[Dynamic internal table fields comparision|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/comparing%2btwo%2binternal%2btables%2b-%2ba%2bgeneric%2bapproach]

regards

twinkal

Read only

Former Member
0 Likes
925

Hi,

Both internal tables gt_itab1 and gt_itab2 are have make

the same structure, then only we move one internal table to another like

gt_itab1[] = gt_itab2[].

MOVE CORRESPONDING gt_itab1 TO gt_itab2.

regars,

bhupal.

Edited by: bhupal reddy on Aug 6, 2008 2:29 PM

Read only

Sm1tje
Active Contributor
0 Likes
925

If you have no idea how the structure of your internal table is, you can do this:

assign every single field of your structures to two different field symbols and compare the contents of the field symbols one by one.

ASSIGN COMPONENT sy-index OF STRUCTURE ls_structure TO <fs>.

If you know the field you want to compare, assign this particular field of your structure to your field symbol and use that for comparison.

ASSIGN 'FIELDNAME' OF STRUCTURE ls_structure TO <fs>.

Check the exact syntax, I have no SAP system at hand right now.

Read only

Former Member
0 Likes
925

thanks all.