当前位置:网站首页>What are the ABAP keywords and syntax that cannot be used in the ABAP cloud environment?

What are the ABAP keywords and syntax that cannot be used in the ABAP cloud environment?

2022-06-11 09:59:00 InfoQ

SAP BTP ABAP  The environment is used for  ABAP  Developed  SAP  Platform as a service  (PaaS)  product , Enable developers to take advantage of their traditional native  ABAP  Professional knowledge , stay  SAP  Development and operation in the business technology platform  ABAP  Applications , Or as  SAP  Software extensions or as stand-alone applications .

Before we enter   Cloud  ABAP  Before discussing the technical details , I wonder if you have thought about a problem : Why?  SAP  To put  ABAP  Programming environment introduction  SAP Cloud Platform?

SAP  Installed customer base will deploy their existing on premises  SAP Business Suite  and  SAP NetWeaver  Products such as , Deploy migration to  SAP S/4HANA, Include  On-Premises  And cloud deployment . Customers will take advantage of this opportunity to fundamentally simplify the systems they have developed over the past few decades  landscape.  The existing business suite system will be integrated into a single  S/4HANA  In the example . Customers want to reduce the complexity of their core business processes to an intelligent digital core (Intelligent Digital Core), So as to form the pillar of intelligent enterprise .

In the traditional business suite system , The customized content is undoubtedly a highly complex module . After years of use by the enterprise , Custom code is piling up . Yes  SAP  standard  ABAP  Direct modification of code , Will shift customers to higher-level versions or enhanced package implementation , Bring great obstacles . under these circumstances , When a customer tries to implement a new enhancement package into the system , A lot of time and effort have to be invested to ensure that the custom code still works after the implementation of the enhancement package .

If the customer's  ABAP  Solution , Deployed in the cloud , So where do these customized codes go ?

By way of  ABAP  Development and execution moved to  SAP Cloud Platform, Customers and partners can put all the infrastructure 、 Life cycle management and system operation tasks are entrusted to  SAP  Of  DevOps  The team .  Customers and partners can immediately benefit from and adopt  SAP HANA  Supporting  ABAP  The latest innovation in the stack , So you can use innovation faster in the cloud , Because new innovations are delivered every quarter .

therefore , Distinguish between traditional  ABAP  grammar , In the cloud  ABAP  Still available in the programming environment , become  ABAP  One of the things developers must know .

SAP Cloud Platform ABAP Programming environment ABAP grammar , Just vast SAP The consultants are On-Premises Used in the environment ABAP A subset of . let me put it another way ,On-Premises It can work normally in the environment ABAP Code , Simply copy and paste to the cloud environment , You may not be able to compile .

null
Look at some examples :

MOVE

null
Fixing this syntax error is simple , Directly operate with assignment “=” Replace MOVE that will do . In other words, this kind of error should only occur in old historical code (Legacy Code),  Everyone should not be able to write code now MOVE A simple assignment operation is performed .

null

No,  Released for Cloud  Of  Data Elements

Every  ABAP Development Tool Created in ABAP Cloud There is one in every project Released Objects Folder , There's one in it ABAP List of objects that developers can use in the cloud environment , stay Data Elements The subfolder contains all available data elements . At the top of the list are those that describe Boolean types ABAP_BOOLEAN.

null
It is also because of historical reasons , You know it's in On-Premises Environment to define a boolean variable , There are many types of definitions available :boole_d, abap_bool, boolean wait .

null
But on the cloud , Let's honestly use the types maintained in the white list .

null

Not all SYST Structure fields can be accessed directly

Structure SYST It contains many system fields , Can let ABAP Developers can easily get a ABAP Information of various dimensions during application execution .

null
stay ABAP In the cloud environment , Using these fields requires special care , So as not to encounter something like Access to the field "SY-DATUM" is not permitted in the restricted language scope This grammatical error :

null
The right way , Should use the CL_ABAP_CONTEXT_INFO=>GET_SYSTEM_DATE The methods provided by this tool class .

null
Here are some other examples .

null
Fortunately, , Because we are ABAP Development Tool This IDE Internal programming , So you don't have to memorize these On-Premises To ABAP Cloud Syntax conversion rules on . Most of the time , rely on IDE Grammar error or Quick Fix It is not difficult to find clues to fix grammatical errors .

null
null
null
Of course, if you don't think this method of repairing one by one is slow , Or imagine such a scenario : Your ABAP On-Premises There is a development kit on the system , It contains a lot of ABAP Secondary development code , After converting this code from On-Premises Before the system is migrated to the cloud , We may expect to do a unified “Cloud Readiness” Check , List all the hidden dangers in the cloud at one time .

Conventional ATC Check (ABAP Test Cockpit,  A kind of ABAP Code checker ) At this time, it has a place to play again . According to this article SAP Community blog
How to check your custom ABAP code for SAP Cloud Platform ABAP Environment
Mentioned note To do , In a ATC The installation on the central inspection system contains new ATC Check the implementation of the option note:

null
This new ATC The check option name is SAP_CP_READINESS_REMOTE, Can help us as early as ABAP Before the code is migrated to the cloud , stay On-Premises The environment will be able to find all that prevent the current check ABAP Obstacles to cloud code .

null
null
Of course, this check can be performed in the opposite direction , That is to say SAP Cloud Platform ABAP In the environment , Trigger connected ABAP On-Premises In the environment ATC Check . Because it is a cloud environment On-Premises Environmental Science , So we need to SAP Cloud Connector Complete the internal and external network crossing :

null
from Fiori Launchpad I'm going into Custom Code Migration The application of , Create a new migration project :

null
The migration target is of course SAP Cloud Platform ABAP Environmental Science , The source of migration is ABAP On-Premises Environmental Science , So you need to maintain a pointing to the latter Destination, This Destination stay SAP On the cloud platform .

null
At this point we can be in Fiori UI Trigger on ABAP On-Premises On the system ATC Check , And monitor its progress .

null
After inspection , You can return to... According to the prompt On-Premises Environment for code adjustment .

null

summary

First of all, this article is about  SAP  Cloud platform  ABAP  The programming environment is briefly introduced , Elaborated  SAP  Cloud platform introduction  ABAP  The motivation of the programming environment and the benefits customers can get from it . Then from  ABAP  In the field of secondary development , all  ABAP  Developers are concerned about  ABAP  Grammar compatibility , Typical examples of  ABAP  Continue to work in the cloud programming environment  ABAP  keyword , And the alternatives are given .
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110951177227.html