Skip to Content
Technical Articles
Author's profile photo Fidel Yalle

Credit Exposure Update

Introduction

In some business scenarios you will need to update customer credit exposure adding values from an external source or from an internal source that is not considered by standard.

For testing purposes this blog will show how to update credit exposure considering values for special stock W Customer Consignment and it will affect:

  • Credit exposure
  • Credit check

BAdI UKM_FILL will be used.

Customizing

1. Create Liability Category

This is important in case that credit exposure new values should be listed in a different liability category. If not, it is possible to use a standard one.

Go to SPRO > Financial Supply Chain Management > Credit Management > Credit Risk Monitoring > Credit Exposure Update > Define Liability Categories.

Create%20Liability%20Category

Create Liability Category

For this test Z01 Customer Consignment Stock liability category will be created.

New%20entry%20Liability%20Category

New entry Liability Category

Liability category should be created also as Credit exposure category  in SPRO > Financial Supply Chain Management > Credit Management > Integration with Accounts Receivable Accounting and Sales and Distribution > Integration with Sales and Distribution > Define Credit Exposure Categories.

Define%20Credit%20Exposure%20Category

Define Credit Exposure Category

Add%20Credit%20Exposure%20Category

Add Credit Exposure Category

2. Create implementation for BAdI UKM_FILL

Go to SPRO > Financial Supply Chain Management > Credit Management > Integration with Accounts Receivable Accounting and Sales and Distribution > Integration with Sales and Distribution > Customer Enhancements > BAdI: Fill Line Items for Credit Exposure Update.

Create%20implementation

Create implementation

Write an implementation name.

Implementation%20name

Implementation name

Note example implementation class in case you want to review SAP example.

Implementation

Implementation

Activate BAdI.

Activate%20BAdI

Activate BAdI

Development

For this particular case FILL_FIELDS method has to be used. In this method you have to add items (the ones with values that you want to add to credit exposure and influence credit check) to IS_NOTIFICATION table.

In order to work properly customer consignment stock should be considered in credit exposure values (customized code) and Fill-Up consignment order and Issue consignment order should not affect credit check and credit exposure.

In order to test this BAdI here is an example code with hardcode values.

  method IF_EX_UKM_FILL~FILL_FIELDS .

  DATA: ls_in LIKE LINE OF is_notification.

  "Without this conditional transaction UKM_CASE will dump.
  IF sy-tcode NE 'UKM_CASE' AND sy-tcode NE 'UKM_MY_DCDS'.
    CLEAR ls_in.
    ls_in-partner = '0001019367'. "BP
    ls_in-credit_sgmnt = '1000'. "Credit segment
    ls_in-comm_typ = 'Z01'. "Liability category
    ls_in-amount = '1300'. "Value added to Credit Exposure
    ls_in-currency = 'USD'. "Currency
    ls_in-objkey = 'TFBV-00003-3000000001-31001588'. "Object key will be showed in reports
    ls_in-objtype = 'MATNR'. "Customized object type
    ls_in-date = '20200805'. "Date since BP is carrying debt, it will influence CM behaviour

    APPEND ls_in TO IS_NOTIFICATION.

    CLEAR ls_in.
    ls_in-partner = '0001019367'.
    ls_in-credit_sgmnt = '1000'.
    ls_in-comm_typ = 'Z01'.
    ls_in-amount = '5200'.
    ls_in-currency = 'USD'.
    ls_in-objkey = 'TFBV-00003-3000000002-31001589'.
    ls_in-objtype = 'MATNR'.
    ls_in-date = '20200805'.

    APPEND ls_in TO IS_NOTIFICATION.
  ENDIF.

  export UKM_ITEM = IS_NOTIFICATION to memory id 'UKM_ITEM'.

endmethod.

Result in transactions

UKM_COMMITMENTS transaction.

BP transaction.

UKM_MALUS_DSP transaction.

New sales order.

Summary

Adding the right code and just using FILL_FIELDS method in BAdI UKM_FILL is possible to influence customer credit exposure in reports and credit check.

 

Thanks,

Fidel Yalle

