cancel
Showing results for 
Search instead for 
Did you mean: 

Open Channel Integration - Class to read campaign data

former_member355106
Active Participant

Hello togehter,

We are on yM Cloud 1805.

Within this post there is the following coding used in BAdI "“(4) Open Channel: Enhance Payload for Data Transfer”:

LOOP AT target_group_member_status ASSIGNING FIELD-SYMBOL(<ls_target_group_member_stat>).  
  " Replace the given identifier by ID_ORIGIN specific identifiers  
  CL_CUAN_INTERACT_CNTCT_HELPER=>GET_CONTACT_FACETS( EXPORTING IT_CONTACT_KEYS  = value #( ( conv #( <ls_target_group_member_stat>-TG_MEMBER_INTERACTION_CONTACT ) ) )   
                                                     IMPORTING ET_CONTACT_FACET = data(lt_contact_facet) ).  
  READ TABLE lt_contact_facet  ASSIGNING FIELD-SYMBOL(<ls_contact_facet>) WITH KEY id_origin = 'SAP_ERP_CUSTOMER'.  
  IF SY-SUBRC EQ 0.  
    <ls_target_group_member_stat>-communication_id = <ls_contact_facet>-id.  
  ENDIF.
ENDLOOP.

We need to read data from our campaign. Can anybody tell me if there exists any class like CL_CUAN_INTERACT_CNTCT_HELPER that we can use to read data from a Hybris Marketing Campaign?

We have created some custom fields on the campaign action that we have to read and that have to be added to the payload using when doing "Open Channel Integration".

Cheers,

Accepted Solutions (1)

Accepted Solutions (1)

former_member576423
Participant
0 Kudos

Hi Oliver,

Check in the below code marked as BOLD:

template-id_origin = 'SAP_HYBRIS_MKT_IC'.
template-interaction_type = 'Z_LETTER'. " This is a customer defined interaction type
template-communication_medium = 'PAPER'. " Example how to use the campaign root API for setting the parameter TEMPLATE campaign dependend
DATA: lv_campaign_id TYPE cuan_initiative_id,
lr_oc_header_attribute TYPE REF TO cuan_s_oc_header_attribute,
ls_campaign_root_api TYPE cuan_s_campaign_root_api.
READ TABLE header_attributes REFERENCE INTO lr_oc_header_attribute WITH KEY param_name = if_cuan_mkt_orch_constants=>sc_open_channel_header_attr-campaign. " CAMPAIGN
IF sy-subrc EQ 0. " Campaign identifier has been passed in parameter HEADER_ATTRIBUTES
lv_campaign_id = lr_oc_header_attribute->param_value.
ls_campaign_root_api = cl_cuan_campaign_helper_api=>campaign_root_read( EXPORTING iv_id = lv_campaign_id ).

IF ls_campaign_root_api-priority EQ cl_cuan_campaign_helper_api=>co_priority-high.
template-interaction_type = 'Z_LETTER'.
ELSE.
template-interaction_type = 'Z_EMAIL'.
ENDIF

former_member576423
Participant
0 Kudos
Hi Oliver,

Please mark this as answer if it answered your query.

Thanks,

former_member355106
Active Participant
0 Kudos

Hi Mayank,

thank you for your reply. We have tried to enhance the following BAdIs so we can send some custom fields which we have created with the app Custom Fields and Logic for the context Marketing: Campaigns and are visible on the campaign to add to the payload in the following way:

We have tried to use all BAdIs which are availbel for the Open Channel Integration and we can not achieve that the fields are available and added to the file sent out. Could you please tell use which BAdI to use here and in which way maybe?

former_member576423
Participant
0 Kudos

Hi Oliver,

Can you try calling the below code-

ls_campaign_root_api = cl_cuan_campaign_helper_api=>campaign_root_read( EXPORTING iv_id = lv_campaign_id ).

Answers (0)