Skip to Content
Nov 28, 2014 at 07:39 AM

UKM_BP, Credit data for BP tcode.


Hi All,

I used the class cl_ukm_business_partner & cl_ukm_account to update the credit data for ukm_bp tcode. I want to update the risk class, check rule and credit limit. I also used the save_all method to save the changes. But still it is not updating the data. Can anyone highlight what could be the problem here?

Below is my code:

DATA: io_facade TYPE REF TO cl_ukm_facade,

io_partner TYPE REF TO cl_ukm_business_partner,

io_bupa_factory TYPE REF TO cl_ukm_bupa_factory,

io_account TYPE REF TO cl_ukm_account,

lw_bp_credit_sgm TYPE ukm_s_bp_cms_sgm.

DATA: lwa_ukm_s_bp_cms TYPE ukm_s_bp_cms.

DATA: lv_partner TYPE bu_partner,

lv_credit_sgmnt TYPE ukm_credit_sgmnt.

io_facade = cl_ukm_facade=>create( i_activity = cl_ukm_cnst_eventing=>bp_maintenance ).

io_bupa_factory = io_facade->get_bupa_factory( ).

lv_partner = '3000000011'.

lv_credit_sgmnt = 'US01'.

io_partner = io_bupa_factory->get_business_partner( lv_partner ).

io_partner->get_bp_cms( IMPORTING es_bp_cms = lwa_ukm_s_bp_cms ).

lwa_ukm_s_bp_cms-risk_class = 'D'.

io_partner->set_bp_cms( lwa_ukm_s_bp_cms ).

CALL METHOD io_bupa_factory->get_credit_account


i_partner = lv_partner

i_credit_sgmnt = lv_credit_sgmnt


ro_credit_account = io_account.

io_account->get_bp_cms_sgm( IMPORTING es_bp_cms_sgm = lw_bp_credit_sgm ).

lw_bp_credit_sgm-credit_limit = '20100.00'.

lw_bp_credit_sgm-xcritical = 'X'.

lw_bp_credit_sgm-limit_chg_date = sy-datum.

io_account->set_bp_cms_sgm( EXPORTING is_bp_cms_sgm = lw_bp_credit_sgm ).

io_bupa_factory->save_all( ).