04-13-2016 2:23 PM
Hi,
i have moved records from 1 internal table to other using corresponding statement like
it = corresponding#(field1 = field1)
along with this i need to manipulate 1 field like
above is working fine
it = corresponding#(field1 = field1 case field2
when '1'
field3 = 'good'
else
field3 = bad)
but this i cant able to achieve
pls help
04-13-2016 2:56 PM
Unfortunately, CORRESPONDING is not capable of that unt il now, it just deals with field names, nothing about content.
You can do something like:
it = value #( for wa in it_old value #( base corresponding #( wa [mapping if necessary] ) field3 = cond #( when wa-field2 = '1' then 'good' else 'bad' ) ) ).
edit: I think you could also turn it around, not sure what's better:
it = value #( for wa in it_old corresponding #( base ( value #( field3 = cond #( when wa-field2 = '1' then 'good' else 'bad' ) ) ) wa [mapping excluding special fields if necessary] ).
I just wrote this here in the editor to get the idea, maybe you have to fix the syntax.
In the end, it is nothing else than this:
-> loop at it_old into
-> move corresponding wa to new_wa
-> manipulate fields
-> add new_wa to new_table
kind regards,
Thomas