cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a new Search Criteria and New field in Result list in Supplier screen

former_member193350
Active Participant
0 Kudos

Hello Experts,

I have a requirement to add some extra fields in the supplier search criteria as a drop-down like External Number(BPEXT) field,Tax Number (DFKKBPTAXNUM – TAXNUM)

I have also gone through different threads and tried with those methods( like creating a post exit to Handler Class, configuring the hide field name in MDGIMG) but there was no luck.

Could anyone please let me know if anyone able to achieve this requirement

Regards

Prateek Agarwal

P.S:- Any useful inputs will be appreciated and rewarded.

Accepted Solutions (0)

Answers (7)

Answers (7)

xavier_abap
Explorer
0 Kudos

Hi Nathan,

What is the Class and the method where we can populate the custom fields in Results list?

I have added my custom field in the structure BSS_BPIL_ROOT_ATTRIBUTES,and it shows up in the UI?

Regards,

Xavier.P

loga201
Contributor
0 Kudos

Hi Prateek,

Before checking, Region search is already part of the search criteria right.

Thank you!

former_member193350
Active Participant
0 Kudos

Hi Loga Nathan& Bala,

Thanks for your inputs and help.

Fields are added now in the drop-down, bt when I used the method (Query_BP_*) to fetch the records the I am getting the below error message.

Below is the error and the code snippet:-


ENHANCEMENT 1  ZADDR_VAL.    "active version

DATA:

   lr_regio           TYPE RANGE OF adrc-region.

  DATA:

   lr_regio_line      LIKE LINE OF lr_regio.

  LOOP AT it_sel ASSIGNING <ls_sel>.

    CASE <ls_sel>-fieldname.

      WHEN 'RFE_POST'.

        MOVE-CORRESPONDING <ls_sel> TO lr_regio_line.

        APPEND lr_regio_line      TO lr_regio.

        lv_search_address = abap_true.

       WHEN OTHERS.

        ef_not_supported = abap_true.

    ENDCASE.

  ENDLOOP.
SELECT DISTINCT p~partner

      FROM ( ( but000 AS p INNER JOIN but020 AS c

                              ON p~partner = c~partner  )

             INNER JOIN adrc AS a

                ON c~addrnumber = a~addrnumber )

      UP TO iv_num_entries ROWS

      INTO  TABLE lt_partner

    where p~partner    IN lr_partner

    and   a~region     in lr_regio.

  LOOP AT lt_partner ASSIGNING <lv_partner>.

      ls_idlist-bpartner = <lv_partner>.

      APPEND ls_idlist TO et_idlist.

    ENDLOOP.

Can you please let me know if I am missing something?

Regards

Prateek

0 Kudos

Hi Prateek,

1.Enhance the method QUERY_PROP_BP_* of class CL_MDG_BS_BP_HANDLER to add the field in search criteria.

2.Enhance the method QUERY_BP_* of class CL_MDG_BS_BP_HANDLER to fetch the data based on search criteria(added fields).

Thanks

Bala

loga201
Contributor
0 Kudos

Hi Prateek,

It is simple as you just wanted to extend existing search method with one search criteria. Just create one more entry in the get query properties of the handler class and add the same in the configuration.

ls_attribute-fieldname = 'TAXNUM'.
APPEND ls_attribute TO et_search_attributes.
ls_props-attribute = ls_attribute-fieldname.
ls_props-rollname = 'BPTAXNUM'.
INSERT ls_props INTO TABLE et_search_attribute_props.

Thank you!

Regards,

Logan.D

former_member193350
Active Participant
0 Kudos

Hi Loga Nathan,

Thanks for the response.

Yes, I have created the post-exit method in the Clasd Cl_MDg_BS_BP_HANDLER with the new field, but its not showing in the UI.

If you have achieved this scenario, can you please share more details(a doc or code snippet) will be really helpful and appreciated to check If I am missing or doing some mistake.

Thanks

Regards

Prateek

loga201
Contributor
0 Kudos

Hi Prateek,

Search criteria - Enhance methods Query_* and Get_Query_properties of class CL_MDG_BS_BP_HANDLER.

Result - Extend structure BSS_BPIL_ROOT_ATTRIBUTES.

Thank you