我的第一个SAP PROXY ABAP Program(SAP PO 开发五)

登陆PO服务器,启动JAVA客户端三步(SAP PO 开发一)

搭建一个WebService接口环境(SAP PO 开发 二)

用SAP PO连通一个WebService接口(SAP PO 开发 三)

ERP系统RFC协议发送端通过PO连通WebService接口(SAP PO 开发四)

我的第一个SAP PROXY ABAP Program(SAP PO 开发五)

SAP PO (Process Orchestration) 中间件接口管理平台(SAP PO 开发六)

接口开发技术概念与名词术语解释(SAP PO 开发七)

C# 调用SAP PO中间件的WebService接口(SAP PO 开发八)

 

 

SAP PO 开发系列接近尾声,当然最后还需要一个压轴大戏DEMO006:PROXY2SOAP。

这次我们要使用久违的PROXY,通过使用PROXY我们才知道SAP 接口开发中RFC和PROXY的本质区别,

而网上那篇SAP IDOC、RFC、PROXY协议比较的表格终归讲得太浅。

 

一、DEMO006的场景:

SAP HCM系统中通过PROXY方式传出一个数据给PO,PO把这个数据传给一个WebService。

WebService收到数据后,把数据放到一段文本中返回PO,PO再返回到SAP HCM系统中。

二、DEMO006在PO上SLD的配置内容:

三、打开PO的Enterprise Services Builder配置:

1、同SAP HCM相关的接口内容DT、MT、SI:

发出变量定义int

收到返回的字符串

向上封装成MT

带出SI

2、同WebSerivce相关的接口内容DT、MT、SI:

因为WS是有接口描述文件xsdl的,我们就偷懒不用创建DT、MT了。

直接用xsdl创建ED,ED再创建SI就好。

创建MM的请求和返回

 

创建OM

四、打开PO的Integration Builder配置:

建一个demo006集成环境,空的就行。

建一个CC通道,注意看协议是基于HTTP的XI3.0,

说明SAP ABAP端是把数据封装到基于HTTP的XI协议发给PO的:

建一个CC通道,在WebService这边,注意看协议是标准的WS的SOAP协议:

最后建IC的1~4页签:

PO端配置完成。

 

 

五、在SAP服务器的ABAP环境中作一个proxy程序

SPROXY事务代码中,可以看到已经有了DEMO006

在Service_Consumers中,点SI_demo006_sender,创建一个proxy:

这个proxy的参数,我们看到有MT:

点一个MT进去,里面还有一个DT类型,这些都是SAP根据PO创建的数据结构自己创建的

DT里面有我们的一个变量:

 

写一个ABAP程序,调用这个proxy接口:

DATA  LO_PROXY TYPE REF TO ZPOCO_SI_DEMO006_SENDER.
DATA  Z1 TYPE ZPOMT_DEMO006_RESPONE.
DATA  Z2 TYPE ZPOMT_DEMO006_REQUEST.

Z2-MT_DEMO006_REQUEST-ZVALUE  = 3.

CREATE OBJECT LO_PROXY.

  TRY.
    CATCH CX_AI_SYSTEM_FAULT.
  ENDTRY.


  TRY.
      LO_PROXY->SI_DEMO006_SENDER(
        EXPORTING
        OUTPUT = Z2
        IMPORTING
        INPUT  = Z1
        ).
    CATCH CX_ROOT INTO DATA(LCX_ERROR).
      DATA(ERR_TEXT) = LCX_ERROR->GET_TEXT( ). "得到错误信息
  ENDTRY.


WRITE:/ ERR_TEXT.
WRITE:/ Z1-MT_DEMO006_RESPONE-ZRETURN.

运行程序,得到WS的返回文本:

 

SAP RFC协议工作在SOCKET底层,它的使用环境是ABAP,C#的NCO、JAVA的JCO类库。

SAP PROXY的XI协议,工作在上面的HTTP层,它的环境是借助PI、PO系统提供上层的基于SOAP的服务。

我想这是RFC和PROXY的本质区别。

既然DEMO007是RFC的,DEMO006是PROXY的,他们都是发给同一个WS接口,那我们就来作一个性能测试:

 

