on 07-14-2014 9:10 AM
I need execute marketing campaign using abap. what have functional modules to solve the problem?
Hi Mihail,
You can create a campaign using the bapi MKT_ELEMENT_CREATE.
You can create campaign elements using the method 'element_create' of the class 'cl_crm_mktpl_appl_base' followed by the 'save' method and BAPI_TRANSACTION_COMMIT.
Hope you find it useful.
Regards,
Manjeet Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved the problem as follows:
DATA:
lv_object_guid TYPE crmt_jw_object_guid, "Campaign GUID
lr_bol_core TYPE REF TO cl_crm_bol_core,
lr_entity TYPE REF TO cl_crm_bol_entity,
ls_param TYPE crmt_name_value_pair,
lt_param TYPE crmt_name_value_pair_tab,
lr_result TYPE REF TO if_bol_entity_col,
lr_tx_manager TYPE REF TO cl_mktprj_transaction_mgr,
lr_transaction TYPE REF TO if_bol_transaction_context
.
lr_bol_core = cl_crm_bol_core=>get_instance( ).
lr_bol_core->load_component_set( 'CRMD_MKTPL' ).
TRY .
lr_bol_core->get_root_entity(
EXPORTING
iv_object_name = 'Campaign'
iv_object_guid = lv_object_guid
RECEIVING
rv_result = lr_entity " Entity
).
CATCH cx_root.
ENDTRY.
IF lr_entity IS BOUND.
* Set JOB_START_TYPE
CLEAR ls_param.
ls_param-name = 'JOB_START_TYPE'.
ls_param-value = 'I'.
APPEND ls_param TO lt_param.
CLEAR ls_param.
ls_param-name = 'JOB_NAME'.
ls_param-value = lv_object_guid.
APPEND ls_param TO lt_param.
* Set START_DATE
CLEAR ls_param.
ls_param-name = 'START_DATE'.
ls_param-value = sy-datlo.
APPEND ls_param TO lt_param.
* Set START_TIME
CLEAR ls_param.
ls_param-name = 'START_TIME'.
ls_param-value = sy-timlo.
APPEND ls_param TO lt_param.
* Only continue if root entity could be locked
IF lr_entity->lock( ) = abap_true.
TRY.
* get transaction
lr_transaction = lr_bol_core->get_transaction( ).
* Call Execute method.
lr_result = lr_entity->execute( iv_method_name = 'CPGExecuteBackground'
it_param = lt_param ).
* Save if action has been successful
lr_tx_manager = cl_mktprj_transaction_mgr=>get_instance( ).
IF lr_tx_manager->save_all( iv_external_commit = abap_true ) = abap_false. "no success returned
ELSE.
"we can check the status of execution:
" lr_collection = lr_entity->get_related_entities( iv_relation_name = 'CPGSegmentRel' ).
"...............
"...............
"...............
"end check status of execution
lr_transaction->save( ).
lr_transaction->commit( ).
ENDIF.
* Method failed
CATCH cx_crm_bol_meth_exec_failed.
ENDTRY.
ENDIF.
ENDIF.
ENDIF.
Best Regards,
Mikhail Cherkasov
mailto: jimice7@gmail.com
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.