Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the order scheduling enhancement based on SAP Kyma?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What is the order scheduling enhancement based on SAP Kyma? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Although there are ten thousand reluctant to give up, 2018 is irrevocably far away from us.

Only the traces that my colleagues at SAP Chengdu Research Institute and I left on the Internet last year can prove that we were serious about spending every day in 2018:

A total of 87 technical articles collected by SAP Chengdu Research Institute in 2018

A summary of a SAP developer at the end of 2018

Today's article is also written because of the needs of work. First introduce the order scheduling enhancement technology in traditional SAP products, and then take a look at how the same enhancement requirements are accomplished by SAP Kyma.

I think the order processing process in SAP products, whether On-Premises solutions or cloud products, can be summed up in four words: order scheduling, which contains two levels of content:

1. A single order is transferred through a business process or workflow-driven state, such as from the initial Created state, after a series of operations, and finally into the Closed state.

two。 Many types of orders work together to complete a complete end-to-end business process. Typical examples are different types of order collaboration from Lead, Opportunity, Quotation to Contract,Order in sales Automation (Sales Force Automation).

How complex is the migration of order status in the SAP system? The complexity is definitely beyond the imagination of beginners.

Take SAP CRM as an example. In the SAP CRM 714 system I use, there are a total of 906 order states, which makes people admire the thoughtfulness of SAP CRM's original designers.

Even though these 900 states have been designed, SAP still takes into account the possible state expansion needs of customers, so it adopts a classic two-tier state design of User Status (user-defined state) and System Status (SAP standard state). Through the Business Transaction that the user can define casually, the User Status can be mapped to the System Status that can be perceived by the SAP standard program.

Open, In process, Released and Completed on the left are custom order status. SAP allows customers to assign a value of Low and High to each state, which cleverly provides a function of state transition in a non-graphical way.

For example, the Low of the In process state is 20, which means that the In process state cannot return to the Open state, because the ID 10 of the Open state is less than the 20mure defined in the Low field of the In process state-the ID of the target state to which a state can jump must be within the interval defined by the Low and High of the field.

In addition to the complex state processing and jump, the complexity of SAP order scheduling is mainly reflected in the following aspects:

1. Many SAP customers have other business systems in addition to buying SAP's On-Premises products or subscribing to cloud services. The order scheduling of this kind of customers often interact with these third-party business systems on the basis of SAP standard business processes.

two。 Even if it is the same industry customer base, because of geographical and national, language differences, there may be some differences in business processes. The standard features released by SAP sometimes do not support these business processes that vary widely in detail.

Therefore, the enhanced support for order scheduling in the SAP system is very necessary.

Of course, order enhancements are implemented in different ways for different SAP products.

In SAP CRM, although SAP does not explicitly propose the concept of Business Object, the model on which the order application is based is actually still made up of different nodes:

Each node corresponds to some lower-level model nodes on which various event handlers can be registered. The following figure shows the event handler function of Service Request, the header node of BO:

When each event is triggered, the registered function executes automatically.

Each node can assign one or more execution functions. Of course, rigorous Germans have added several more dimensional settings to the simplest observation-publisher mode.

The red Execution Time in the first column of the figure below indicates whether the assigned functions are executed immediately after the event is triggered or delayed until the order header or the line item's general routines have been executed (often used to implement batch operations, or functions to be executed are dependent on general routines, or for performance reasons).

The Priority of the second column, that is, the priority of function execution, is executed from the highest to the lowest if several functions maintain exactly the same attributes in other dimensions except the priority.

The third column, Event, is the events in the observer-publisher mode. Here are some standard events in the SAP CRM order framework:

The last column is the event listener function.

Jerry tends to understand the operation of the CRM order processing system as a complex water pipe transmission system similar to the one shown below. The order business process is executed in turn through listening functions registered on different events, just as water flows through this pipe of different sizes and sizes.

If the customer needs to enhance one of the business steps (need to replace a certain water pipe), he only needs to replace the SAP standard function with a function implemented by himself (he / she can find another water pipe to replace the working water pipe). The premise is that the interface of the function to be replaced is exactly the same as that of the function to be replaced (the specification of the connection between the other water pipe and the previous water pipe is exactly the same).

And the order model in SAP Cloud for Customer, its Business Object in the latest version 1811 is still implemented by the ESF2 framework, but the background is not visible to Partners, but we can compare with the BOPF framework in the SAP On-Premises world, the implementation principles of the two frameworks are similar.

In the Cloud world, enhancements to the order processing process are relatively more limited than the SAP CRM described earlier.

In Cloud Application Studio where Partner does enhancement development, all the points that can be enhanced are shown in the form of Hook:

