cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know how to implement Component: /SAPSRM/WDC_UI_BACKEND_SH

Former Member
0 Kudos

/SAPSRM/WDC_UI_BACKEND_SH allows SRM instance to call Back-End (i.e. ECC or ERP) search helps.

For example, I want to provide a search help for cost center (KOSTL). CSKS (cost center master) does not reside on SRM server.

I know how to build a custom search help to RFC over to ECC and get a list of cost centers (so don't reply with that stuff).

I want to know if anyone has implemented /SAPSRM/WDC_UI_BACKEND_SH in a custom development, and exactly what you did. I already tried the following:

- Added component usage of /SAPSRM/WDC_UI_BACKEND_SH (component controller and view)

- Added context SELECTION to my view

- added KOSTL attribute with KOSTL data element (dictionary search help) to my DATA context

- added assistance class /SAPSRM/CH_WD_UI_ASSISTANCE (not sure if that was necessary)

I know there must be some code missing to connect context elment SELECTION to my DATA attribute, but I cannot find it in looking at SAP code.

Like I said, I know how to do this from scratch code, but would like to know how to reuse the SAP component.

Thanks,

- Tim

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Figured it out.

/SAPSRM/WDC_UI_BACKEND_SH is a 'freely programmed' search help used in SRM.

1. Add this component usage to component controller, and view controller.

2. Map HV SELECTION context to your view

3. Modify the context attribute you want backend searchhelp to 'freely programmed', and select the component usage created in step 1 (note this done dynamically in SAP code, b/c attribute is defined as dictionary search help in SAP components) -- this took a bit to figure out.

4. Important1: Give your context attributes the SAME NAME (COST_CTR in my case) as those in structure /SAPSRM/S_CH_WD_MAP_ACC (how obvious was that)

5. Important2: Set your LOGSYS in /SAPSRM/CL_PDO_VALHELP_FACTORY class - love those those factories(tic)

DATA: lo_helper TYPE REF TO /SAPSRM/IF_PDO_ACCT_ASSGT_HLPR,

CALL METHOD /SAPSRM/CL_PDO_VALHELP_FACTORY=>GET_ACCT_ASSGT_HELPER

RECEIVING

RO_ACC_ASSGT_HELPER = lo_helper.

CALL METHOD lo_helper->set_searchhelp_control

EXPORTING

iv_logsys = ls_logsys-logsys.

6. Now handle event DATA_SELECTED to get data from SELECTION, and move to your Context field.

How simple was that? Yikes. I should have just built a custom dictionary search help to RFC over and call the BAPI for Cost Center List.

- Tim

Edited by: Tim Hughes on Apr 9, 2010 8:18 AM

Former Member
0 Kudos

Hi Tim,

Could you please provide further details and code for all 6 steps. Thanks.

herzelhaimharel_gilor
Participant
0 Kudos

DATA: lr_node      TYPE REF TO if_wd_context_node,         lr_element    TYPE REF TO if_wd_context_element.   DATA: ls_content    TYPE if_v_do_account_detail=>element_account_detail,         ls_selection  TYPE if_v_do_account_detail=>element_selection. *--- Copy selected line to component interface   lr_node = wd_context->get_child_node( 'SELECTION' ).   lr_node->get_static_attributes( IMPORTING static_attributes = ls_selection ).   lr_node = wd_context->get_child_node( 'COMP_CONTEXT' ).   lr_node = lr_node->get_child_node( ls_selection-node_name ).   lr_node->get_static_attributes(  EXPORTING index = ls_selection-index                                   IMPORTING static_attributes = ls_content ).   CASE ls_selection-field_name.     WHEN 'SD_DOC'.       ls_content-sd_doc = ls_selection-field_data.       ls_content-sdoc_item = ls_selection-field_data_secondary.     WHEN 'ORDER_NO'.       ls_content-order_no = ls_selection-field_data.     WHEN 'WBS_ELEM_E'.       ls_content-wbs_elem_e = ls_selection-field_data.     WHEN 'NETWORK'.       ls_content-network = ls_selection-field_data.     WHEN 'COST_CTR'.       ls_content-cost_ctr = ls_selection-field_data.       ls_content-co_area  = ls_selection-field_data_secondary.     WHEN 'ASSET_NO'.       ls_content-asset_no = ls_selection-field_data.       ls_content-sub_number = ls_selection-field_data_secondary.     WHEN 'G_L_ACCT'.       ls_content-g_l_acct = ls_selection-field_data.     WHEN 'FUNDS_CTR'.       ls_content-funds_ctr = ls_selection-field_data.     WHEN 'FUND'.       ls_content-fund = ls_selection-field_data.     WHEN 'FUNC_AREA'.       ls_content-func_area = ls_selection-field_data.     WHEN 'BUS_AREA'.       ls_content-bus_area = ls_selection-field_data.     WHEN 'ACTIVITY'.       ls_content-activity  = ls_selection-field_data.       ls_content-network  = ls_selection-field_data_secondary.     WHEN 'CMMT_ITEM'.       ls_content-cmmt_item = ls_selection-field_data.     WHEN 'GRANT_NBR'.       ls_content-grant_nbr = ls_selection-field_data.     WHEN 'FUNDS_RES'.       IF /sappssrm/cl_sw_public_sector1=>earmarked_funds_is_active( ) = abap_true.         ls_content-funds_res = ls_selection-field_data.         ls_content-res_item  = ls_selection-field_data_secondary.       ENDIF.   ENDCASE.   lr_node = wd_context->get_child_node( 'COMP_CONTEXT' ). * Get Node required   lr_node = lr_node->get_child_node( ls_selection-node_name ). * Get element Required   lr_element = lr_node->get_element(  index = ls_selection-index ). * Set the Selected Value.   lr_element->set_static_attributes( ls_content ). * Set Node Changed to trigger Update.   IF ls_selection-field_name IS NOT INITIAL AND ls_selection-node_name EQ 'ACCOUNT_DETAIL' .     lr_node->set_changed_by_client( flag = 'X' ).     lr_element->set_changed_by_client( flag = 'X' ).   ENDIF.   IF /sappssrm/cl_sw_public_sector1=>budget_period_is_active( ) = abap_true. *--- Copy selected line to component interface     lr_node = wd_context->get_child_node( 'SELECTION' ).     lr_node->get_static_attributes( IMPORTING static_attributes = ls_selection ).     lr_node = wd_context->get_child_node( 'COMP_CONTEXT' ).     lr_node = lr_node->get_child_node( ls_selection-node_name ).     lr_node->get_static_attributes(  EXPORTING index = ls_selection-index                                     IMPORTING static_attributes = ls_content ).     CASE ls_selection-field_name.       WHEN  'FUND'.         IF ls_selection-field_data_secondary IS NOT INITIAL.           ls_content-budget_period = ls_selection-field_data_secondary.         ENDIF.       WHEN 'BUDGET_PERIOD'.         ls_content-budget_period = ls_selection-field_data.         IF ls_selection-field_data_secondary IS NOT INITIAL.           ls_content-fund = ls_selection-field_data_secondary.         ENDIF.     ENDCASE.     lr_node = wd_context->get_child_node( 'COMP_CONTEXT' ). * Get Node required     lr_node = lr_node->get_child_node( ls_selection-node_name ). * Get element Required     lr_element = lr_node->get_element(  index = ls_selection-index ). * Set the Selected Value.     lr_element->set_static_attributes( ls_content ). * Set Node Changed to trigger Update.     IF ls_selection-field_name IS NOT INITIAL AND ls_selection-node_name EQ 'ACCOUNT_DETAIL' .       lr_node->set_changed_by_client( flag = 'X' ).     ENDIF.   ENDIF.