cancel
Showing results for 
Search instead for 
Did you mean: 

BADI for Claims search in trade promotion management

Former Member
0 Kudos

Hi Experts,

I am enhancing the Claims search in trade promotion management with a custom field. I added a custom field in the search screen of claims.

I want to filter the records based on that custom field. The component is BT311S_CSR and the search query is BTQCSR.

Is there any BADI for claims so that I can filter the records.

I tried to put a breakpoint in the badi CRM_BADI_RF_Q1O_SEARCH and searched but it is not stopping.

Does this badi works for claims? Or first do i have to create a implementation with the filter object as BTQCSR then try to check whether it will stop in the badi while searching the claims.

Please suggest me.

Regards,

Dinesh.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Dinesh,

In case you are adding a new field on UI 7.0 then please use AET and make this field search and result relevant. So that this field will appear in your search criterion (you will have to add it in view configuration) and will start working along with other search attributes. You need not filter any results then.

If you have a requirement to add a field where you do not wish to use AET for some reason and you want your search to work with that field as well then filtering results is not a right way. Rather enhance query handler classes to modify query and add your field in that.

Please let me know the requirement...

Regards,

Bhushan

Former Member
0 Kudos

Hi Bhushan,

Thanks for the quick reply.

I added this field by appending it to the query structure.

As u mentioned that to enhance query handler classes to modify query and add your field in that, can u please eloborate on this with the steps i have to do that will be helpful.

Thanks in Advance.

Regards,

Dinesh.

Former Member
0 Kudos

Hi Dinesh,

Every query has its handler class for your query it is CL_CRM_QCSR_RUN_BTIL. This class has a method GET_DYNAMIC_QUERY_RESULT which is responsible for building a query and get result from database.

Put a breakpoint in this method and see whats happening in lr_1o_search->set_selection_parameters method.

You would see all your search parameters in it_select_parameters.

Then modify this class as per your requirement and then maintain entry for this query in CRMC_OBJ_BTIL_C so that your custom class would be called.

Also please let me know if the field you are trying to add already exists on database and is in which table? In case you are adding a complete new field which doesn't exists on db then please add this field using AET.

Please let me know if this helps.

Regards,

Bhushan

Edited by: bhushan jawale on Mar 2, 2011 10:20 AM

Former Member
0 Kudos

Hi Bhushan,

I am trying to add Sales office field in the search parameters of the claims search screen. If the user selects any sales office from the list and search then based on the sales office i have to display the claims related to that sales office.

Thanks.

Regards,

Dinesh.

Former Member
0 Kudos

Hi Dinesh,

I had similar requirement in Opportunity search - to add sales office field in search query. I will post steps I did at that time...

See if they help you...

Since sales office field already exist on database, you don't have to create a new field.

Change your design layer object and add this field sales office to it.

Make sure that this field is present in query structure, if not append it.

Now this field would be displayed in available fields blocks Add it to search query in config.

As you might know this is a dynamic query which is built on runtime so add an entry to table crmc_repdy :

SEL FIELD SALES_OFFICE

NAME ON DB CRMD_ORDER_INDEX~SALES_OFFICE (Since for Lead sales office is stored in CRMD_ORDER_INDEX table)

DYN METHOD DYN_LEAD_H - (for ur case it might be DYN_CLA_H- not sure though)

CALL FOR WHERE ' '

Please let me know if this helps. If this doesn't work for you then you may have to debug and find a place where to put your code

Regards,

Bhushan

Former Member
0 Kudos

Hi Bhushan,

Thanks for the quick reply.

I will give a try with the steps u suggested. Hope it works

As u mentioned it might be DYN_CLA_H for my case. How to confirm this will be the Dynamic access name for claims.

Can u please tell me if there is a way to get the Dynamic Access name for claims.

Regards,

Dinesh.

Former Member
0 Kudos

Hi,

Just check entries in CRMC_REPDY and see if you can see other values those belong to same search query. I think DYN_CLA_H should work for you...

Please let me know if solution helps.

Regards,

Bhushan

Former Member
0 Kudos

Hi Bhushan,

I appended the query structure with the field name zsales_office.

Then in the table crmc_repdy I gave the entries as

Selection field : zsales_office

Fld Name in Database : CRMD_ORDER_INDEX~SALES_OFFICE

Dynamic Access Name : dyn_cla_h

Call Method : ' '

Then I executed the search by giving a sales office and i m not getting any results.

Am i giving the correct entries in the table crmc_repdy.

Can u tell me where i can put a break point and see whether these results are getting called or not.

Regards,

Dinesh.

Former Member
0 Kudos

Hi Dinesh,

I debugged query for Claims for a while and found out that result list is built in FM CRM_BSP_OIC_1O_SEARCH_FROM_RF please put break point and see whats going wrong.

I think changing dynamic method to DYN_ORDER_INDEX should solve your issue.

Trust this helps

Please let me know if you need more details.

Regards,

Bhushan

Former Member
0 Kudos

Hi Bhushan,

After changing the dynamic method to dyn_order_index i am getting results based on the selected sales office.This is working perfectly.

But these results are coming based on the sales offices of the org data in the claim. The results should not come based on this.

There is a change in the requirement .

In each claim there will be a claiming account(sold-to-party) in the general data. I need to get the claims based on the sold-to-party's sales office.

If i enter the sales office in the search, then the claims which are having the sold-to-party with that sales office should be displayed.

So do i have to modify the method get_dynamic_query_result of the class CL_CRM_QCSR_RUN_BTIL to achieve this. Is there any other option please let me know.

Thanks for ur time and help.

Regards,

Dinesh.

Former Member
0 Kudos

Hi Dinesh,

Now this becomes tricky. Since your requirement is very specific there is no way that standard sap can help. You may end up in enhancing n number of classes.

I can propose a solution though Please put of in front of your business/ functional team and then go ahead..

Now we will change our approach...Please follow below steps:

1. Add a altogether new field to your claim transaction using AET for sales office (description as 'Sales Office').

2. Make this field search and result relevant.

3. Whenever a sold to party is selected for claim transaction, based on the sold to party you would set value of this field.

4. Since your field is search relevant it will automatically appear in your search query (control this in view configuration.)

5. You may or may not display this field to end user in claim detail screen, You can control this by configuration.

6. Depending on your requirement you can show/hide standard sales office field in search query.

If you follow this approach then it will serve the purpose.

Trust this solves your issue. Give points if it helps.

Regards,

Bhushan

Former Member
0 Kudos

Hi Bhushan,

I have a doubt on the new approach u mentioned.

As u mentioned in the 3rd step whenever a sold to party is selected for claim transaction, based on the sold to party you would set value of this field. Is this approach applies for only new claims that will be created after this modification.

Or for the older claims also this sales office field will be populated automatically.

Can u please tell me in which method I can set the value of the sales office field based on the sold-to-party.

Thanks.

Regards,

Dinesh.

Former Member
0 Kudos

Hi Dinesh,

Once you add a field for sales office then see where your sold to party is selected. Put break points in do_prepare_output and see if it is being triggered or even you can set this value in set_sold_to_party method as well.

Regards,

Bhushan