Partners can develop business function enhancements in these Hook. Some Hook may have certain read and write restrictions, such as AfterLoading, the Hook, which will be called after the standard loading logic of SAP BO is executed. In this Hook implementation, SAP does not allow any write operations to the standard fields of BO nodes to avoid the possible impact of Partners enhancements on the SAP standard process. Some consultant friends may say, aren't these Hook the traditional Business AddIn (BAdI) in SAP Netweaver? Yes, conceptually, it can be understood this way. It needs to be reminded that after these Hook are created, they are stored in the ABAP backend not as BAdI Implementation, but as ESF2 Determination, similar to the Determination in the BOPF shown below:

Let's take a look at how similar requirements can be accomplished with SAP Kyma. Before using Kyma, you have to be clear about what Kyma is and why SAP developed Kyma. My previous article, Newton standing on the shoulders of giants: Kubernetes and SAP Kyma have already introduced the answers to these two questions, so this article will not repeat, but will go straight to examples.

We assume that we need to enhance the ordering process of SAP Hybris Commerce by adding the custom checking process we implemented in Kyma to the standard Fraud (fraud) checks.

As shown in the following figure, the light blue rectangle represents the custom Fraud checking logic we implemented in Kyma.

What check logic has been enhanced specifically? Get the customer ID from the order, and then call the services provided on SAP Marketing Cloud and SAP cloud platform in Kyma to verify the customer. After Kyma gets the verification result, it sends it back to Commerce.

Here are the concrete steps.

1. First log in to the back office page of Commerce and define a new action,ID as EXTERNAL_KYMA_FRAUD_CHECK. It is not difficult for friends who have done ABAP development to understand this action, which can be compared to action profile in ABAP, which is used to store and maintain Partner enhancements.

two。 Go to the console page of Kyma:

Select a stage to enter and click Lambdas to go to the editing page:

Image.gif

Create a new Lambda function and name it fraudcheck2. All our enhancement logic is written in this function.

The Labels created automatically by this function must be very friendly to the veteran drivers of Kubernetes. These tags are actually the same as those used in cloud notes and image management software in real work, that is, a key-value pair (Key Value Pair) that allows users to flexibly group Kubernetes objects and provide efficient retrieval.

The concept of this tag was not invented by Kyma, but is a standard function of Kubernetes.

In Function Trigger, you can specify which events these Lambda functions are executed after they are triggered, which is consistent with the registration of SAP CRM functions described earlier. Select the event after the new action is defined in the first step:

With regard to the specific implementation of the Lambda function, friends who have done nodejs development will not feel strange.

First, line 18, line 19 gets the order Code of the event from the input parameter object event, then line 26 consumes OCC (Omni Commerce Channel) Restul API to get the order details, the customer ID that gets the order from the details, then calls the code on line 30 to get the customer details according to the customer ID, and then uses the code on lines 37 and 40 to check whether the customer's email address is valid and whether the customer placed the order for the first time.

Note that I commented out the code on lines 43 and 46 for the time being and will enable it later.

Now let's test it. Place an order in Commerce and write down the order ID 2139.

Go back to the Commerce back office page, check the Business Process of the order you just placed, and enter 2139 to query:

Here, we search according to ID EXTERNAL_KYMA_FRAUD_CHECK and find the process log record based on Kyma action created in the first step just now:

Let's check the Fraud check record of this order again:

Click this Fraud Reports to view the check results. This tag is arranged from left to right in a style similar to that of Fiori and ABAP Webdynpro.

You can see the Email validity check described above and whether it is the first order check result.

Email check results: the customer's email address is valid.

The score returned by the first order check is 100, which is considered the first order according to the current Commerce profile. The location of the specific configuration file has nothing to do with the topic of this article and will not be detailed here.

Now go back to the Lambda function editor of Kyma and re-enable the previously commented function of obtaining contact address from Marketing Cloud and the function of calling Business Partner service of SAP cloud platform:

Once enabled, save and enter Service Catalog. This component is also a standard component provided by Kubernetes, based on which Kyma has been enhanced to import third-party services into Kyma's Lambda function consumption.

You can see here that many third-party services have been imported. We can actually compare this interface to the Service Market Place of the SAP cloud platform.

Select the Business Partner Service of SAP cloud platform:

The next step is similar to consuming a service on the SAP cloud platform. First, create a service instance:

Then create a binding based on this service instance

Image.gif

The binding type is set to Function Binding and the target of the binding is set to the previously edited Lambda function.

Now try to place another order, and the customer will choose the same customer as the first order:

This time, the Fraud check report for this second order has two more records than the first order:

First of all, let's take a look at the record of the second first order check. The score is 0, which is consistent with the result we expected, because this is not the first time the customer has placed an order:

Check result returned from Marketing Cloud's service:

As can be seen from the results returned by the Business Partner service of the SAP cloud platform, there is no corresponding Business Partner for the customer who placed the order.

In this example, during the Commerce ordering process, Kyma is used to access services on Marketing Cloud and SAP cloud platforms for additional Fraud checking, which may not make much business sense, but more from a technical point of view, it introduces this enhanced order scheduling method based on micro-service architecture.

This is the answer to the question about the enhancement of SAP Kyma-based order scheduling. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report