Skip to Content

Introduction

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.

Audience

Technical CRM / ABAP Consultant

Purpose

This document show complete solution approach to achieve the requirement mention in introduction section.

Dependencies/Pre-requisites

None

Technical Process steps

  1. Implement BADI in SE19 as ZCRM_RISK_MGMT_BADI.
  2. Implement method GET_PAYMENTTYPES.
  3. Use function Module ‘CRM_ORDER_READ’ to get partner number attached to order.
  4. If particular Partner number found in partner internal table, keep CT_ALLOWED_PAYMENT_TYPES as ZERO, and delete rest of allowed payment types.

method IF_EX_CRM_RISK_MGMT_BADI~GET_PAYMENTTYPES.

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’
EXPORTING
IT_HEADER_GUID                     lt_headerguid_tab

IMPORTING

ET_PARTNER                        = lt_partner.

IF SYSUBRC <> 0.
* Implement suitable error handling here
ELSE.

loop at lt_partner into w_part_tmp
where PARTNER_NO = ‘3273’.

    delete CT_ALLOWED_PAYMENT_TYPES where TYPES <> ‘0’.
exit.
endloop.
endif.

endmethod.

Customizing

None

Demo Information

Search item and add to cart and click in checkout.

Before BADI activation payment method invoice is coming.

/wp-content/uploads/2013/08/before_266025.png

/wp-content/uploads/2013/08/after1_266026.png

After badi Activation, Payment method had been changed.

/wp-content/uploads/2013/08/after2_266086.png

Conclusion

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.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply