please see this,
I have to select Fname and value_old from CDPOS on given conditions plus from tables ADRC and ADR2. but sometime only ADRC table might be changed and ADR2 table may not be changed and sometime vice versa and some times both tables have changed .
anyway I have to select changes happened in both tables, if change is only in one table (either ADRC or ADR2), I have to pick from that table only, if both I have to pick from both tables. Please review this code.
SELECT FNAME VALUE_OLD
INTO CORRESPONDING FIELDS OF I_CDPOS
WHERE CDPOS~OBJECTID = I_CDPOS-OBJECTID AND
CDPOS~OBJECTCLAS = I_CDPOS-OBJECTCLAS AND
CDPOS~CHANGENR = I_CDPOS-CHANGENR AND
( CDPOSTABNAME = 'ADRC' and CDPOSTABNAME = 'ADR2' ).
Thanks & Regards