cancel
Showing results for 
Search instead for 
Did you mean: 

SRM Assign Supplier Search Criteria

MariusStoica
Active Participant
0 Kudos

Hi guys,

I'm stuck with a requirement. The client needs to change some fields in the search help window for Supplier.
The process starts from a Shopping Cart, you add an item to it, you select the line and then you choose the option "Assign" and you get the following window:

Here, if you press F4 you get the following Search Help window for Supplier :

The requirement is to add a new search criteria and to change the existing 4.

I've tried to debug the generation of this window (because it's dynamic) and I couldn't find anything in the component WD_SELECT_OPTIONS_20 or WDR_F4_ELEMENTARY. In the latter, the "SELOPT_CONTAINER" is the dynamic container for the 4 filter options.

Since it's dynamic, I was thinking of a table that contains the custonizing data or a "CASE" for the different options ...

Is there a way to achieve this ?

Kind regards,

Mairus

Accepted Solutions (1)

Accepted Solutions (1)

daniel_marlen
Active Participant

Hello Mairus,

You can use the BAdI described in Note 2271780 to change the default number of selection fields.

If you would like to change the default fields, the relevant logic, which populates the four option with the first four criteria, is in Method INIT_SELOPT_20 of WDC WDR_F4_ELEMENTARY View V_SELECTION.

Best regards,

Daniel

MariusStoica
Active Participant
0 Kudos

Hi Daniel,

I'll do the implementation (and enhancement) and get back to you.

Thank you for the swift response,

Marius

MariusStoica
Active Participant
MariusStoica
Active Participant
0 Kudos

Hi Daniel,

I have an issue with the solution. In other search helps, I get a short dump but it's due to my enhancement. I'm guessing it's because not all search helps have the same criteria that I appended:

  "Change the order of the default fields
  DATA: ls_sel_fields      LIKE LINE OF wd_this->selection_fields,
        ls_sel_fields_old  LIKE LINE OF wd_this->selection_fields,
        lt_sel_fields_last LIKE wd_this->selection_fields.

  READ TABLE wd_this->selection_fields INTO ls_sel_fields
  WITH KEY sfl-keyword = 'Business Partner'.
  APPEND ls_sel_fields TO lt_sel_fields_last.

  READ TABLE wd_this->selection_fields INTO ls_sel_fields
  WITH KEY sfl-keyword = 'Name 1/last name'.
  APPEND ls_sel_fields TO lt_sel_fields_last.

  READ TABLE wd_this->selection_fields INTO ls_sel_fields
  WITH KEY sfl-keyword = 'Name 2/First name'.
  APPEND ls_sel_fields TO lt_sel_fields_last.

  READ TABLE wd_this->selection_fields INTO ls_sel_fields
  WITH KEY sfl-keyword = 'Purch. Organization'.
  APPEND ls_sel_fields TO lt_sel_fields_last.

  READ TABLE wd_this->selection_fields INTO ls_sel_fields
  WITH KEY sfl-keyword = 'Search term 1'.
  APPEND ls_sel_fields TO lt_sel_fields_last.

  LOOP AT wd_this->selection_fields INTO ls_sel_fields_old.
    READ TABLE lt_sel_fields_last INTO ls_sel_fields
    WITH KEY sfl-keyword = ls_sel_fields_old-sfl-keyword.
    IF sy-subrc IS NOT INITIAL.
      APPEND ls_sel_fields_old TO lt_sel_fields_last.
    ENDIF.
  ENDLOOP.

  wd_this->selection_fields = lt_sel_fields_last.<br>

Is there a way to find out the source of the search help? Meaning if I do the request for Purchase Org, and not for Supplier to be able to check this.

I haven't found a class that helps me check the "Parent" window / element / object to check and see.

Do you know any ?

Kind regads,

Marius

PS: I found some helpful data:

but attribute M_SHLP is a private attribute and I can't access it. Any idea of a work arround ?

Answers (1)

Answers (1)

daniel_marlen
Active Participant
0 Kudos

Hi Marius,

The Search Help name is only available in the mentioned private attribute.

To avoid the dump in other search helps, I would suggest checking whether the field exists in table wd_this->selection_fields and if not, skip the enhancement. In this way, the enhancement won't be called for such search help, where it is not relevant and system can use the standard logic for those ones.

Or if you would like to set different default fields for different search helps, the only option I can see is to create different cases in the enhancement by checking which criteria is available and which isn't. You need to create as many cases of IF branches as many times different dumps occur.

Best regards,

Daniel

MariusStoica
Active Participant
0 Kudos

Hi daniel.marlen,

That worked perfectly. But as far as you know, is there a way to access the "parents" of an object/view/page?

Kind regards,

Marius

daniel_marlen
Active Participant
0 Kudos

Hi Marius,

Could you please share a bit more details about the query? What would you like to achieve?

Best regards.

Daniel