cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering the Accounts Search Result

Former Member
0 Kudos

Hello,

In the standard Accounts search, all business partners(accounts, contacts, org units, etc) that have the general business partner role are displayed in the result. We would like to display just the accounts. What would be the easiest way of doing this?

Thanks,

B

Points will be awarded of course.

Accepted Solutions (1)

Accepted Solutions (1)

xavier_dehairs2
Active Participant
0 Kudos

Very easy, first you need to remove the shuffler which allow to select the kind of Accounts you want to search for (since you don"t want to allow the user to have the choice). This is done by going into the view and comment out the lines that call the shuffler component.

Then, in the EH_ONSEARCH method, you can replace the code which reads value from the shuffler by your own code where you always set the value for BP type to what you need.

Hope you understand and i can tell you that it works since i did the same already

Cu,

Xavier

Former Member
0 Kudos

Thanks Xavier. Where exactly would I go to perform those steps that you mentioned above? Thanks.

Former Member
0 Kudos

Hi Xavier,

Can you please explain how a shuffler-which filters Corporate, Individual or Group accounts is going to affect this requirement?

And what parameters should be set in the query so that it only filters Business Partners?

I tried setting role=Sold to Party, but it displays contact persons with role sold to party.

Thanks and Regards,

Rohit

xavier_dehairs2
Active Participant
0 Kudos

COMPONENT BP_HEAD_SEARCH, view MainSearch.

Then to remove the shuffler from th UI, comment out the following lines in the view itself (MainSearch.htm):

<bsp:call comp_id = "<%= controller->GET_VIEWAREA_CONTENT_ID( 'SearchShuffler' ) %>"

url = "<%= controller->GET_VIEWAREA_CONTENT_URL( 'SearchShuffler' ) %>" />

For the Account only selection, enhance the IMPL class and in method EH_ONSEARCH, replace the following line:

lv_category = lr_shuffler->get_property_as_string( iv_attr_name = 'CATEGORY' )."#EC NOTEXT

by

lv_category = '2'.

I think 2 is for Corporate accounts, if not, just try with 1 ... but I think 2 should be ok.

Regards,

Xavier

xavier_dehairs2
Active Participant
0 Kudos

Hi, see my answer. But shufller is used to allow the selection of ALL or only specified BPs. In that case, he does not want to get anything else than Accounts, meaning Corporate accounts, so first he does not need the DDLB called shuffler anymore, and then by setting the CATEGORY to the value of CORPORATE accounts, it works as he wants it to work.

Regards,

Xavier

Former Member
0 Kudos

Hi Xavier,

Thanks for the response.

Actually I am confused as I am also getting Org units when I do a BP Search for Corporate Account.

Is this expected or something wrong with my Org Unit modelling?

Thanks and Regards,

Rohit

xavier_dehairs2
Active Participant
0 Kudos

I don't know sorry ... I'll test this when I have the opportunity to see if i have the same behaviour. Otherwise check OSS to see if this might be a bug or not.

Xavier

xavier_dehairs2
Active Participant
0 Kudos

Bernard, could you tell us if this ok for you this solution and if yes, then mark the question as answered.

Thanks,

Xavier

Former Member
0 Kudos

Hi Xavier,

Just for your info-Whenever we create an Organization Unit, a business partner is also created in the background( Corporate Business Partner) with role=Organizational Unit.

So if we search for Corporate Business Partners, it will also display the Organizational Units.

So just hiding the shuffler and passing category = '2' is not going to work over here.

This is a tricky one..:-)).

Thanks and Regards,

Rohit

Former Member
0 Kudos

Xavier,

Rohit is correct. The org units will still be displayed in the search result. Ultimately, I'd like our users to be able to search Corp Accounts and only bring back true accounts and not the org units. Perhaps there is a way to change how org units are created in the backend?

Bernard

xavier_dehairs2
Active Participant
0 Kudos

Hi, it is true that Org units are retrieved, if of course you customized your organizational structure to use BP (which is recommended for lot of things, i know). So to get rid of this, you'll have to additionaly implement the BADI for BP search to filter out the BPs that have the role "Organizational Unit". And then this should work as desired.

Regards,

Xavier

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

thanks for your hints on this issue.

I first changed the get_p_category method to limit the drop down box entries to "Corporate Account", but afterwards the first search after logon showed no result entries.

If I implement your solution, it works fine, but the number of results is not shown anymore, after I redefine the EH_ONSEARCH method.

Do you have a hint concerning this issue?

Thank you very much.

Kind regards

Michael

Former Member
0 Kudos

Please maintain the texts in the EH_ONSEARCH method,

text-001 = 'Account'

text-002 = 'Accounts'.

lv_object = text-001.

lv_object_plr = text-002.

This will solves the issue.

Thanks,

Rajiv.

Former Member
0 Kudos

Thank you very much!

Your hint solved my issue completely.

Kind regards

Michael