cancel
Showing results for 
Search instead for 
Did you mean: 

How can I replace a standard search help in SRM 7.0 as enhancement?

Former Member
0 Kudos

Hi experts.

In SRM 7.0, Shopping Cart, Account tab - when using search help for the Cost Center field, a search help 'KOST' is called in the backend system.

I need to replace this functionality with a call to a local search help.

Being newbie in WebDynpro, I expected to be able to make this change in the Context field, search help attribute as an enhancement, but that was not possible.

Thanks in advance!

Per

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I have been working on several search helps and one of them is similar to Per's. Thank you very much for your solution. It definitely works!

My second search help is similar to Cruiser's. It is a search help KOST at the backend ECC system, for cost center, and I have a solution.

1) Enhance the WDC: SAPSRM/WDC_UI_BACKEND_SH

2) Go to the COMPONENTCONTROLLER, method SET_BAPI_PARAMETER, create a Post-Exit method

3) Add the following codes, and activate

DATA ls_bapi_parameter TYPE if_componentcontroller=>element_bapi_parameter.

DATA lo_node TYPE REF TO if_wd_context_node.

lo_node = wd_context->get_child_node( 'BAPI_PARAMETER' ).

CASE iv_field.

WHEN 'COST_CTR'.

ls_bapi_parameter-objtype = 'BUS0012'.

ls_bapi_parameter-objname = 'BUS0012'.

ls_bapi_parameter-param = 'COSTCENTER'.

ls_bapi_parameter-method = 'GETLIST'.

ls_bapi_parameter-field = 'COSTCTR'.

ls_bapi_parameter-shlpname = 'ZHSRM_COSTCTR'. "to replace KOST

ls_bapi_parameter-shlpparam = 'KOSTL'.

ls_bapi_parameter-field_desc = 'MCTXT'.

ENDCASE.

IF ls_bapi_parameter IS NOT INITIAL.

lo_node->bind_structure( new_item = ls_bapi_parameter ).

ENDIF.

4) Of course we need to create the search help ZHSRM_COSTCTR in the backend system.

Hope this helps.

Cheers,

Eddie

Former Member
0 Kudos

Hi again.

I tried the proposed solution with no luck.

The problem is, that the standard program is dynamically accessing the attributes of the field I deleted and then I got a short-dump

The solution was however quite simple, when I first had the idea.

If SAP can access a screen field dynamically adding a search help, then I probably could do the same.

So I created a enhancement post exit in view method "WDDOMODIFYVIEW" with this code:

DATA lo_nd_account_detail TYPE REF TO if_wd_context_node.

* navigate from <CONTEXT> to <ACCOUNT_DETAIL> via lead selection
  lo_nd_account_detail = wd_context->path_get_node( path = `COMP_CONTEXT.ACCOUNT_DETAIL` ).

  DATA lr_node_info TYPE REF TO if_wd_context_node_info.

  lr_node_info = lo_nd_account_detail->get_node_info( ).

  CALL METHOD lr_node_info->set_attribute_value_help
    EXPORTING
      name            = `COST_CTR`
      value_help_mode = lr_node_info->C_VALUE_HELP_MODE-DDIC
      value_help      = 'BBP_COSTCENT_VALUE'
      .

  CALL METHOD lr_node_info->set_attribute_value_help
    EXPORTING
      name            = `G_L_ACCT`
      value_help_mode = lr_node_info->C_VALUE_HELP_MODE-DDIC
      value_help      = 'Z_GL_ACCOUNT'
      .

The above code sets the search help for two fields in the Context.

Hope this helps someone out there!

Best regards

Per

Former Member
0 Kudos

Hi Per,

I tried your approach above but it's not working. I have the same requirement (use a search help from SRM not from backend) but the component usage USAGE_SH_F4 seems taking care of the search help. How do I bypass it? Thanks in advance.

Regards,

Ichigo

Former Member
0 Kudos

Hi Ichigo.

1. In SE80, open the WebDynpro comp.

2. Then go to the view with field that needs the SH replaced.

3. Click the field, and click to see what Context field its value comes from.

4. Now go to the methods tab.

5. Here create or reuse an Enhancement.

6. Create or edit a post-exit for the method WDDOMODIFYVIEW.

7. Implement the code:

DATA lo_nd_account_detail TYPE REF TO if_wd_context_node.

* navigate from <CONTEXT> to <ACCOUNT_DETAIL> via lead selection
  lo_nd_account_detail = wd_context->path_get_node( path = `COMP_CONTEXT.ACCOUNT_DETAIL` ).

  DATA lr_node_info TYPE REF TO if_wd_context_node_info.

  lr_node_info = lo_nd_account_detail->get_node_info( ).

  CALL METHOD lr_node_info->set_attribute_value_help
    EXPORTING
      name            = `COST_CTR`
      value_help_mode = lr_node_info->C_VALUE_HELP_MODE-DDIC
      value_help      = 'BBP_COSTCENT_VALUE'
      .

8. Edit the path to point to the folder (node) that contains your context attribute.

9. Edit name to be the name of your context attribute.

10. Edit value_help to be the name of your SearchHelp.

11. Activate the enhancement.

Please also read this - the answer from Thomas Jung will explain when Search Helps can (not) be used:

[]

I hope this was of help to you!

Best Regards

Per

Former Member
0 Kudos

Hi Per,

Which is the wd component where the changes needs to be made?

I right clicked and found that it is /SAPSRM/WDC_UI_BACKEND_SH. But when I try to create an enhancement it doesnt let me

do one.

So which wd component do we need to write the post exit for?

Looking forward to hearing from you.

cruiser

former_member237703
Discoverer
0 Kudos

Hi cruiser.

First of all, I am almost possitive that you are trying to enhance the wrong WebDynpro Component, as /SAPSRM/WDC_UI_BACKEND_SH is the one where the backend pop-up results are shown.

You must right click on the screen (the field) where the input field is.

Second, could you please let me know what the error message is? - If there is a long message, be sure to read it also.

I am sure that I did som configuration somewhere to be able to change components in the /SAPSRM/* namespace - I just can not remember where, and I am hoping the error can give us a hint.

Third, what is it exactly you are trying to do?

The solution I have provided in this thread is for replacing the standard SH that performs a look-up in the backend system with a custom one that performs a look-up in the SRM system.

If you are replacing the backend look-up SH with another backend SH, then your approach must be different I am sure.

Have a nice day!

/Per

Former Member
0 Kudos

My suggestion would be to leave the standard field unchanged. But add a customer field for accounting set, say ZCOSTCTR, with type equal to a custom data element, say ZCOSTCTR_TYPE. And this new data element is defined with a custom (local) search help. Then enhance the WD screen (or through meta data configuration) to show this new cost center field and hide the original one.

And then implement BBP_DOC_CHANGE_BADI to copy the new Cost Center value to the original cost center field.

Edited by: Jay Yang on Jan 12, 2011 5:59 AM