天天看点

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,

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

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:

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

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

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

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

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

Implement GET_V method:

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

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

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

define a private attribute mv_popup with TYPE REF TO if_bsp_wd_popup in your view controller.

Implement the following code:

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

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:

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

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”:

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

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:

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

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:

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

继续阅读