on 2018 Aug 02 10:13 AM
Hi together,
we have implemented the open channel integration to send a csv file via CPI to an external SFTP Server.
The problem is now we have created several fields in the contect "Marketing: Campaign". These fields are shown on the campaign and can be filled out on the UI -> so far so good.
Now we want to add these data also with the payload as meadata to the csv file like shown in the following xml file overview:

There exists the BAdI "(4) Open Channel: Enhance Payload for Data Transfer". In this BAdI there exists the table "TARGET_GROUP_MEMBER_ATTRIBUTES" which is described as: This table contains the meta-data of the transferred data.
How we would enhance this BAdI so our custom attributes are send to within the payload?
BR/
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
We forgot to put put the filter ID (e.g. ZOC_INI_GOAL) to the BADI. Now it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
BAdI "(4) Open Channel: Enhance Payload for Data Transfer" shall only be used to enhance the payload for Each Target Group member with certain attributes from export definition, But since you want to add the campaign header attribute to message header my recommendation would be to implement "(3) Open Channel: Define Global Settings for Execution" and append the additional custom campaign parameter in "changing Table HEADER_ATTRIBUTES'.
for this purpose you can make a read call to campaign at run time using cl_cuan_campaign_helper_api=>campaign_root_read( EXPORTING iv_id = lv_campaign_id ).
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 = 20. " 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-yy1_goal_min is NOT INITIAL.
clear ls_header_attr.
ls_header_attr-param_name = 'ZOC_INI_GOAL'.
ls_header_attr-param_value = ls_campaign_root_api-yy1_goal_min.
append ls_header_Attr to HEADER_ATTRIBUTES.
endif.
Thanks
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Saurabh,
thank you so much for your reply. We have tried to add the fields to the Output by using BADI "Open Channel: Define Global Settings for Execution” (CUAN_CPG_OPN_CHNL_PRE_PROC)".
The coding right now is as follow:
DATA: lv_campaign_id TYPE cuan_initiative_id,
ls_header_attr LIKE LINE OF header_attributes,
lv_error_message LIKE LINE OF error_messages,
ls_campaign_root_api TYPE cuan_s_campaign_root_api.
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.
ls_campaign_root_api = cl_cuan_campaign_helper_api=>campaign_root_read( EXPORTING iv_id = lv_campaign_id ).
CLEAR ls_header_attr.
ls_header_attr-param_name = 'ZOC_EXPORT_YY1_ANZAHL_PROSPEKTE'.
ls_header_attr-param_value = ls_campaign_root_api-yy1_anzahl_prospekte_min.
APPEND ls_header_attr to header_attributes.
ENDIF.
Unfortunately the field "yy1_anzahl_prospekte_min" is not added to the header of the message. Still we just have the fields of the export definition that are being send.
Could you tell us please, if the "new" attributes have to be pusblished somewhere (?) else as we can not debug the code in the cloud solution. Do you have any more hints for us?
BR/
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.