User is creating a shopping cart order in e-commerce site.
For particular partner number, we would like to show credit card payment mode as only payment method when user clicks at checkout in e-commerce site.
Technical CRM / ABAP Consultant
This document show complete solution approach to achieve the requirement mention in introduction section.
Technical Process steps
- Implement BADI in SE19 as ZCRM_RISK_MGMT_BADI.
- Implement method GET_PAYMENTTYPES.
- Use function Module ‘CRM_ORDER_READ’ to get partner number attached to order.
- If particular Partner number found in partner internal table, keep CT_ALLOWED_PAYMENT_TYPES as ZERO, and delete rest of allowed payment types.
DATA: lt_headerguid_tab TYPE crmt_object_guid_tab,
w_part_tmp type CRMT_PARTNER_EXTERNAL_WRK,
lt_partner TYPE CRMT_PARTNER_EXTERNAL_WRKT.
INSERT IV_ORDER_GUID INTO TABLE lt_headerguid_tab.
CALL FUNCTION ‘CRM_ORDER_READ’
IT_HEADER_GUID = lt_headerguid_tab
ET_PARTNER = lt_partner.
IF SY–SUBRC <> 0.
* Implement suitable error handling here
loop at lt_partner into w_part_tmp
where PARTNER_NO = ‘3273’.
delete CT_ALLOWED_PAYMENT_TYPES where TYPES <> ‘0’.
Search item and add to cart and click in checkout.
Before BADI activation payment method invoice is coming.
After badi Activation, Payment method had been changed.
We can achieve result the by implementing the BADI CRM_RISK_MGMT_BADI. There are other payment methods also available like cash on Delivery. Here we have hard coded Partner number, but we can also have logic to first find the partner numbers (as example, search all customers who have exhausted credit limit) then show only cash on delivery for such partners.