Quantcast
Channel: SCN : Blog List - Customer Relationship Management (SAP CRM)
Viewing all articles
Browse latest Browse all 229

Marketing attributes ASSIGN and MODIFY to the Business Partner through the Report in SAP-CRM

$
0
0

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.

 

sp1.JPG

 

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.

 

 

sp1.JPG

 

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

 

 

sp1.JPG

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.



sp1.JPG

 

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

 

sp1.JPG

 

Successfully modified both values of both attribute sets.


Viewing all articles
Browse latest Browse all 229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>