cancel
Showing results for 
Search instead for 
Did you mean: 

Marketing Cloud - Overrule Subscription BAdI

swallis
Participant
0 Kudos

Hi,

I am attempting to override the default permission logic using the Overrule Subscription BAdI, but nothing I implement seems to make any difference in the system.

I am trying to customize such that no subscription will be opted in unless there is a corresponding permission (regardless of the date of the permission or whether it is implicit or explicit)

    DATA: ls_subscription        TYPE if_cuan_mp_subscription_check=>ts_subscription,
          ls_permission          TYPE if_cuan_mp_subscription_check=>ts_permission,

          lo_subscr_check_helper TYPE REF TO cl_cuan_mp_subscr_check_helper.

    ls_subscription = subscription.

    lo_subscr_check_helper->get_perm_of_subscr(
      EXPORTING
        subscription = ls_subscription
      IMPORTING
        permission   = ls_permission
    ).

    IF ls_subscription-subscriptionsignupexists = 'Y' AND ls_permission-permissiongranted = 'Y'.
      ls_subscription-subscriptionsignupexists = 'Y'.
    ELSE.
      ls_subscription-subscriptionsignupexists = 'N'.
    ENDIF.

    MOVE-CORRESPONDING ls_subscription TO subscription_result.

The above does not seem to work, so I then tried a really simple example - just set all subscriptions to opted out regardless of anything, to check that the BAdI is doing something, but even this has no effect, the contact UI still shows subscriptions as 'opted in':

    DATA: ls_subscription        TYPE if_cuan_mp_subscription_check=>ts_subscription,
          ls_permission          TYPE if_cuan_mp_subscription_check=>ts_permission,

          lo_subscr_check_helper TYPE REF TO cl_cuan_mp_subscr_check_helper.

    ls_subscription = subscription.

    ls_subscription-subscriptionsignupexists = 'N'.
    
    MOVE-CORRESPONDING ls_subscription TO subscription_result.

Can anyone spot where I am going wrong?

Thanks,

Simon

Accepted Solutions (0)

Answers (1)

Answers (1)

jayce_wang
Active Participant

Hi Simon,

The logic looks good. Did you publish the logic then refresh the contact UI to check the output?

And you can use custom logic trace the check whether the logic is called.

https://help.sap.com/docs/SAP_MARKETING_CLOUD/e0cd7c1ecf3d4f2f9feb46ec1c5b68fb/d84e5f0955844265bc240...

If issue persists, please create an incident in component CEC-MKT-DM-PER for further analysis.

Best regards,

Jayce

swallis
Participant
0 Kudos

Thanks Jayce for looking at the code - yes I did publish/refresh, & checked the trace, but no luck unfortunately. I'll raise a support incident.

jayce_wang
Active Participant
0 Kudos

Hi Simon,

Thank you for raising a support incident! My colleague with EUDP access will help check the issue in your system.

Best regards,

Jayce

swallis
Participant
0 Kudos

It turns out that since we were previously using an old deprecated version of this BAdI, there is a switch in our system pointing to use that one rather than the new one. SAP Support were able to switch it so the system consumes the new BAdI instead.

jayce_wang
Active Participant
0 Kudos

Hi Simon,

Thank you for sharing the result!

Best regard,

Jayce