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: 

UKM_BP, Credit data for BP tcode.

jaymin_thakkar05
Explorer
0 Kudos

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

  EXPORTING

  i_partner = lv_partner

  i_credit_sgmnt = lv_credit_sgmnt

  RECEIVING

  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( ).

5 REPLIES 5

Former Member
0 Kudos

Did you find a solution for this issue?

Thanks, Ansari

0 Kudos

Yes, I found the solution.

Let me know which fields you want to update for Credit data?

0 Kudos

Can you share what was the solution?


I'm trying to update BP's Credit Segment Control Data. Based on some condition, I've to add 'Block Reason' and 'Blocked in Credit Management' checkbox should be checked.

0 Kudos

I found the solution myself. I had to use SET_BLOCK method and adjust the SAVE_ALL method like this:

IO_ACCOUNT->SET_BLOCK( I_REASON = <whatever reason there is according to your requirement> ).

Note: The above method will not only put blocking reason but also will check mark the 'Blocked in Credit Management'.

IO_BUPA_FACTORY->SAVE_ALL(

      EXPORTING

        I_UPD_TASK               = abap_false ).

robinthakral
Advisor
Advisor
0 Kudos

https://blogs.sap.com/2023/09/11/fscm-credit-management-update-s-4-bp-role-sap-credit-managementukm0...
refer to this blog, please.. hoping you found it useful

Follow at:
https://www.linkedin.com/in/robinthakral/