Skip to Content
Author's profile photo Gangadhar Ragula

Sales Order number update in the standard logs for FSCM Credit Checks

This document explains how to update the Sales Order number to the logs created for FSCM credit management credit checks during SO Creation.


As a part of FSCM Credit Management, Logs will be registered in the database for the credit checking steps performed. These logs should be created for failed credit checks triggered for business partner and the sales order number should be added to these logs.


  1. FSCM Credit Management setup should be in place
  2. Credit Checking steps should be implemented
  3. Business Partner should be assigned to the Check Rule defined for credit checks to trigger during the SO creation under Credit Profile tab of transaction UKM_BP.


At the time of creation of Sales Order, basis the FSCM Credit Management setup and credit checking steps configurations, logs will be created for credit checks performed. (We can perform any number of credit checks based on the requirement).

Credit checks are displayed in the popup with the details of failed checks.

Sales Order will not be generated at this point of time, but logs will be posted to database. Once we continue, then only Sales Order will be created.

These logs can be viewed though transaction code “UKM_LOGS_DISPLAY”.


Since the Credit checking process is the intermediate step, it is not possible for the user to find the Sales Order for which credit checks are failed.


For this we have implemented one implicit enhancements and one user exit to enhance the standard functionality.

  1. Implicit Enhancement in the method CHECK_ACCOUNT of class “CL_UKM_CREDIT_CHECKER”.

Pseudo Code:

DATA: lv_mem_id TYPE string.

                CONCATENATE is_item-partner      “Business Partner

                                                is_item-credit_sgmnt “Credit Segment

                                                is_item-iguid        “GUID

                                                l_log_handle         “Log Handle

                                                INTO lv_mem_id SEPARATED BY ‘,’.

                EXPORT lv_mem_id = lv_mem_id TO MEMORY ID ‘ZLOGID’.

  1. Implement User Exit “USEREXIT_SAVE_DOCUMENT” of Include MV45AFZZ with below Pseudo code.

DATA: lv_mem_id      TYPE string,

            lv_dummy       TYPE string,

            lv_partner     TYPE bu_partner,

            lv_credit_sgmt TYPE ukm_credit_sgmnt,

            lv_log_ref TYPE ukm_item_guid,

            lv_log_handle  TYPE balloghndl.

  CONSTANTS: c_va01  TYPE sytcode VALUE ‘VA01’,

                       c_va02  TYPE sytcode VALUE ‘VA02’.



  IF ( sy-tcode = c_va01 OR sy-tcode = c_va02 ).

    IF lv_mem_id IS NOT INITIAL.

      SPLIT lv_mem_id at ‘,’

         INTO lv_partner




      “Add SO# to the Credit Checking log

      MESSAGE S000(ukm_check) WITH ‘Sales Order Number: ‘ VBAK-VBELN

                              INTO lv_dummy.

      “Update the log for partner, segment and log reference imported

      CALL METHOD cl_ukm_log_gate=>add_message_credit_check


          i_partner           = lv_partner

          i_credit_sgmnt  = lv_credit_sgmt

          i_log_reference = lv_log_ref


          c_log_handle    = lv_log_handle.

      “Save the Logs

cl_ukm_log_gate=>save_logs( ).

    ENDIF. “IF lv_mem_id IS NOT INITIAL.

  ENDIF. “IF ( sy-tcode = ‘VA01’ OR sy-tcode = ‘VA02’ )


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Vipin Nagpal
      Vipin Nagpal

      Good one, i am having exactly same requirement.

      Author's profile photo Raj kumar
      Raj kumar
      Dear Gangadhar,
      We have implemented the provided logic, but unfortunately the code written in class “CL_UKM_CREDIT_CHECKER” method CHECK_ACCOUNT is not getting triggered due to which we are missing exporting parameters through the SAP ABAP keyword of “EXPORT”, but in program “MV45AFZZ” ABAP logic is getting triggered. But we are failing to export the data of above class and method due to which we are unable to fetch / import the data.
      Hence we were unable to populate sales order number in "UKM_LOGS_DISPLAY"
      Author's profile photo Ji Gang Zhang
      Ji Gang Zhang

      very helpful, thanks for sharing this.