Hi Krit ,
Try this.
import ABSL;
import AP.FO.BusinessPartner.Global;
var v_result : elementsof ScriptHolder.SearchResult; // change to BO name
var CustomerQry = Customer.QueryByIdentification;
var CustomerRes = CustomerQry.Execute( );
var cust : Customer;
var i = 0;
foreach(cust in CustomerRes){
v_result.Clear();
v_result.resultId = i;
i = i+1;
var search_result= this.SearchResult.Create( v_result );
search_result.ToCustomer=cust; // you can only assign the association after you have created the instance.
}
One advice.
Please post this kind of question in SAP Cloud Applications Studio space.
Best Regards
Fred