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.
- FSCM Credit Management setup should be in place
- Credit Checking steps should be implemented
- 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.
- Implicit Enhancement in the method CHECK_ACCOUNT of class “CL_UKM_CREDIT_CHECKER”.
DATA: lv_mem_id TYPE string.
CONCATENATE is_item-partner “Business Partner
is_item-credit_sgmnt “Credit Segment
l_log_handle “Log Handle
INTO lv_mem_id SEPARATED BY ‘,’.
EXPORT lv_mem_id = lv_mem_id TO MEMORY ID ‘ZLOGID’.
- 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’.
IMPORT lv_mem_id FROM MEMORY ID ‘ZLOGID’.
FREE MEMORY ID ‘ZLOGID’.
IF ( sy-tcode = c_va01 OR sy-tcode = c_va02 ).
IF lv_mem_id IS NOT INITIAL.
SPLIT lv_mem_id at ‘,’
“Add SO# to the Credit Checking log
MESSAGE S000(ukm_check) WITH ‘Sales Order Number: ‘ VBAK-VBELN
“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
ENDIF. “IF lv_mem_id IS NOT INITIAL.
ENDIF. “IF ( sy-tcode = ‘VA01’ OR sy-tcode = ‘VA02’ )