`
JerryWang_SAP
  • 浏览: 1029055 次
  • 性别: Icon_minigender_1
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

如何在SAP CRM WebClient UI里创建web service并使用ABAP消费

阅读更多

In this blog I will create a web service which is exposed via Genil model PROD in CRM web client UI and consume it via a simple ABAP program.

Create web service in CRM Webclient UI

(1) log on CRM Web UI with business role SERVICEPRO, work center Service Operation, Create a new Web service: Choose Material as Business Object, choose Product/Individual Product as Component, Product as Root object. Mark check box Read, Create and Change.

 

 

Click the new button to also create a Web service operation which is implemented via the query object of Genil model

 

 

Click new button:

 

 

(2) in step 2 of the creation wizard, simply click select all to ensure all attributes in Genil model PROD are involved in the web service.

 

 

click Confirm Selection to continue.

 

 

(3) in step 3, it is allowed to specify certain fields as read only.

 

 

(4) In final step of wizard, we can specify the security profile of created web service. The differences of the two can be found in the chapter when we talk about how to consume the web service. In this blog I choose BASIC as security profile.

 

 

Click Activate button and then click Productive button in toolbar. Now we have finished the creation and the web service PROD_WS is ready to be consumed.

 

 

Create new binding for Service Definition PROD_WS use tcode SOAMANAGER, click Web Service Configuration.

 

 

Search by object name = PROD_WS:

 

 

Select search result and click Create Service button:

 

 

Specify Service name and Binding name:

 

 

Select SSL as Transport Level Security

 

 

If you select SECURE as security profile in web service creation step, the Authentication Level will be Strong instead of Basic, and the checkbox “User ID/Password” will be disabled, which means in that case, only X.509 SSL Client Certificate or Single Sign On are allowed.

In this blog, since both the creation of web service and service consumption are done in AG3, I mark “Make Local Call” as Local System Call.

 

 

Click Finish button, click the icon “Open Binding WSDL Generation”,

 

 

write down the WSDL link:

 

 

Create the service consumer proxy in ABAP backend

(1) tcode SE80, choose tab “Enterprise Services Browser”, right click on Objects, choose “Create new Object”,

 

 

Choose Service Consumer and click continue:

 

 

Specify a prefix:

 

 

Lots of proxy objects for runtime usage will be created:

 

 

Finally the ABAP consumer proxy class ZZCO_PROD_WS has been generated, which would be used in the ABAP program to consume the web service.

 

 

Now the consumer proxy class is ready for use. We can find all its available methods and signature in class builder.

 

 

In part 2 of this blog, we will discuss how to use this proxy class to consume web service in ABAP program.

In previous blog we have finished the creation for web service PROD_WS, and ABAP consumer proxy class ZZCO_PROD_WS. Before it can be used in ABAP program to consume the web service we created, a logical port is needed.

Create a new Logical Port in SOAMANAGER

(1) Go back to SOAMANAGER and search PROD_WS again, this time the ABAP consumer proxy ZZCO_PROD_WS is also visible in search result list.

 

 

(2) Click consumer proxy class and click button Create->WSDL Based Configuration:

 

 

(3) Specify Logical Port name:

 

 

Specify the WSDL link of new binding for service definition created in previous step. Specify a valid user and password for WSDL access.

 

 

Click finish button to finish logical port creation. Click Ping button and ensure it works successfully.

 

 

Consume the web service in ABAP program Use the following source code to consume the query and read service operation. Pass the logical port name LP__TEST1 in constructor of consumer class. The data type and method signature could be easily found in class builder for consumer proxy class ZZCO_PROD_WS.

```ABAP DATA: lo TYPE REF TO zzco_prod_ws, input TYPE zzcrmostpro001prodadvsea01, output TYPE zzcrmostpro001prodadvsea00.

CREATE OBJECT lo EXPORTING logical_port_name = 'LP_TEST1'.

input-input-searchforproducts-created_by-sign = 'I'. input-input-searchforproducts-created_by-option = 'EQ'. input-input-searchforproducts-created_by-low = 'WANGJER'.

TRY. lo->crmost__pro001prodadvsea001d( EXPORTING input = input IMPORTING output = output ). CATCH cx_root INTO DATA(lv_text). DATA(ls) = lv_text->get_text( ). WRITE:/ ls. ENDTRY.

DATA: ls_read_input TYPE zzcrmostprod_ws_read, ls_read_result TYPE zzcrmostprod_ws_read_respo.

