on 08-21-2015 10:07 AM
Hi experts
I've created BO and script action file below.
ScriptHolder.bo
import AP.Common.GDT as apCommonGDT;
import AP.FO.BusinessPartner.Global;
businessobject ScriptHolder {
element holderID:ID;
element firstname: LANGUAGEINDEPENDENT_ENCRYPTED_EXTENDED_Name; // criteria for searching
action testAction;
action deleteRows;
node SearchResult [0,n] {
element resultId:ID;
association ToCustomer to Customer;
}
}
Action-testAction.absl
import ABSL;
import AP.FO.BusinessPartner.Global;
var v_result : elementsof this.SearchResult;
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;
//v_result.ToCustomer = cust ====>> I can not assign what I have gotten from query to ToCustomer association
this.SearchResult.Create( v_result );
}
Any suggestion ?
Best Regards,
Krit R.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.