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

structure operation

Former Member
0 Likes
453

Hi ,

I have two structure of same type

Data:

xlfal type lfal ,

ylfal type lfal .

Now my requirement is to clear the all field values which are same in both structures and retain only those values which are distinct

please let me know if u have some function module

1 ACCEPTED SOLUTION
Read only

jrg_wulf
Active Contributor
0 Likes
422

Hi,

try this:


 FIELD-SYMBOLS: <fsx>, <fsy>.

do.
  ASSIGN COMPONENT sy-index OF STRUCTURE xlfal to <fsx>.
  if sy-subrc ne 0.
    exit. 
  endif.
  ASSIGN COMPONENT sy-index OF STRUCTURE ylfal to <fsy>.
  if <fsx> eq <fsy>.
    clear: <fsx>, <fsy>.
  endif.
enddo.

Edited by: Jörg Wulf on Feb 22, 2010 4:02 PM

2 REPLIES 2
Read only

jrg_wulf
Active Contributor
0 Likes
423

Hi,

try this:


 FIELD-SYMBOLS: <fsx>, <fsy>.

do.
  ASSIGN COMPONENT sy-index OF STRUCTURE xlfal to <fsx>.
  if sy-subrc ne 0.
    exit. 
  endif.
  ASSIGN COMPONENT sy-index OF STRUCTURE ylfal to <fsy>.
  if <fsx> eq <fsy>.
    clear: <fsx>, <fsy>.
  endif.
enddo.

Edited by: Jörg Wulf on Feb 22, 2010 4:02 PM

Read only

Former Member
0 Likes
422

Hi ,

your solution has solved my problem . Thank you very much .

I have awarded you with maximum points . Thank you once again