SAP Cloud for Customer Cloud Application Studio的一些使用技巧(持续更新)

172 阅读1分钟

OData boundary condition

Customer BO’s action is NOT visible for function import. The action could be performed, however after that the read on customer BO will fail.

  1. ABSL的临时变量和JavaScript一样,用var定义:
import ABSL;

foreach( var order in this ){
	order.OrderStatus = "4";
}
  1. import语句
import AP.Common.GDT;
import AP.CRM.Global;
  1. 如何在ABSL里调用web service

OData boundary condition

Customer BO’s action is NOT visible for function import. The action could be performed, however after that the read on customer BO will fail.

Default value in BO element definition

如何在BO element元素里定义默认值

[Label("Target Amount")] element TartgetAmount:Amount = { currencyCode = "USD" };

When you create a BeforeSave.absl on the extended node, a new After Finalize Determination is automatically created by PDI framework, you can find it in tcode EXF.

DataObjectPropertyBinding.js - _getValue()
– this.oModel.getProperty
---- this._oUi5Model.getPropert
----- _oDataContainer
------ _mDataObjectIndex

  • DataObjectPropertyBinding.this.fieldValue - old value
  • UI5Model mPendingBindings
  • Date field is treated as complex data type and has a dedicated branch to handle
  1. 如何定义Transient字段和Label:
node Item[0,n]{
			[Transient] [Label("行")] element zid:BusinessTransactionDocumentItemID;
		}
  1. Query的实例代码:
qryServiceRequest_ServiceRequestQueryByElements = ServiceRequest.QueryByElements;
	selParamsServiceRequest_ServiceRequest_QueryByElements = qryServiceRequest_ServiceRequestQueryByElements.CreateSelectionParams();

	// ServiceRequest: fill the query parameter values - in this example search via the external reference
	selParamsServiceRequest_ServiceRequest_QueryByElements.Add(qryServiceRequest_ServiceRequestQueryByElements.ID.content, "I", "EQ", this.zOrderNo.content);

	// ServiceRequest: execute the query
	colQryResult = qryServiceRequest_ServiceRequestQueryByElements.Execute(selParamsServiceRequest_ServiceRequest_QueryByElements);
   
	// ServiceRequest: loop all found instances
	foreach (instServiceRequest in colQryResult)
	{
  1. 拿到当前年月日
this.zInvoiceDate = Context.GetCurrentUserDate().GetYear().Concatenate("年").Concatenate(Context.GetCurrentUserDate().GetMonth()).Concatenate("月").Concatenate(Context.GetCurrentUserDate().GetDay()).Concatenate("日");
  1. 排序:
this.GetFirst().ToRoot.item.OrderByDescending( n=>n.ZitemNo );
  1. 查找
var getMaterial = materialCollection.Where(n=>n.InternalID.content == item.Zproduct.content);
  1. 创建
partner.Znavigation = "COD_SEOD_ACCOUNT_TT";
		zcoupon.partner.Create(partner);
  1. 调用web service:
var DBMResponse = ZSI_Order_C4C_Out2.SI_Order_C4C_Out(DBMRequest, "", "ZSI_Order_C4C_Out2");
	var lt_return = DBMResponse.T_RETURN.item;
  1. OData boundary condition

Customer BO’s action is NOT visible for function import. The action could be performed, however after that the read on customer BO will fail.

  1. Default value in BO element definition
    如何在BO element元素里定义默认值
[Label("Target Amount")] element TartgetAmount:Amount = { currencyCode = "USD" };

When you create a BeforeSave.absl on the extended node, a new After Finalize Determination is automatically created by PDI framework, you can find it in tcode EXF.