Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BP transaction code data upload using cl_ukm_business_partner and cl_ukm_account.

Former Member
0 Kudos

Please check the code below and let me know for any change the BP transaction code is not getting updated when I am doing this way.

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

lo_bupa_factory = lo_facade->get_bupa_factory( ).

lo_partner = lo_bupa_factory->get_business_partner( wa-bp_num ).

* st_credit_sgm-credit_sgmnt = wa-credit_group.

lv_crdt_sgm = wa-credit_group.

*** Get Credit Account
CALL METHOD lo_bupa_factory->get_credit_account
EXPORTING
i_partner = wa-bp_num
i_credit_sgmnt = lv_crdt_sgm
RECEIVING
ro_credit_account = lo_account.

IF lo_account IS NOT INITIAL.
*** Get Credit Segment Data
lo_account->get_bp_cms_sgm( IMPORTING es_bp_cms_sgm = st_credit ).

st_credit-credit_limit = wa-credit_limit.
st_credit-cust_group = wa-redit_group.
st_credit-limit_valid_date = wa-valid_to.

*** Set Credit Segment Data.
lo_account->set_bp_cms_sgm( EXPORTING is_bp_cms_sgm = st_credit ).

ENDIF. " IF lo_account IS NOT INITIAL

*** Get Credit Profile Data
lo_partner->get_bp_cms( IMPORTING es_bp_cms = st_bp_cms ).
st_bp_cms-limit_rule = wa-rules.
st_bp_cms-own_rating = wa-score.
st_bp_cms-risk_class = wa-risk_class. " class
st_bp_cms-check_rule = wa-check_rule.
st_bp_cms-credit_group = wa-credit_group.
lo_partner->set_bp_cms( EXPORTING is_bp_cms = st_bp_cms ).

*** Update the credit segment and credit profile

lo_bupa_factory->save_all( EXPORTING i_upd_task = abap_true
RECEIVING et_return = i_return ).

0 REPLIES 0