Hi,
Please write a routine for the previous value which should read the DSO (active table) with Material and Document. If more than one entry found, then sort based date. Get the latest entry and use that entry's current KF value and assign to result.
Lets say the DSO name is DATSERV. Sample code below -
data: t_temp type standard table of /BIC/ADATSERV00.
select * from /BIC/ADATSERV00 into table t_temp where material = source_package-material
and document = source_package-document.
sort t_temp by date descending.
delete adjacent duplicates from t_temp comparing date.
result = t_temp-current.
Regards
Sourav