对同一个WS接口,发收数据100次,我们看看他们的时间差别:

我想,PROXY的耗时主要用在对HTTP协议转换上了。

--------------2019-6-3-------------------------------------------------

我一直在思考一个问题,如果RFC工作在底层,它的效率最高,那为什么SAP还会推出PROXY,

而且从SAP项目选择来看,SAP-RFC的接口技术正在被PROXY所取代。

随做对PROXY认识的加深,我终于明白了。

单纯的比较性能,肯定是RFC工作在底层,RFC最厉害。

但要实现RFC有很多前提:

1、需要外围系统使用RFC的类库编程,这个虽然很简单,但是并不被大量的开发工程师所掌握。

2、除了外围系统,SAP系统使用RFC,需要在系统内定义自己表的结构,这个工作虽然也简单,但是它还是需要人天。

3、使用RFC,是2份工作要协同:SAP系统内ABAP工作,外围系统NCO、JCO工作大家要一起调试。

而PROXY呢:

1、PO顾问会按外围系统的WebService接口描述wsdl,导入PO中,创建接口DateType数据定义,然后啪啪配置一番联通。

2、SAP系统中是带入PO的数据定义,不用自己创建,然后ABAP代码直接调用。

3、基本不需要2个系统的调试,这个主动权会掌握在PO集成开发顾问这里。

RFC和PROXY的差别也体现在工作量上,PROXY的工作量会远远小于使用RFC。

 

 

 

 

 

 

下面是2段公平的测试程序代码:

 

*&---------------------------------------------------------------------*
*& Report ZDEMO007
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZDEMO007.

DATA GV_VALUE TYPE /BCV/FND_INT1.
DATA GV_GETDATARESULT TYPE /ASU/TEXT.


*请按系统实际情况填写如下信息
WRITE: /'****************************'.
WRITE: / 'SAP系统: RFC'.
WRITE: /'****************************'.
WRITE: /.




DATA: T1 TYPE I,
      T2 TYPE I,
      T TYPE P DECIMALS 0.

DATA: GV_C(6) TYPE C .


DATA N TYPE I VALUE 100.
DATA ALL TYPE I.
DATA TMP TYPE I.


T = 0.


 GET RUN TIME FIELD T1.

 DO N TIMES.



*****************************
* Code to be tested *
*****************************

GV_VALUE = 9.


  CALL FUNCTION 'ZDEMO007' DESTINATION 'ZDEMO007'
    EXPORTING
      VALUE               =   GV_VALUE
   IMPORTING
     GETDATARESULT       =  GV_GETDATARESULT .



ENDDO.

GET RUN TIME FIELD T2.



T = ( T2 - T1 ) / 1000000.

GV_C = T.
CONDENSE GV_C NO-GAPS.


WRITE: /'耗时:' , GV_C , '秒'.

 

===============

 

*&---------------------------------------------------------------------*
*& Report ZDEMO006
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZDEMO006.

DATA  LO_PROXY TYPE REF TO ZPOCO_SI_DEMO006_SENDER.
DATA  Z1 TYPE ZPOMT_DEMO006_RESPONE.
DATA  Z2 TYPE ZPOMT_DEMO006_REQUEST.


*请按系统实际情况填写如下信息
WRITE: /'****************************'.
WRITE: / 'SAP系统: PROXY'.
WRITE: /'****************************'.
WRITE: /.


DATA: T1 TYPE I,
      T2 TYPE I,
      T TYPE P DECIMALS 0.

DATA: GV_C(6) TYPE C .


DATA N TYPE I VALUE 100.
DATA ALL TYPE I.
DATA TMP TYPE I.


T = 0.



Z2-MT_DEMO006_REQUEST-ZVALUE  = 3.


  CREATE OBJECT LO_PROXY.
  TRY.

    CATCH CX_AI_SYSTEM_FAULT.
  ENDTRY.


GET RUN TIME FIELD T1.

DO N TIMES.

*     TRY .

      LO_PROXY->SI_DEMO006_SENDER(
        EXPORTING
        OUTPUT = Z2
        IMPORTING
        INPUT  = Z1
        ).
