Skip to Content
Technical Articles
Author's profile photo Jigang Zhang 张吉刚

Blacklist and Whitelist at SAP FSCM for credit check

Black and White lists at SAP FSCM

SAP FSCM provides some standard objects related to blacklist/whitelist which list as below:
  • TCODE: UKM_BLACK_WHITE
  • TABLE: UKM_B_W_LIST
  • CLASS: CL_UKM_FORMULA_FUNCTIONS
  • BADI: UKM_BLACKWHITE_LIST
Maintenance%20view%20of%20UKM_BLACK_WHITE
But looks like blacklist and whitelist are mainly for Credit Scoring not for Credit check steps. And I find no result from the where-used list for those objects within SAP_FIN/release 617 and FSCM_CCD/release 617.

Black and White lists for FSCM Credit check processing

This is our requirement:

  • For BP which is on White List in UKM_BLACK_WHITE – all orders creation would always pass credit check even it can’t pass any other credit check steps. Credit check logs required.
  • For BP which is on Black List in UKM_BLACK_WHITE – order could be created but would always credit failed even it can pass any other credit check steps. Credit check logs required.
SAP provides the standard check steps like 010, 020, 030, etc, for various checks from different dimensions, and of course, you may have customized steps at the definitions of BADI: UKM_CHECK_STEP.
Definitions%20at%20UKM_CHECK_STEP
The key points to control the check steps process is two parameters: value C_PASSED and table CT_RESULTS.
Method%20parameters%20of%20CHECK_STEP
  • C_PASSED is default as ‘X’ from a global level, and each check step is like the local level. Any check step clears this C_PASSED will lead to the final credit check failed.
  • Every check step will be verified separately by system as different check rule will use a customized combination of check steps(and no rule for that for sure). If C_PASSED is not ‘X’ for anyone of check steps used during the credit check process then the final result of the credit check will be failed.
  • CT_RESULTS is the table to append messages which will be displayed as logs of credit check, which must be adjusted as we need to let the user know what’s happened during the credit check.

For BP at the WHITE list

  1. Add BP checks logic for EVERY CHECK STEPS include all standard(access key required~) and customized steps;
  2. Don’t clear C_PASSED instead we give an extra warning message explain why credit check can pass with failed credit check steps
  3. Call method cl_ukm_credit_checker=>add_reason which append to CT_RESULTS.

Credit%20check%20result%20for%20BP%20at%20White%20list

For BP at the BLACK list

  1. Add BP checks logic for just ONE CHECK STEP for example step 500( which Show Credit Analyst ) will be executed for all credit check steps. As any check step clear C_PASSED will lead to final credit check failed.
  2. Clear C_PASSED and we give an extra Error message explain why the credit check is failed even all credit check steps are good.
  3. Call method cl_ukm_credit_checker=>add_reason which append to CT_RESULTS.

Check%20results%20for%20BP%20at%20black%20list

Conclusion

By using BADI implementation UKM_CHECK_STEP for check steps separately, we can make black/white list working at the credit check process and leave credit check logs clearly. (You may find one drawback for white list BP at credit check logs, we have to display those Warning messages per check step when multiplying check steps involved. Just come out if we check contents of CHECK_STEP if already exists before append, maybe we can skip those duplicated Warning.)

Maybe SAP provides other solutions for these functions, but at least we can fulfill our requirement by this approach with no much effort. Hope it’ll help if someone encounters the same task as me.

