Skip to Content
0
Former Member
May 29, 2007 at 07:18 AM

compare the values of two fields in a table

26 Views

Hi,

I need to compare two fields(vpsta and pstat) in mara table and have to get the differences.

For example if vpsta = abcdzx and pstat = abcd then i need the output as zx.

I got the answer when i use the concept of getting offset values. but i need the solution by using string operations like CO, CS,CA.... is it possible?

when i use the below coding...

data : len type i .

if vpsta CS pstat.

len = strlen(pstat).

clear vpsta+sy-fdpos(len).

write : vpsta.

endif.

if vpsta = kvelszx and pstat = kvels

here i got the correct output as zx

but if vpsta = kvezxls and pstat = kvels

here i could not get the answer as zx..

give me a solution for this...

Thanks in advance

Navaneeth