Assigned Tags

      23 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Rochelle Zabalerio
      Rochelle Zabalerio

      This is a very good content. Thanks for sharing.

       

      We are wondering if we can leverage this BADI even if we don't purchase additional license for Advanced Credit Management

      Author's profile photo Fidel Yalle
      Fidel Yalle
      Blog Post Author

      Hi Rochelle! I'm glad the post is useful. If you implement that BAdI be sure that standard liabilities are working properly.

      Liabilities of FI/AR are are not saved in a table but are filled when are needed.

      And yes, you can use that BAdI in basic SAP FSCM-Credit Management.

      If you have some thoughts feel free to contact me.

      Best,

      Fidel

      Author's profile photo Sri Latha Potluri
      Sri Latha Potluri

      Hi Fidel,

       

      Thank you for your nice blog!!!

      We had similar requirements where we need to add custom credit category type. This is related to FI/AR open items.

      So as suggested in blog, we completed config part along with setting break-point in BADI:'UKM_FILL'(fill_fields method).

      But BADI is not being triggered while going thru 'UKM_COMMITMENTS' tcode for adding new category type.

      So could you please let us know as how to trigger the BADI so as to add the corr. new cat. type functionality.

      Author's profile photo Sridhar Ramaswamy
      Sridhar Ramaswamy

      Great post.

      How does credit management work if the BAdi is not implemented. I saw something about a fallback class but unable to locate

       

      Regards

       

      Sridhar

       

      Author's profile photo Fidel Yalle
      Fidel Yalle
      Blog Post Author

      Hi Sridhar,

      BAdI is not needed for Credit Management (SAP S/4 Hana FSCM - Credit Management) to work.

      If BAdI is not implemented, liabilities are calculated from SD (Open sales Orders, deliveries or invoices) and from FI/AR (Invoices not cleared or another open accounts from customer).

      Regards,

      Author's profile photo Purna Chandra Gunda
      Purna Chandra Gunda

      Hi Yalle

       

      Thank you for sharing the post which gives the opportunity to visualize the possibility to add a new Credit Exposure category.

      I have the following question, and I hope you may have the suggestion.

      Issue: Our requirement is to take the entire Sales Order Value in credit exposure, irrespective of the available quantity in Sales Order items.

      I understand we can alter to take the entire Sales order value from BADI BADI_SD_CM and through  Implementation Method FSCM_COMMITMENT_UPDATE_ORDER and FSCM_CREDIT_CHECK_ORDER, and able to check the entire Sales order value as part of credit check and in checked value (FOr a credit case), but not able to update the entire sales order value in Credit exposure (UKM_COMMITMENT), it still updates only the value of Sales order for which we have the stock available.

      When we tried to implement UKM_FILL - It creates multiple case ID's for the same Sales Order and was not able to find it being updating the entire sales order value in Credit exposure.

      Do you have some suggestions to resolve our issue?

      Thanks

      Purna.

       

       

      Author's profile photo Fidel Yalle
      Fidel Yalle
      Blog Post Author

      Hi Purna,

      Being that the standard is still taking the value of the sales order based on the stock available. I think one option to fulfill the requirement is using FM UKM_COMMITMENTS_UPDATE.

      You can use that function to update values for sales order already transferred to Credit Management, SAP tables you have to check first are UKM_ITEM and UKM_EXT_GUID.

      Regards,

      Fidel

      Author's profile photo Ajay Maheshwari
      Ajay Maheshwari

      Hi Purna

      The credit exposure / credit check is a function of two things - Confirmed Qty from Schedule lines in sales orders and Credit Price (the line in your SD pricing procedure where you put A in the Sub-totals column)

      With what you said, I think your schedule lines are updated based on available stock qty. Can you check that and confirm? If yes, that's our root cause. To address that, we need to overwrite the "confirmed qty" from schedule lines to "order qty". In my opinion, BADI_SD_CM carries this info from sales order to FSCM-CR. So, explore this BADI

      Regards

      AJ

       

       

      Author's profile photo Ajay Maheshwari
      Ajay Maheshwari

      Hi Fidel

      1. is it not possible to achieve the same from Badi_SD_CM, method Update_Commitment_From Order or Delivery?

      Is using UKM_FILL mandatory in this case?

      2. I always wonder what is the purpose of UKM_FILL. Once you activate the UKM_R3_ACTIVATE, the FI-AR values are read in real time. What business cases you think will qualify for UKM_FILL - methods FILL_VECTOR?

       

      Regards

      AJ

      Author's profile photo Fidel Yalle
      Fidel Yalle
      Blog Post Author

      Hi Ajay,

      1.I haven't tried that BAdI. Taking note for future requirements.

      2.With UKM_FILL you can set values no filled directly from standard or from an external source (values from FI-AR are standard and transferred in real time as you said).

      Regards,

      Fidel

      Author's profile photo Ajay Maheshwari
      Ajay Maheshwari

      Thanks Fidel.

      1. Do you know what the method FILL_VECTOR is used in Badi UKM_FILL? I am clear about method FILL_FIELDS after your blog

      2. I was also wondering what’s the difference between tables UKM_ITEM and UKM_TOTALS. Both contain same data. Are you aware which table is used when or if anyone of them is obsolete ?

       

      regards

      AJ

      Author's profile photo Punjabi records
      Punjabi records

      Nice post...very informative....helped me lot

      Author's profile photo Ankur Jain
      Ankur Jain

      Thank you for this good Post.

       

      Thanks,

      Ankur Jain

      Author's profile photo Carlos Ignacio Baez
      Carlos Ignacio Baez

      Hi fidel, if the Credit Exposure is not being updated automatically, how can I force it.

      What can I verify, any log?
      Author's profile photo Fidel Yalle
      Fidel Yalle
      Blog Post Author

      Hi Carlos, sorry for the late response.

      About your question, you can "force" items in Credit Exposure adding entries to table UKM_ITEM or for that matter using FM UKM_COMMITMENTS_UPDATE.

      Regards,

      Author's profile photo Nilesh Sonawane
      Nilesh Sonawane

      Hello All ,

      We have horizon concept for direct sales.If requested delivery date after horizon then system not consider particular sales order for credit exposure.

      Our client have similar requirment for third party sales.If we have sales order for future requested delivery date than system should not consider for credit exposure till the horizon period

      Example -

      Consider horizon = 30 days.

      If we are creating sales order on 01.06.2022 and requested delivery date is 01.08.2022 then system should not update credit exposure while saving sales order and allow to perform susequesnt task like creation of PR /PO.

      System should consider particular sales order for credit exposre before 30 day of delivery.Means credit exposure should be updated on 01.07.2022.

      kindly suggest if we can use above S/4 HANA funcationality for this requirment.

       

      Regards,

      Nilesh

      Author's profile photo Yusuf Avci
      Yusuf Avci

      Hi Fidel,

      Firstly, thank you for your useful blog post.

      I have implemented the Badi UKM_FILL - FILL_FIELDS for consignment per your description. And not filled other methods in UKM_FILL. And it works for consignment document type properly.

      When I create sales order which is not related to inside of UKM_FILL -> FILL_FIELDS codes and consignment process , credit exposure is not reflected. But it was works before Badi implementetion.

      When I run program UKM_RVKRED77, I can see the sales order but it would not create a line in UKM_COMMITMENTS.

      In note 2742707 mentioned it about. Is there any solution please?

      Note

      Note

      Author's profile photo Andrada Avirvarei
      Andrada Avirvarei

      Hello! I'm facing same situation. Did you manage to solve it? Thanks!

      Author's profile photo Carmen González Tena
      Carmen González Tena

      Hello!

      I'm also facing same situation. I filled all methods of this BADI implementation and still does not update properly credit commitment when the BADI is active?

      If it is set to Inactive it works properly.

      Did you manage to solve it?

      Thanks!

      Author's profile photo CORE S4 958 Consulting Partner
      CORE S4 958 Consulting Partner

      Hi,

       

      I'm also facing the same situation.

       

      Did you manage to solve it?

       

      Thanks

      Author's profile photo Sri Latha Potluri
      Sri Latha Potluri

      Hi Fidel,

      Thank you for your step-by-step explanation.

      We had similar scenario where we need to add custom credit exposure category. This custom requirement is related to FI/AR open items.

      Configuration was done as suggested in blog. Even break-point was set in the fill_fields method of the BADI as well.

      But while trying to trigger the BADI using the tcode:'UKM_COMMITMENTS' its not stopping in BADI, which in turn can't update the new type.

      So could you please suggest as how to trigger the BADI so as to stop there for writing further logic.

      Thanks in advance.

       

      Author's profile photo Sri Latha Potluri
      Sri Latha Potluri

      Hi Fidel,

       

      Thank you for your nice blog!!!

      We had similar requirements where we need to add custom credit category type. This is related to FI/AR open items.

      So as suggested in blog, we completed config part along with setting break-point in BADI:'UKM_FILL'(fill_fields method).

      But BADI is not being triggered while going thru 'UKM_COMMITMENTS' tcode for adding new category type.

      So could you please let us know as how to trigger the BADI so as to add the corr. new cat. type functionality.

      Author's profile photo Harman Irawan
      Harman Irawan

      Hi Fidel,

      Thank you for your great explanation about Credit Management, as you said "If BAdI is not implemented, liabilities are calculated from SD (Open sales Orders, deliveries, or invoices). But it does not happen to me. In Define Liabilities customizing, I ticked "Liabilities type 100 - Opened Order --> Check and Grid), but the report UKM_Commitments does not calculate Open Order, in fact I have 3 SO that should be calculated as Liabilities. For Your information, Delivery value (400) and Open Item From FI (200) already calculated as Liability for Credit Exposure.

       

      Regards,

      Harman