Please let me know if exists any other better approach to achieve the same. Thanks.

 

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Allen Chen
      Allen Chen

      Hi Jigang,

      Thank you for the valuable sharing, it is very helpful.

      We got a same request, but the trigger point is not the white/black list, we requested to check the incoterms in sales order, if it is in a list, the credit check should be always failed.

      We want to implement this same BADI UKM_CHECK_STEP, what blocked us now is we cannot retrieve the incoterms(VBKD-INCO1) from sales order at SD end as the check happens at FS end.

      Do you have any good idea how can we retrieve the SD data in this BADI?

      Thank you!

      Author's profile photo Jigang Zhang 张吉刚
      Jigang Zhang 张吉刚
      Blog Post Author

      hi Allen Chen

      Even you can get VBKD-INCO1 at this BADI, credit check still been triggered but failed. Better to skip the credit check totally.

      Have you tried VOFM->Requirements->Credit checks? About VBKD-INCO1, maybe you can try to get from user exit “FORM userexit_move_field_to_vbkd” in MV45AFZZ and EXPORT/IMPORT to memory, haven't tried myself yet... haha

       

      Author's profile photo Allen Chen
      Allen Chen

      Hi Jigang,

      Thank you for replying and the advice!

      Custom logic in BADI implementation UKM_CHECK_STEP, we want the check fails only limits to a few incoterms, if the incoterm in the sales order is one of these given incoterms, then the check is positive. The incoterm is just one of the SD data, we may also need to check other sales order data (e.g. sale org.(VBAK-VKORG)).

       

      VOFM->Requirements->Credit checks routine is an option, but if we can get the SD data within this BADI implementation UKM_CHECK_STEP, it will be much better/perfect, we simply add the message by calling method cl_ukm_credit_checker=>add_reason, then it can be saved into the log table(handled by following code after this BADI) and is available in DCD(UKM_CASE), we also can have both SD&FI data here so we have more parameters to build our logic. While VOFM routine cannot do this easily.

      The BADI implementation UKM_CHECK_STEP is  being called in another BADI BADI_SD_CM, let's say the sap sample implementation UKM_SD_FSCM_INTEGR1. Within which the Method cl_ukm_xi_facade_r3_50=>if_ukm_credit_query_r3~check_credit is called, and BADI UKM_CHECK_STEP is called withid this method.

      We have full SD data in BADI BADI_SD_CM(e.g. table XVBAK, XVBAP, XVBKD, ...), but even I export the SD data into memory here, I cannot import it in BADI implementation UKM_CHECK_STEP .

      BADI%20calling%20UKM_CHECK_STEP

      BADI calling UKM_CHECK_STEP

       

      This is just FYI. If you have any good idea just please let me know.

      Thank you very much!!!

      Author's profile photo Jigang Zhang 张吉刚
      Jigang Zhang 张吉刚
      Blog Post Author

      "We have full SD data in BADI BADI_SD_CM(e.g. table XVBAK, XVBAP, XVBKD, ...), but even I export the SD data into memory here, I cannot import it in BADI implementation UKM_CHECK_STEP ."

      I don't follow you that why can't import from memory at UKM_CHECK_STEP? we can modify the Standard step like 010 with an access key. you can't get value from memory or you can't use import at Badi impl?

      Author's profile photo Allen Chen
      Allen Chen

      Hi Jigang,

      Thank you again for your time.

      For example, I implemented the BADI BADI_SD_CM by coping from the sap standard sample implementation UKM_SD_FSCM_INTEGR1. So the code in my implementation is exactly same as UKM_SD_FSCM_INTEGR1.

      1. Before calling the method cl_ukm_xi_facade_r3_50=>if_ukm_credit_query_r3~check_credit , I export SD structure XVBAK to memory.

      Export_data_before_method_called

      Export_data_before_method_called

           2. Implemented BADI UKM_CHECK_STEP, created a new individual check step, during the check will import the data from step1.

      Import_data_in_check_step

      Import_data_in_check_step

       

      3. However, during the run, the import failed to get any value.Data_Not_imported

      Data_Not_imported

       

      I am not sure if something incorrect of the code.

      Let me know if you have any good idea.

      Thank you!!!

      Author's profile photo Jigang Zhang 张吉刚
      Jigang Zhang 张吉刚
      Blog Post Author

      have you tried to debug this?  no idea 😛

      Or try to create a function group with a global data field along with one SET function and one GET function to exchange data.

      Author's profile photo Allen Chen
      Allen Chen

      Thank you Jigang,

      I did as suggested, but still not able to GET the value.

      Anyway, thank you very much!!!😛

      Thank you!

      Author's profile photo Rajshekhar .
      Rajshekhar .

      Allen Chen There is different session get created when r3~check_credit get called as it is different user. In this case import or get/set function module of function group will not work.

       

      Please use set/get parameter ID.

       

      Thanks & regards,

      Rajshekhar

      Author's profile photo Jigang Zhang 张吉刚
      Jigang Zhang 张吉刚
      Blog Post Author

      Rajshekhar

      Thanks for the info. I didn't expect the user name will be changed during the credit check process ; P

      Author's profile photo Sandra Rossi
      Sandra Rossi

      Just a thought, not something related to your blog post, but to the terms used by SAP, I wonder when SAP will replace the terms in the documentation, to be "allow list" and "block list" for instance, and whether they will rename the existing objects 😉 https://help.sap.com/doc/b0322267728e48a28b0c8ee7dd1ab4c7/1.0/en-US/Inclusive%20Language%20Guidelines.pdf

      Author's profile photo Jigang Zhang 张吉刚
      Jigang Zhang 张吉刚
      Blog Post Author

      Sandra Rossi

      Thanks for the info. Totally agree.

      Author's profile photo Vishwa Ranjan
      Vishwa Ranjan

      Allen Chen Rajshekhar

      Jigang Zhang 张吉刚  Do you guys know how to add value to the parameters of the filter of a customized step ?  Please refer screenshot. Appreciate some pointers.