cancel
Showing results for 
Search instead for 
Did you mean: 

Open Channel Integration - Campaign Header data

bhaskar_idp
Explorer

Hi,

I am trying to implement Open channel integration for call center operations.
As part of the payload i would like to transfer the Campain Priority as Header attributes in payload. I have implemented 3) Open Channel: Define Global Settings for Execution" and append the additional custom campaign parameter in "changing Table HEADER_ATTRIBUTES'.
Still i am not getting the Campaign Priority in Payload.

DATA: lv_campaign_id         TYPE cuan_initiative_id,
          ls_header_Attr         like line of HEADER_ATTRIBUTES,
          ls_campaign_root_api   TYPE cuan_s_campaign_root_api.

    package_size = 1000. " change the number of target group members processed in one package and transferred in the odata payload
    CHECK_PERMISSION = abap_false.

    read table HEADER_ATTRIBUTES assigning FIELD-SYMBOL(<fs_head>) WITH KEY param_name = 'CAMPAIGN'.
    if sy-subrc eq 0.
       lv_campaign_id = <fs_head>-param_value.
endif.

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

 if ls_campaign_root_api-priority is NOT INITIAL.
    clear ls_header_attr.
    ls_header_attr-param_name = 'ZOC_EXPORT'.
    ls_header_attr-param_value = ls_campaign_root_api-priority.
    append ls_header_Attr to HEADER_ATTRIBUTES.
endif.

After implementing the above code i am still not getting the Priority in the payload.

{ "d": { "Campaign":
{ "CampaignId": "0000002233",
"Name": "Open Channel",
"MarketingAreaId": "IDP_IND",
"SegmentationObject": "SAP_CE_CONTACT_ENGAGEMENT",
"ImplementationId": "ZOC_EXPORT" }

Not sure where i am wrong in this.

Regards,

Bhaskar

bhaskar_idp
Explorer
0 Kudos

Hi oliver76,

Good day!!!
Seems you are faced similar issue, may I know if there any steps other than the above you performed to get the Campaign Header data in payload? If yes could you please let me know.

Ref: https://answers.sap.com/questions/584363/open-channel-integration---how-to-add-custom-attri.html

Regards,

Bhaskar

Accepted Solutions (1)

Accepted Solutions (1)

bhaskar_idp
Explorer

I resolved myself. Request experts can go through this and let me know if can implement best practices.
Note: Here I am updating campaign priority at TG Data, not at Header Level.

(3) Open Channel: Define Global Settings for Execution

DATA: lv_campaign_id         TYPE cuan_initiative_id,
          ls_header_Attr         like line of HEADER_ATTRIBUTES,
          ls_campaign_root_api   TYPE cuan_s_campaign_root_api.

    package_size = 1000. " change the number of target group members processed in one package and transferred in the odata payload
CHECK_PERMISSION = abap_false.

    read table HEADER_ATTRIBUTES assigning FIELD-SYMBOL(<fs_head>) WITH KEY param_name = 'CAMPAIGN'.
    if sy-subrc eq 0.
       lv_campaign_id = <fs_head>-param_value.
endif.

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

 if ls_campaign_root_api-priority is NOT INITIAL.
    clear ls_header_attr.
    ls_header_attr-param_name = 'ZOC_PRIORITY'.
    ls_header_attr-param_value = ls_campaign_root_api-priority.
    append ls_header_Attr to HEADER_ATTRIBUTES.
endif.

(4) Open Channel: Enhance Payload for Data Transfer

    DATA lv_campaign type C length 10.
    DATA lv_desc     type String.
    DATA lv_message  type String.
    DATA ls_param    like line of header_attributes.
    DATA ls_campaign_root_api   TYPE cuan_s_campaign_root_api.

    READ TABLE header_attributes ASSIGNING FIELD-SYMBOL(<ls_header_attributes>) " table contains also the action parameters
         WITH KEY param_name = 'ZOC_PRIORITY'.
    IF sy-subrc = 0.
        APPEND VALUE #( attribute_id = 'ZOC_PRIORITY'
                        attribute_name = 'Priority'
                        attribute_type = 'Edm.String' ) TO target_group_member_attributes.
        DATA(lv_description) = <ls_header_attributes>-param_value. " helper variable, needed in next loop
*      ENDIF.
    ENDIF.

    read table HEADER_ATTRIBUTES assigning FIELD-SYMBOL(<ls_header>) WITH KEY param_name = 'CAMPAIGN'.
    if sy-subrc eq 0.
       lv_campaign = <ls_header>-param_value.
    endif.

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

LOOP AT target_group_member_status ASSIGNING FIELD-SYMBOL(<ls_target_group_member_stat>).
      READ TABLE target_group_member_data ASSIGNING FIELD-SYMBOL(<ls_target_group_member_data>) WITH KEY tg_member_key = <ls_target_group_member_stat>-tg_member_key.
      CHECK sy-subrc IS INITIAL.
    lv_desc = ls_campaign_root_api-priority.
        APPEND VALUE #( tg_member_key = <ls_target_group_member_data>-tg_member_key
            tg_member_interaction_contact = <ls_target_group_member_data>-tg_member_interaction_contact
            tg_member_interaction = <ls_target_group_member_data>-tg_member_interaction
            attribute_id = 'ZOC_PRIORITY'
            attribute_value = lv_desc ) TO target_group_member_data.
        cl_ble_trace_writer=>write_info_message( lv_desc ).
    ENDLOOP.

Answers (3)

Answers (3)

former_member599277
Contributor
0 Kudos

Dear Bhaskar,

It is currently not possible to have the custom header attributes included in the payload at the header level .You could submit a customer influence request for the same.

2812948 - How To: Enhancement Request Process for SAP Marketing Cloud Using the Customer Influence Platform

However, as you have already figured out and updated your logic , ( to add those custom attributes to the Target Group Member data in the payload ) , this is the right work around to transfer these details .

Regards,
SaravanaKumar M

former_member1277
Participant
0 Kudos

Just wondering about the following statement that you have in the code :

1. CHECK_PERMISSION = abap_false

Why do you want to do this ?

Can you comment this line for now and check the execution.

Cheers

bhaskar_idp
Explorer
0 Kudos

Hi,

Tried as you suggested, no luck.

Regards,

Bhaskar

former_member1277
Participant
0 Kudos

Hi Bhaskar Pavuluru

Please make sure Filter ID is correctly defined.

Cheers

bhaskar_idp
Explorer
0 Kudos

Hi,

Yes, that was correctly defined.

Regards,
Bhaskar