Quantcast
Channel: SCN : Popular Discussions - SAP CRM: Marketing
Viewing all articles
Browse latest Browse all 2001

Creating Campaign root entity using BOL programming

$
0
0

Hi all,

My requirement is to write Program to create campaign and create all assignment blocks in campaign. I am using BOL programming. I have written following code to create Root entity 'Campaign'. But after i do Commit Attribute_ref of lv_campaign is initial. Is there any wrong in the code?

 

  REPORT  ZMAP_CAMPAIGN_DATA1.
DATA: LT_PARAMS TYPE CRMT_NAME_VALUE_PAIR_TAB,
      LS_PARAMS TYPE CRMT_NAME_VALUE_PAIR.

DATA : LR_MKT_FACTORY TYPE REF TO CL_CRM_BOL_ENTITY_FACTORY,
       LR_BOL_CORE TYPE REF TO CL_CRM_BOL_CORE.

DATA: lv_campaign TYPE REF TO cl_crm_bol_entity.
DATA: lv_transaction TYPE REF TO if_bol_transaction_context.

START-OF-SELECTION.


lr_bol_core = cl_crm_bol_core=>get_instance( ).
lr_bol_core->start_up( 'CRMD_MKTPL' ).
ls_params-name = 'CAMP_TYPE'.
ls_params-value = 'Z005'.
APPEND ls_params TO lt_params.
ls_params-name = 'ZZMARKET'.
ls_params-value = 'UK'.
APPEND ls_params TO lt_params.
ls_params-name = 'ZZCOUNTRY'.
ls_params-value = 'AL'.
APPEND ls_params TO lt_params.
ls_params-name = 'ZZBRAND'.
ls_params-value = 'LR'.

APPEND ls_params TO lt_params.
*   GET FACTORY FOR BUSINESS OBJECT
LR_MKT_FACTORY = LR_BOL_CORE->get_entity_factory( 'Campaign' ).
*   CREATE ROOT ENTITY
lv_campaign = lr_mkt_factory->create( lt_params ).


lv_transaction = lr_bol_core->get_transaction( ).
lv_transaction->save( ).
lv_transaction->commit( ).

 

 

Also please suggest if there is any other way to create campaign/Marketing plan/Campaign element. It would be very helpful if you can provide me FMs to create Campaign header and item level details.

 

I tried using method CL_CRM_MKTPL_APPL_BASE->Element_create. We can create Campaign/Marketing plan/Campaign element header details. But how to create Assignment block details using this class.

 

Thanks and Regards,

Pallavi


Viewing all articles
Browse latest Browse all 2001

Latest Images

Trending Articles



Latest Images

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