* CATCH CX_ROOT INTO DATA(LCX_ERROR).
*      DATA(ERR_TEXT) = LCX_ERROR->GET_TEXT( ). "得到错误信息
*     ENDTRY.

ENDDO.


GET RUN TIME FIELD T2.
T = ( T2 - T1 ) / 1000000.

GV_C = T.
CONDENSE GV_C NO-GAPS.


WRITE: /'耗时:' , GV_C , '秒'.



*WRITE:/ ERR_TEXT.
*  WRITE:/ Z1-MT_DEMO006_RESPONE-ZRETURN.

 

 

 

 

  • 13
    点赞
  • 69
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
SAP Process Orchestration The Comprehensive Guide, 2nd Edition SAP流程编制综合指南 1 Introduction to SAP Process Orchestration 1.1 Historical Overview and Evolution 1.1.1 SAP Process Integration 1.1.2 SAP Composition Environment 1.1.3 SAP Process Orchestration 1.1.4 SAP Process Orchestration 7.5 Highlights 1.2 SAP Process Orchestration Components 1.2.1 SAP Process Integration 1.2.2 Business Process Management 1.2.3 Business Rules Management 1.3 Architectural Overview and Positioning 1.3.1 SAP Process Orchestration Positioning 1.3.2 SAP NetWeaver Application Server for Java: System Architecture 1.3.3 SAP NetWeaver AS Java System Logical Layers 1.4 Installation Options 1.4.1 Case 1: SAP Process Integration Dual Stack 1.4.2 Case 2: SAP PI Dual Stack and SAP Composition Environment in Separate Installations 1.4.3 Case 3: SAP PI Single Stack and SAP Composition Environment in Separate Installations 1.4.4 Case 4: SAP POSAP PI and SAP Composition Environment in a Single Installation 1.5 Summary 2 Administration and Development Tools 2.1 SAP Process Orchestration Tools 2.1.1 Enterprise Services Repository 2.1.2 Integration Directory 2.1.3 System Landscape Directory 2.1.4 Configuration and Monitoring 2.2 SAP NetWeaver Administrator 2.2.1 Availability and Performance 2.2.2 Operations 2.2.3 Configuration 2.2.4 Troubleshooting 2.2.5 SOA 2.3 SAP NetWeaver Developer Studio 2.3.1 Use and Download 2.3.2 SAP Process Orchestration and SAP NetWeaver Developer Studio 2.4 Summary Part II Advanced Adapter Engine Extended (AEX) 3 Configuring the System Landscape Directory 3.1 System Landscape Directory Components and Features 3.1.1 Landscape 3.1.2 Software Catalog 3.1.3 Development 3.2 Registering Systems to the System Landscape Directory 3.2.1 Connecting to ABAP-Based Systems 3.2.2 Connecting to Java-Based Systems 3.2.3 Connecting to Other Systems 3.3 Administration of the System Landscape Directory 3.3.1 Server 3.3.2 Data and Content 3.4 System Landscape Directory Strategies 3.4.1 Manual Export and Import of Data 3.4.2 Automatic Bridge Forwarding 3.4.3 Full Automatic Synchronization 3.5 Tips and Tricks 3.5.1 Naming Convention 3.5.2 Keeping Your System Landscape Directory Catalogs Up to Date 3.5.3 Self-Registration of a Java-Based System with the SLD 3.5.4 Configuring Data Suppliers from One SLD to Another 3.5.5 Manual Export and Import of Data 3.5.6 Connecting the SLD to CTS+ to Facilitate the Export and Import of SLD Data 3.6 Exercise: Configuring the System Landscape Directory 3.6.1 Exercise Description 3.6.2 Exercise Solution Approach 3.6.3 Exercise Step-by-Step Solution 3.7 Summary 4 Working with the Enterprise Services Repository and Registry 4.1 Basic ES Repository Technical Concepts 4.1.1 Functional Blocks 4.1.2 First Steps in the Enterprise Services Repository 4.1.3 Service Interface 4.1.4 Integration Patterns: Stateful and Stateless Communication 4.1.5 Asynchronous versus Synchronous 4.1.6 Quality of Service 4.2 Design Objects 4.2.1 Software Component Versions 4.2.2 Folders 4.2.3 Namespaces 4.2.4 Mappings 4.2.5 Process Integration Scenario 4.2.6 Actions 4.3 Data Types and Message Types 4.3.1 Data Types 4.3.2 External Definitions 4.3.3 Message Type 4.3.4 Additional Design Objects 4.4 Exercise: Working with the ES Repository and Registry 4.4.1 Exercise Description 4.4.2 Exercise Solution Approach 4.4.3 Exercise Step-by-Step Solution 4.5 Summary 5 Working with the Integration Directory 5.1 Integration Directory Overview 5.2 Collaboration Profiles 5.2.1 Party 5.2.2 Communication Component 5.2.3 Communication Channel 5.2.4 Communication Component without a Party 5.3 Adapter Types 5.3.1 Technical Adapters to Enable Communication with SAP or Third-Party Systems 5.3.2 Application Adapters to Enable Communication with an SAP System 5.3.3 SAP Industry Adapters 5.3.4 Third-Party-Developed Adapters 5.4 Integrated Configuration 5.4.1 Inbound Processing 5.4.2 Receiver 5.4.3 Receiver Interfaces 5.4.4 Outbound Processing 5.5 The XI Message Protocol 5.6 Configuration Scenario 5.6.1 Creating a Configuration Scenario from Scratch (Manually) 5.6.2 Creating a Configuration Scenario from a Model 5.7 Value Mapping 5.7.1 If/Else Logic 5.7.2 Fixed Values 5.7.3 Value Mapping 5.8 Business-to-Business Integration 5.8.1 Business-to-Business On Premise 5.8.2 Business-to-Business Managed Services 5.8.3 Trading Partner Management 5.9 Axis Framework 5.10 Representational State Transfer Adapter 5.11 Message Alerting 5.11.1 Alert Rule Overview 5.11.2 Creating an Alert Rule 5.11.3 Editing or Deleting a Rule 5.12 Publish the Service in the Services Registry 5.13 Integration Directory Programming Interface (Directory API) 5.14 Exercise: Working with the Integration Directory 5.14.1 Exercise Description 5.14.2 Exercise Solution Approach 5.14.3 Exercise Step-by-Step Solution 5.15 Summary 6 Building an Integration Flow 6.1 SAP NetWeaver Developer Studio 6.1.1 Installing SAP NetWeaver Developer Studio 6.1.2 Setting Up SAP NetWeaver Developer Studio 6.1.3 Enterprise Integration Patterns and User-Defined Templates 6.2 Basics of Creating and Configuring an Integration Flow 6.2.1 Creating an iFlow 6.2.2 Configuring an iFlow 6.3 iFlow Example 6.3.1 Creating Products, Software Components, Business Systems, and Technical Systems in the SLD 6.3.2 Importing SLD Objects into the ES Repository in SAP NetWeaver Developer Studio 6.3.3 Create Enterprise Service Repository Objects 6.3.4 Create Directory Objects: Import Business Systems and Create iFlows 6.3.5 Testing the iFlow Scenario 6.3.6 Monitoring the Scenario 6.4 New Features of the Process Integration Designer 6.4.1 Export Objects from the Integration Designer 6.4.2 Automatically Deploy after Import 6.4.3 Version History and Deployment Status 6.5 Supporting Multiple Senders for Your iFlow 6.6 Exercise: Building an Integration Flow 6.6.1 Exercise Description 6.6.2 Exercise Solution Approach 6.6.3 Exercise Step-by-Step Solution 6.7 Summary 7 Administration and Monitoring in AEX 7.1 Administration 7.1.1 Central Administration Tool 7.1.2 SAP NetWeaver Administrator 7.1.3 SAP NetWeaver Application Server Java 7.1.4 SAP Process Integration Monitoring (pimon) 7.1.5 SAP Management Console 7.1.6 Config Tool 7.1.7 Administration Using Telnet 7.2 Monitoring 7.2.1 SAP NetWeaver Administrator 7.2.2 SAP Process Integration Local Monitoring 7.2.3 SAP PI Central Monitoring with SAP Solution Manager 7.2.4 Message Retention 7.2.5 User-Defined Message Search 7.3 Troubleshooting 7.3.1 Configuring Log and Traces 7.3.2 Using the Log Viewer 7.4 Summary 8 Migrating Interfaces from SAP PI Dual Stack to SAP PO 8.1 Migration Strategies 8.2 Migrating System Landscape Directory Content 8.2.1 Products 8.2.2 Software Components 8.2.3 Technical System 8.2.4 Business System 8.3 Migrating Enterprise Services Repository Content 8.3.1 Exporting Objects 8.3.2 Importing Objects 8.4 Migrating Integration Directory Content 8.4.1 Manually 8.4.2 Using the Migration Tool 8.5 Summary Part III Business Process Management and Composition 9 Introduction to SAP BPM and BPMN 2.0 9.1 Managing Business Processes 9.2 SAP Business Process Management 9.2.1 SAP BPM versus SAP Business Workflow 9.2.2 BPM before SAP BPM 9.2.3 SAP BPM Main Components 9.3 Business Process Model and Notation 2.0 9.3.1 Swimlanes 9.3.2 Artifacts 9.3.3 Flow Objects 9.3.4 Connections 9.4 Summary 10 Creating Your First SAP BPM Process 10.1 SAP BPM Positioning and Development Environment 10.1.1 Positioning 10.1.2 Setting Up Your Development Environment 10.2 Creating and Modeling an SAP BPM Process 10.2.1 Demonstration Scenario 10.2.2 Building an SAP BPM Process: Overview 10.2.3 SAP NetWeaver Developer Studio Perspective Concept 10.2.4 Create a Project in SAP NetWeaver Developer Studio 10.2.5 Creating a Process for Your BPMN 10.2.6 Creating a BPMN Model 10.3 Configuring the BPMN Model 10.3.1 Data Objects 10.3.2 Creating Data Structures 10.3.3 Importing XSD and WSDL 10.3.4 Process Pool Properties 10.3.5 BPMN Flow Objects 10.4 Flow Objects 10.4.1 Events 10.4.2 Tasks 10.4.3 Activities 10.4.4 Gateways 10.4.5 Artifacts 10.5 Build and Deploy Your Process 10.5.1 Steps for Building a Process 10.5.2 Steps for Deploying a Process 10.6 Advanced Mapping 10.6.1 Mappings 10.6.2 Options in Mapping Assignment 10.6.3 Automatic Mapping 10.6.4 Custom Functions 10.7 Implementing Error Handling 10.8 Combining SAP BPM and the AEX 10.8.1 Message from SAP BPM to the AEX 10.8.2 Message from the AEX to SAP BPM 10.8.3 Leverage an ES Repository Mapping in SAP BPM 10.9 Exercise: Creating an SAP Business Process Management Process 10.9.1 Exercise Description 10.9.2 Exercise Solution Approach 10.9.3 Exercise Step-by-Step Solution 10.10 Summary 11 Applying Advanced SAP BPM Concepts and Extensions 11.1 Service-Oriented Architecture Configuration 11.1.1 Configuration for an Automated Activity 11.1.2 Configuration for a Start Event or Intermediary Event 11.2 Testing and Running an SAP BPM Process 11.2.1 Process Repository Overview 11.2.2 Process Testing 11.3 Custom Enterprise Java Bean Functions 11.3.1 Create EJB and EAR Development Components 11.3.2 Create the Enterprise Java Bean 11.3.3 Build and Deploy 11.3.4 Create a New Enterprise Java Bean Function 11.4 Using the Claim Check Pattern 11.4.1 Create Interfaces 11.4.2 Create Mappings 11.4.3 Configure the Channel 11.4.4 Retrieve the Large Message from SAP BPM 11.4.5 Update the Status of the Large Message from SAP BPM 11.5 SAP BPM Application Programming Interface 11.5.1 Prerequisite to Using the SAP BPM API 11.5.2 Implementation Aspects and Examples 11.6 SAP Business Process Management OData 11.6.1 OData Services for Tasks and Task Data 11.6.2 Error Handling 11.7 Using the Push API to Access SAP BPM Lifecycle Events 11.7.1 Accessing Events through a Message Driven Bean 11.7.2 Accessing Events through a Java Message Service API 11.8 Debugging and Troubleshooting SAP BPM Processes 11.8.1 Place Breakpoints in the Process 11.8.2 Add a Debug Configuration 11.9 Tuning SAP BPM-Related Performance Parameters 11.10 Best Practices for Your SAP BPM Application 11.10.1 BPMN, Mapping, and Parallelism 11.10.2 Task Related 11.10.3 Gateways 11.10.4 Looping 11.10.5 Data Object 11.10.6 Correlation 11.10.7 Error Handling 11.10.8 Housekeeping 11.11 Exercise: Applying Advanced SAP BPM Concepts and Extensions 11.11.1 Exercise Solution Approach 11.11.2 Exercise Step-by-Step Solution 11.12 Summary 12 Combining SAP BPM and UI Technologies 12.1 Web Dynpro Java User Interface Technology 12.1.1 Generating a Web Dynpro User Interface 12.1.2 Post-Configuration Steps 12.2 Integrating SAPUI5 into an SAP BPM Process 12.2.1 SAPUI5 Technology Platform 12.2.2 Model-View-Controller Concept 12.2.3 SAPUI5 Components 12.2.4 Other SAPUI5 Concepts 12.2.5 Integration Steps 12.3 Other User Interface Technologies 12.3.1 Visual Composer 12.3.2 Adobe Offline Forms 12.3.3 Support for Custom User Interface Technologies 12.4 Summary 13 SAP Business Rules Management 13.1 How Business Rules Work 13.2 SAP Business Rules Management 13.2.1 Rules Composer 13.2.2 Rules Manager 13.2.3 Rules Engine 13.3 Modeling Business Rules with Rules Composer 13.3.1 Create the Rules Composer Development Component 13.3.2 Adding Context to the Rules 13.3.3 Creating a Ruleset 13.3.4 Flow Ruleset 13.4 Testing Business Rules 13.5 Best Practices for Modeling Business Rules 13.5.1 Separate Decision Logic from Other Types of Logic 13.5.2 Reuse and Extend before Building 13.6 Exercise: SAP Business Rules Management 13.6.1 Exercise Solution Approach 13.6.2 Exercise Step-by-Step Solution 13.7 Summary 14 Implementing Java Proxies 14.1 Java Proxy Concept and Considerations 14.2 Implementation Approaches 14.2.1 Outside-In Approach 14.2.2 Inside-Out Approach 14.3 Technical Implementation 14.3.1 Development Environment 14.3.2 Developing a Server Java Proxy 14.3.3 Developing a Client Java Proxy 14.4 Building an Orchestration 14.5 Exercise: Implementing Java Proxies 14.5.1 Exercise Solution Approach 14.5.2 Exercise Step-by-Step Solution 14.6 Summary 15 Administration and Monitoring Message Processing in SAP BPM 15.1 Monitoring 15.1.1 SAP Business Process Management System Overview 15.1.2 Process Repository 15.1.3 Process Management 15.1.4 Task Management 15.1.5 SAP BPM Inbox 15.1.6 Business Logs 15.1.7 SAP BPM Action Monitor 15.1.8 Process Troubleshooting 15.1.9 Rules Business Logs 15.1.10 SAP BPM Analytics Dashboard 15.2 Administration 15.2.1 Process Data Archiving 15.2.2 Log Viewer 15.3 Summary 16 Migrating ccBPM from SAP PI to SAP PO 16.1 Motivation for Migration 16.2 Migration Approach 16.2.1 Analyze the As-Is Integration Processes 16.2.2 Translate and Redesign 16.2.3 Export and Reuse Enterprise Services Repository Objects 16.2.4 Migrate and Adapt Configuration Scenarios 16.3 Recommendations 16.4 Summary Part IV Advanced Concepts 17 SAP Cloud Platform Integration for SAP PO 17.1 Enable Cloud Integration Content in SAP PO 17.2 Reusing Cloud Integration Content 17.2.1 Download Cloud Integration Content 17.2.2 Deploy the Cloud Integration Content 17.3 Monitoring 17.3.1 Monitoring the Integration Gateway Component 17.3.2 Monitoring Messages Related to the Deployment of Cloud Integration Content 17.4 Summary 18 Additional Components for SAP Process Orchestration 18.1 Component Model 18.1.1 Product 18.1.2 Software Components 18.1.3 Development Component 18.1.4 Dependencies among Development Components 18.1.5 Public Parts 18.2 SAP NetWeaver Development Infrastructure 18.2.1 Change Management Services 18.2.2 Design Time Repository 18.2.3 Component Build Service 18.3 SAP Composite Application Framework 18.3.1 Design Time Aspects 18.3.2 Runtime Aspects 18.4 Service Registry 18.5 Enhanced Change and Transport System 18.5.1 SAP PI-Related Transports 18.5.2 Transports for Non-SAP PI Java Objects 18.6 Exercise: Create an SWCV 18.6.1 Exercise Solution Approach 18.6.2 Exercise Step-by-Step Solution 18.7 Summary 19 Landscape Setup Considerations 19.1 Java System Configuration 19.1.1 Java Sizing and Setup Considerations 19.1.2 Java System Architecture 19.1.3 Java Central Services 19.1.4 Java Parameter Tuning 19.2 Handling Certificates 19.2.1 Certificate Key Storage 19.2.2 Encryption of Message Content on Database Level 19.3 Housekeeping 19.3.1 Archiving 19.3.2 Deletion 19.3.3 Restarting 19.3.4 Recovery 19.4 Monitoring 19.4.1 Runtime Workbench 19.4.2 Wily Enterprise Manager 19.4.3 SAP Management Console 19.4.4 SAP Solution Manager Monitoring 19.4.5 Tracing 19.4.6 JVMMON 19.5 Summary A Orchestration Outlook A.1 SAP API Management A.2 SAP Cloud Platform Integration A.2.1 Features and Facts Overview of SAP Cloud Platform Integration A.2.2 Development Guide: Getting Started A.2.3 Monitoring A.3 The Integration Advisor A.3.1 Interface Specifications: Advice from the Advisor A.3.2 Mapping Guideline A.3.3 Runtime A.3.4 Testing A.4 SAP Cloud Platform Workflow as a Service A.4.1 Workflow Service A.4.2 Workflow Modeling A.4.3 SAP Cloud Platform Business Rules A.4.4 Workflow Tasks Management A.4.5 Integration 官方出品,英文原版,可编辑带导航非影印版(总计1866页)
好的,下面是经过优化后的代码: ```sql CREATE TABLE `xt_framework` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户', `user_name` varchar(20) NOT NULL DEFAULT '' COMMENT '主管名称', `name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称', `left` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '左', `right` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '右', `p_names` varchar(128) NOT NULL DEFAULT '' COMMENT '全部父级部门名称', `level` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '等级', `is_proxy` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否是上级代理', `del_at` int(10) unsigned NOT NULL DEFAULT '0', `is_del` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `name` (`name`), KEY `left_right` (`left`,`right`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司组织架构'; ``` 这里对表结构进行了如下优化: 1. 将varchar类型的字段长度根据实际需要进行调整,减少存储空间的浪费,例如将`user_name`字段长度从30调整为20,将`p_names`字段长度从256调整为128。 2. 将索引的使用进行优化,例如将原来的联合索引`INDEX `left` (`left`,`right`)`调整为单列索引`INDEX `left_right` (`left`,`right`)`,同时添加了对`left`和`right`字段的索引,以提高查询效率。 3. 对于经常进行查询的字段,例如`user_id`和`name`,添加了单列索引,以提高查询效率。 4. 字段类型进行了调整,例如将`level`字段从`smallint`调整为`tinyint`,将`is_proxy`和`is_del`字段从`tinyint(1)`调整为`tinyint(1) unsigned`,以减少存储空间的浪费。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘欣的博客

你将成为第一个打赏博主的人!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值