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

SAP WebClient UI创建Value help最详细的步骤

阅读更多

This document could be used for beginners for Webclient UI development who wants to know how to implement value help.

Example:

When clicking F4 on BusinessPartner ID,

 

 

a new window pops up as value help, you can click search button to get a list of business partners and choose one of them:

 

 

Once you mark the first search result, both ID and name would be automatically written back to your host page.

 

 

Step1: Implement GET_P method for field “BusinessPartner ID”:

 

 

CASE iv_property.
     WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
       rv_value = cl_bsp_dlc_view_descriptor=>field_type_input.
  ENDCASE.

Implement GET_V method:

create object rv_valuehelp_descriptor type cl_bsp_wd_valuehelp_navdescr
       exporting
          iv_outbound_plug = 'OP_PARTNER_SEARCH'.

Step2: Create a new outbound plug OP_PARTNER_SEARCH: ( the name must equal to the value passed to exporting parameter in GET_V method )

 

 

define a private attribute mv_popup with TYPE REF TO if_bsp_wd_popup in your view controller. Implement the following code:

DATA: lv_node  TYPE REF TO cl_bsp_wd_context_node.
DATA: lv_title TYPE string.

lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_PROD_CUST/SEARCH_CUSTOMER' ).
mv_popup = comp_controller->window_manager->create_popup(
  iv_interface_view_name = 'SearchHelpWindow'
  iv_usage_name          = 'BPSearch'
  iv_title               = lv_title ).
mv_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
mv_popup->set_on_close_event( iv_view = me iv_event_name = 'CLOSEPOPUP' ).
mv_popup->open( 'CLEAR_ALL' ).

Step3: in step2 we try to open the popup window defined in component usage BPSearch, so we have to define that usage in runtime repository:

 

 

in code it is defined when value help window is closed, event CLOSEPOPUP will be triggered. So we create this event handler and implement it: In the event handler, we get the selected BP information from context node PARTNER of component BP_HEAD_SEARCH and set the content into our own field “BusinessPartner ID” and “Employee Name”:

method EH_ONCLOSEPOPUP.

DATA: lv_target_node TYPE REF TO cl_bsp_wd_context_node.
DATA: lr_node      TYPE REF TO cl_bsp_wd_context_node,
             lr_entity    TYPE REF TO if_bol_bo_property_access,
             lr_entity_bp TYPE REF TO if_bol_bo_property_access,
             lv_fullname TYPE BU_DESCRIP,
             lv_bp_id    TYPE bu_partner.

  lr_entity ?= me->typed_context->bpinfo->collection_wrapper->get_current( ).
  ASSERT lr_entity IS NOT INITIAL.
  lr_node = mv_popup->get_context_node( 'PARTNER' ).
  CHECK lr_node IS BOUND.

  lr_entity_bp = lr_node->collection_wrapper->get_current( ).
  CHECK lr_entity IS BOUND AND lr_entity_bp IS BOUND.
  lv_bp_id = lr_entity_bp->get_property_as_string( 'BP_NUMBER' ).
  CHECK lv_bp_id IS NOT INITIAL.

  lr_entity->set_property( iv_attr_name = 'BP_ID' iv_value     = lv_bp_id ).
  CALL FUNCTION 'CRM_BUPA_DESCRIPTION_READ'
      EXPORTING
         iv_partner          = lv_bp_id
      IMPORTING
         ev_description_name = lv_fullname
      EXCEPTIONS
         no_partner_specified  = 1
         no_valid_record_found = 2
         OTHERS                = 3.
   lr_entity->set_property( iv_attr_name = 'BP_NAME' iv_value     = lv_fullname ).

Note: when you create the outbound plug OP_PARTNER_SEARCH in step2, the method is created with Protected by default. You should change the visibility manually to Public:

 

 

or else you will meet with CX_BSP_WD_INCORRECT_IMPLEMENT exception, since in the runtime the framework would expect to call it as public method as below:

 

 

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

0
1
分享到:
评论