TRY. ls_read_input-input-prod_ws-product_id = 'ARNO_TEST004'. lo->crmost__prod_ws_read( EXPORTING input = ls_read_input IMPORTING output = ls_read_result ). CATCH cx_root INTO lv_text. ls = lv_text->get_text( ). WRITE:/ ls. ENDTRY. ``` program execution result: 100 results found with CREATED_BY = WANGJER:

 

 

The result is exactly the same as when we manually run the advanced search in GENIL_BOL_BROWSER:

 

 

And the result for read operation consumption:

 

 

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

0
0
分享到:
评论

相关推荐

    CRM7.0 WebClient UI config

    WebClient UI是SAP CRM的一个核心组件,提供了一个基于Web的交互界面,使得用户能够访问和操作CRM系统功能,无论他们身处何地。 首先,我们要理解UI Guidelines的重要性。"UI Guidelines for CRM WebClient User ...

    Creating a Dropdown in SAP CRM WebUI.docx

    在SAP CRM WebUI中创建下拉列表是一个关键任务,特别是在设计用户界面以提供更高效、用户友好的交互时。本教程将引导你通过一系列步骤来实现这一目标,特别是针对SEX(性别)属性创建一个下拉框。 首先,你需要获取...

    SAP_CRM中文自学笔记

    为了帮助初学者更好地学习SAP CRM,强晟在2010年制作的自学笔记,通过详细的目录划分,对SAP CRM的各个模块进行了细致的解读,并提供了如何操作CRM系统以及如何进行定制设置的方法。 通过这样的学习资料,目标受众...

    SAP CRM WebClient UI cross component跳转的一个具体例子

    Result list是model在ICQR里面,如果点service,会navigate到service detail page,这个service detail page是做在PRD02OV上,所以这个navigation是cross component navigation: Cross component navigati

    SAPCRM基础培训教材.doc

    《SAP CRM基础培训教材详解》 ...总结来说,SAP CRM的基础培训涵盖了WebClient UI的演变及其丰富元素,以及CRM与ERP的集成策略。了解这些知识,有助于更好地理解和使用SAP CRM系统,提升企业的运营效率和服务质量。

    SAPCRM基础培训.doc

    在SAP CRM基础培训中,WebClient UI(Web客户端用户界面)是一个重要的学习焦点,它是用户与系统交互的主要界面。下面我们将深入探讨WebClient UI的相关知识点。 WebClient UI的发展历程是从GUI(图形用户界面)...

    UI Guidelines for CRM WebClient User Interface

    UI Guidelines for CRM WebClient User Interface

    SAP CRM WebClient UI ON_NEW_FOCUS的用途

    Sent: Thursday, May 9, 2013 6:30 PM Subject: ON_NEW_FOCUS的用途 ROOT ———————————— Product ID PRODshortText ———————————— Product Description Genil Model hierarchy

    asp.net写的web service例子

    这个例子是为初学者设计的,旨在演示如何创建和使用Web Service,以及如何在ASP.NET环境中调用这些服务。 Web Service是一种通过HTTP协议进行通信的服务,允许不同系统之间交换数据。它基于SOAP(Simple Object ...

    ASP.net 中用C#调用Java web service 图解教程

    ASP.NET 中使用 C# 调用 Java Web Service ...在 ASP.NET 中使用 C# 调用 Java Web Service 需要了解 Web Service 的基本概念、使用 C# 调用 Java Web Service 和在 ASP.NET 中实现 Web Service 的客户端和服务器端。

    简单星座测试 Web Service 实例代码

    在本文中,我们将深入探讨如何使用ASP.NET Web Service来创建一个简单的星座测试应用程序,并了解如何使用C#作为客户端与该Web Service进行交互。这个实例代码是Web开发领域的一个基础示例,它展示了服务端和客户端...

    sap 简介及关键提示

    产品建议不仅能在标准订单等销售事务中应用,还能在CRM WebClient UI(交互中心)和Web渠道中实时呈现,帮助销售人员在与客户的互动中快速响应并提供个性化建议。 通过灵活地配置产品联想规则,企业可以设定复杂的...

    基于c#的webapi断点续传几种方式及webclient断点续传下载.zip

    本资料包“基于C#的WebAPI断点续传几种方式及WebClient断点续传下载.zip”主要探讨了两种在C#环境下实现断点续传的方法:一是通过WebAPI实现服务端的断点续传功能,二是使用WebClient类进行客户端的断点续传下载。...

    C#利用Web Service发送手机短信

    在C#中,我们可以使用.NET框架提供的ASMX或WCF服务来创建Web Service。在本案例中,我们将利用Web Service作为中介,连接短信网关,从而实现发送手机短信的功能。 要创建一个可以发送短信的Web Service,我们首先要...

    异步调用Web Service程序 小例子,C++.net源代码编写

    在IT领域,异步编程是一种常见的优化性能的技术,特别...在这个小例子中,我们展示了如何使用`WebClient`或Web Service代理类进行异步调用,并处理返回的结果。这个简单的实践可以帮助你更好地理解和应用异步编程技术。

    ASP.NET Web Service

    在文件列表中的"WebServiceClinet"可能是示例代码或项目,用于演示如何创建和使用ASP.NET Web Service的客户端。这个客户端可能包含了调用Web服务的方法,以及处理返回数据的逻辑。开发者通常会使用Visual Studio...

    c#开发实例——XML Web Service

    在Visual Studio 2005中,XML Web Service的创建和使用相对简单,为开发者提供了高效的工作流程。本文将深入探讨如何在C#环境中利用VS2005开发XML Web Service。 首先,我们需要了解XML Web Service的基础。XML...

    WebClient下载文件展示进度条

    下面是一个完整的示例,展示了如何在WinForms应用程序中创建一个简单的进度条,并使用WebClient下载文件: ```csharp public partial class MainForm : Form { private WebClient webClient; private long ...

    使用WebClient实现文件下载

    在.NET框架中,C#提供了一种简单的方式来下载文件,这就是使用`WebClient`类。`WebClient`是System.Net命名空间的一部分,它提供了一系列方法和属性,方便开发者执行HTTP请求,包括文件的上传和下载。在这个场景中,...

    WEBCLIENT使用方法

    【标题】:“WEBCLIENT使用方法” 在C#编程中,`WebClient`是一个非常重要的类,它位于`System.Net`命名空间下,主要用于处理HTTP请求,执行下载或上传操作。`WebClient`类提供了简单易用的方法来访问Web资源,如...

Global site tag (gtag.js) - Google Analytics