Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2015 at 10:35 PM

    Did you find a solution for this issue?

    Thanks, Ansari

    Add a comment
    10|10000 characters needed characters exceeded

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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.