相关推荐

    CRM7.0 WebClient UI config

    在SAP CRM 7.0版本中,WebClient UI配置是一项关键任务,它涉及到了用户界面的定制和优化,以提升用户体验和业务效率。WebClient UI是SAP CRM的一个核心组件,提供了一个基于Web的交互界面,使得用户能够访问和操作...

    Creating a Dropdown in SAP CRM WebUI.docx

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

    WebClient下载文件展示进度条

    本篇将详细介绍如何使用WebClient下载文件并同时显示进度条。 首先,我们需要了解WebClient类的基本用法。WebClient类提供了DownloadData、DownloadFile等方法来下载数据或文件。例如,下载文件到指定路径可以使用...

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

    Sent: Thursday, April 18, 2013 3:59 PM Subject: 为什么design time时候看到的是ICQR,点了service之后看到02QR的代码被call到 这是cross component navigation在起作用。 Result list是model在ICQR里面,如果点...

    SAPCRM基础培训教材.doc

    WebClient UI的特点在于其用户界面的个性化、直观的导航和界面,以及快速的信息创建、维护和查看功能。 WebClient UI包含多种关键元素,如抬头和导航条、主页、工作中心页、搜索页、概览页、编辑页、编辑清单页、...

    SAPCRM基础培训.doc

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

    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

    C# WebClient 上传文件

    本文将详细介绍如何使用`WebClient`类上传文件,并对代码进行深入解析。 #### 二、`WebClient`类简介 `WebClient`是.NET Framework中的一个类,用于简化HTTP请求与响应处理。通过这个类可以很容易地从Web获取数据...

    WebClientDemo_webclient_

    【WebClientDemo_webclient_】项目是一个C#编程示例,展示了如何使用`WebClient`类来实现文件的下载功能。在.NET Framework中,`WebClient`是System.Net命名空间下的一个类,它提供了一种简便的方法来上传和下载数据...

    C#中WebClient实现文件下载

    在C#编程中,WebClient类提供了一种简单的方式来实现文件下载。WebClient是一个高度封装的网络通信类,主要用于HTTP协议交互,包括上传和下载数据。以下是对标题和描述中涉及知识点的详细解释: 1. **WebClient下载...

    WebClient-2.2.5.exe

    WebClient安装文件。 在Java世界中,有许多用于发送HTTP请求的库。比较三种流行的HTTP客户端:WebClient,HttpClient和OkHttp。WebClient是Spring 5中引入的非阻塞,反应式的Web客户端。它是在Project Reactor和...

    UI Guidelines for CRM WebClient User Interface

    UI Guidelines for CRM WebClient User Interface

    使用WebClient实现文件下载

    在.NET框架中,C#提供了一种简单的方式来下载文件,...以上就是使用C#的`WebClient`类实现文件下载并显示进度条的完整步骤。通过这种方式,你可以为用户提供一个直观的界面,让他们了解文件下载的状态,提升用户体验。

    WebClient用法

    ### WebClient用法详解 在C#编程语言中,`WebClient` 类是处理网络操作的一种简单方式,尤其适用于HTTP协议的交互。...以上就是关于`WebClient`在C#中的基本使用方法及相关知识点的详细介绍。希望对你有所帮助!

    WebClient 上传文件到 iis

    本文将详细讲解如何使用C#的WebClient类来实现将文件上传到IIS(Internet Information Services)服务器的过程。IIS是微软提供的一个强大的Web服务器,广泛应用于各种Web服务和应用部署。 首先,我们要了解...

    C#通过webclient下载demo

    - 我们可以在事件处理程序中更新UI,以显示这些信息,比如创建一个进度条或文本框来展示当前进度。 示例代码可能如下: ```csharp using System; using System.Net; using System.Windows.Forms; public class ...

    C#使用WebClient获取网页源文件例子

    在这个“C#使用WebClient获取网页源文件例子”中,我们将深入探讨如何利用`WebClient`来下载网页源代码,并进行UTF8编码的解码处理。 首先,`WebClient`类是`System.Net`命名空间的一部分,它提供了一个简洁的接口...

    WebClient 的Post实现

    在这个例子中,我们创建了一个WebClient实例,设置了Content-Type头为"application/json",然后编码我们的数据为字节数组,并使用UploadDataAsync异步发送POST请求。当请求完成时,UploadDataCompleted事件会被触发...

    C#webClient.DownloadFileAsync异步源码

    本教程将详细解释`WebClient.DownloadFileAsync`方法,这是一个异步下载文件的功能,适用于C#开发者,特别是初学者。我们将探讨异步编程的基本概念,`DownloadFileAsync`的工作原理,以及如何在实际项目中应用。 1....

Global site tag (gtag.js) - Google Analytics