一段在C4C里触发S4HANA outbound Delivery的ABSL代码

同时也展示了ABSL里如何调用第三方的web service:

/*
	Add your SAP Business ByDesign scripting language implementation for:
		Business Object: CustomerQuote
		Node: Root
		Action: triggerOutboundDeliveru 
		
	Note: 
	  - To access the elements of the business object node, 
	    use path expressions, for example, this.<element name>. 
	  - To use code completion, press CTRL+J. 
	   
*/

import ABSL;

if( this.OutboundDeliveryID.IsInitial() == false){
    raise already_delivered.Create("E");
	return;
}

var HttpMethod = "GET";
var HttpResource = "";                            // not required
var ContentType = "";                             // not required
var Body = "";                                    // not required
var HeaderParameter : collectionof NameAndValue;  // not required

var URLParameter    : collectionof NameAndValue;

var URLParameterEntry : NameAndValue;

URLParameterEntry.Name  = "SoID";
URLParameterEntry.Value = this.ID.content;

URLParameter.Add(URLParameterEntry);

var response = WebServiceUtilities.ExecuteRESTService("JerryExternalService", "JerryExternal", HttpMethod, HttpResource,
URLParameter, HeaderParameter,ContentType, Body);

this.OutboundDeliveryID = response.Content;
raise delivery_message.Create("S", this.OutboundDeliveryID);
发布了6267 篇原创文章 · 获赞 616 · 访问量 98万+

猜你喜欢

转载自blog.csdn.net/i042416/article/details/103933053
今日推荐