CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member191161
Participant

Purpose : Assign and Modify marketing attributes to the Business Partner through the report in SAP-CRM.

Here the source code.

Goto tcode SE38.

DATA : it_f type CRMT_MKTBP_BP_VALUES_T,

       it_1 type TABLE OF CRMT_MKTBP_BP_VALUES,

       it_2 type TABLE OF CRMT_MKTBP_ATTRIBUTE_VALUES,

       wa_1 type CRMT_MKTBP_BP_VALUES,

       wa_2 type CRMT_MKTBP_ATTRIBUTE_VALUES.

DATA : ET_RETURN type TABLE OF BAPIRET2.

wa_2-ATNAME         = 'HOBBIES'.

*wa_2-ATWRT          = 'soccer'.

wa_2-ATWRT           = 'golf'.

APPEND wa_2 to it_2.

wa_2-ATNAME         = 'FZ_BYKE_SET'.

*wa_2-ATWRT          = 'childern'.

wa_2-ATWRT          = 'youngers'.

APPEND wa_2 to it_2.

wa_1-PARTNER_GUID    = '005056C000081EE48DE3BD1167EF9685'.

wa_1-PARTNER             = '0000423192'.

wa_1-ATTRIBUTE_SET   = 'INTERESTS'.

wa_1-ALLOCVALUES     = it_2.

append wa_1 to it_1.

wa_1-PARTNER_GUID   = '005056C000081EE48DE3BD1167EF9685'.

wa_1-PARTNER            = '0000423192'.

wa_1-ATTRIBUTE_SET  = 'FZ_BYKE_SET'.

wa_1-ALLOCVALUES    = it_2.

append wa_1 to it_1.

CALL FUNCTION 'CRM_MKTBP_SAVE_BP_LIST'

   EXPORTING

    IV_MSA                              = ' '

    IV_COMMIT                        = 'X'

    it_alloclist_bp                      = it_1

    IV_CONVERT_VALUES       = 'X'

    IV_OBJTYP                         = 'BUT000'

    IV_SET_LOCK                     = 'X'

    IV_WRITE_ALE                   = 'X'

  TABLES

    ET_RETURN                       = ET_RETURN

           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  EXPORTING

    WAIT              = 'X'

*  IMPORTING

*    RETURN        =

           .

IF sy-subrc = 0.

  MESSAGE 'MARKETING' ATTRIBUTES SUCCESSFULLY CREATED FOR GIVEN BP' TYPE 'S'.

ELSE .

  MESSAGE 'MARKETING ATTRIBUTES NOT CREATED FOR GIVEN BP' TYPE 'E'.

ENDIF.

Before execution.


In the program we are assigning marketing attributes to the business partner number  0000423192.


Go to tcode BP for testing particular business partner.

Here, there is no marketing attributes to the existing business partner.

After execution:

Details of bp number 423192 Marketing attributes.

FZ_BYKE_SET is the attribute set name and its attribute is FZ_BYKE_SET and its value is CHILDREN shown in the below screen shot.

And INTERESTS is the attribute set name and its attribute is HOBBIES and its value is SOCCER shown in the below screen shot.

Finally marketing attributes successfully assigned to particular business partner.

Now If you want to modify the attributes values then go to program change the values in the code. Modified screen shot shown below.

Here value youngers is the modified value to the FZ_BYKE_SET attribute set.



And value golf is the modified value to the INTERESTS attribute set.

Successfully modified both values of both attribute sets.

12 Comments