cancel
Showing results for 
Search instead for 
Did you mean: 

Add business partner to target group! BAPI_TARGETGROUP_ADD_BP

Former Member
0 Kudos

Hello everyboby!

I would like to add some business partners to my target group. I tried the function module "BAPI_TARGETGROUP_ADD_BP", but I couldn't find the added business parters in the CRM UI.

Do you know this problem?

or

Do you know any other methods or function module to add business partners to a target group?

Many thanks in advance!

Edited by: Meer Wu on Oct 26, 2009 2:42 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Commit work is very important after Call BAPI function.

Former Member
0 Kudos

Hi Meer

I have used the BADI CRM_MKTTG_SEG_MEM_EX to extend the target group member list to include additional fields including BPs. I believe this BADI is executed when you use the segment builder and choose to build a target group.

You may be able to use this BADI in your case?

Cheers

Declan

Former Member
0 Kudos

Hi Meer,

I remember once using CRM_MKTTG_TG_MAINTAIN.

But the BAPI you've mentioned also uses the same Function Module inside. So it should be working.

But I also remember using CRM_MKTTG_SET_SAVE after CRM_MKTTG_TG_MAINTAIN to save the

profile set associated with the targetgroup. May be you can try that.

Check if the BAPI is successfully updating the BPs, are there no error messages ?

Also make sure that there is a COMMIT WORK after the process.

Regards,

Masood Imrani S.

Former Member
0 Kudos

Hello Masood,

thanks a lot for your suggestion! After I add CommitWork. My prgramm is working now. The whole process is as following:

1. create a new compaign in SAP CRM 7.0

CALL METHOD lr_appl_base->element_create

2. Create Profil set:

CALL FUNCTION 'CRM_MKTTG_SET_MAINTAIN'

3. Create Target group in the profil set: CALL FUNCTION 'CRM_MKTTG_TG_MAINTAIN'

4. Save profileset: CALL FUNCTION 'CRM_MKTTG_SET_SAVE'

5. assign created target group directly to campaign element

CALL METHOD lr_appl_base->tggr_assign_create

CALL METHOD lr_appl_base->save

CALL METHOD lr_appl_base->commit

6. Add business partner to target group

CALL FUNCTION 'BAPI_TARGETGROUP_ADD_BP'

7. * Commit work

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'