SAP Community Network Forums » SAP Solutions » Customer Relationship Management (CRM) - General & Framework

Thread: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP

This question is answered.


Permlink Replies: 14 - Pages: 1 - Last Post: Nov 9, 2009 6:05 AM Last Post By: Sanila John
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 4, 2009 7:51 AM
Click to report abuse...   Click to reply to this thread Reply
Hi experts,

I have used this BADI BADI_CRM_BP_UIU_DEFAULTS for defaulting the number range while creating a BP. This works perfect.

Now I have one more requirement. Default the number range for BP which gets created in MSA (CRM offline)
Can I implement the BADI BUPA_INBOUND for this ?

I am looking for the right code to put in this BADI.

My requirement is when a BP is gets created in MSA and send to CRM ,based on the BP Type say if Organization then I want to default the number range (BU_GROUP ='0060')

Please reply the code for this requirement.

Thanks
Sanila
Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 4, 2009 9:00 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
I have used the CHECK_BEFORE_INBOUND method of this BADI to change the group as you required.

the field to set is c_bp_central_data-common-data-bp_control-grouping based on your criteria for changing.
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 4, 2009 9:46 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

Thanks a lot for this.

This is excatly what I am looking for .Could you please paste the code here

Thanks
Sanila
Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 4, 2009 10:12 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
I does not feel appropriate for me to write the code for you, not knowing you environment and specific criteria.

Have a go yourself, and I will happily advise if you have problems.

Edited by: Paul Thompson on Nov 4, 2009 10:12 AM
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 5, 2009 9:12 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

My code is as below but when I create a BP in MSA , the grouping id not getting changed to 0060. This is still having the internal grouping configured.


METHOD if_ex_bupa_inbound~check_before_inbound.

IF c_bp_central_data-common-data-bp_control-category ='2'.

c_bp_central_data-common-data-bp_control-grouping = '0060'.

ENDIF.

ENDMETHOD.

Thanks ,
Sanila

Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 5, 2009 9:18 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
hi

Not quite sure what you mean when you say entry via MSA, but

I think it is probably worth trying to debug now, to ensure entry via MSA is invoking this BADI, and checking the values of the data.

Are you okay to debug the middleware ?

It requires putting the breakpoint into the BADI, deregistering the queue, changing the RFC user associated with middleware to a dialogue user, and then going into debug from the queue in SMQ2.
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 5, 2009 12:24 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

MSA is nothing but SAP CRM's Mobile sales application .

I am okay with debugging middleware but can you tell me how to
change the RFC user associated with middleware to a dialogue user.

Thanks,
Sanila
Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 5, 2009 12:28 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Sanilla

transactio SU01, put in the user name of the middleware RFC user, usually RFCUSER (but may be different on your system), and press change icon.

On the 'logon data' tab, the field user type should be changed from 'B System' to 'A Dialogue'.

It may be that you do not have authorisation in which case you will need to ask the help of your Basis team.
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 5, 2009 12:58 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

I changed the RFC user to Dialog user
Deregistered the Q
and from SMQ2 I debugged but my code of the BADI_INBOUND was not getting hit.

But I assumed that any new BP created from outside CRM will go through this BADI before save in CRM.

Is there an alternate place where I can acheive this functionality.

hanks& Regards,
Sanila

Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP   Correct
Posted: Nov 5, 2009 1:02 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
I do a similar thing with BP coming from an ECC5 system, and this does go through this BADI. If the entry is appearing in the queue, I would expect it to go through the same process.

have you checked the badi is active ?

and have you tried a hard 'breakpoint' command in the badi rather than trying a session breakpoint ?

This badi should be being invoked by a bupa bdoc.
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 6, 2009 12:28 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

I debugged the middleware part and I could see that in the below code the BADI is not getting called because
he value for gv_class_bupa_inbound is INITIAL.

*BAdI for Inbound
DATA: gv_class_bupa_inbound type ref to BUPA_INBOUND.

GET BADI gv_class_bupa_inbound.
CATCH CX_BADI_NOT_IMPLEMENTED into lc_ref.
ENDTRY.
IF gv_class_bupa_inbound IS NOT INITIAL.
CALL BADI gv_class_bupa_inbound->check_before_inbound
EXPORTING
iv_partner = lv_partner
iv_partnerguid = lv_partnerguid
IV_OBJECTTASK = ls_header-object_task
CHANGING
c_bp_central_data = ls_central_data.
ENDIF.

The BADI is active. When I go to se18 and open the BADI ,it displays as Enhancement spot. Is that the issue.
Or am I missing something else.
Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 6, 2009 12:39 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
if gv_class_bupa_inbound is INITIAL then the badi is not being seen as active.

Can you check in SE19 for the implementation, on tab 'Enh.Implementation Elements', under the section 'Runtime Behavior', is the 'implementation active' checkbox checked ?
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 6, 2009 2:24 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi,

The checkbox under Runtime behaviour Implementation is Active is checked.
Should I cross check some other settings.

Sanila
Paul Thompson

Posts: 98
Registered: 7/17/08
Forum Points: 154
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 6, 2009 2:36 PM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
If the badi is active and the implementation has been generated and activated, the get badi command should be returning a non null value to the gv_class_bupa_inbound.

I am sorry there is not much more I can suggest if all looks like it is active.

It should be invoking the badi.
Sanila John

Posts: 8
Registered: 10/12/09
Forum Points: 0
 
Re: BADI BUPA_INBOUND How to change BU_GROUP for the incoming BP  
Posted: Nov 9, 2009 6:05 AM   in response to: Sanila John in response to: Sanila John
Click to report abuse...   Click to reply to this thread Reply
Hi Paul,

I found the issue.

The issue was For the BADI in the tab Enh spot element Definitions under the header 'Instance creation Mode'

I selected Reusing Instantiation and now the BADI is getting called.

Thanks for your support.

Point your RSS reader here for a feed of the latest messages in all forums