Funtion modules for credit check:
SD_ORDER_CREDIT_CHECK–>for sales order
SM_ORDER_CREDIT_CHECK–>for service order/CRM
1.Take sales order for example, set breakpoint at SD_ORDER_CREDIT_CHECK->
Enter a new item or change item quantity(cost) to trigger a new check
When FM is hitted, search for the coding for specific check, for example static check
* static check
if no_check is initial.
if t691f-cmpaa eq true
( update eq true or
t691f-cecki eq true or
t691f-strea eq con_error ).
perform static_credit_check using update <<<<<<<<Set here
rc_check_a rc_check rc_warning
xvbak-kkber 1000 –>credit control area
xvbak-knkli 0000001050 –>credit account
2.When above BP is hit, F5 to enter the Form for static check
PERFORM CREDIT_EXPOSURE_GET is to get the exposure
T691F-STVAW and T691F-STVLW are the “open order” and “open delivery” field in OVA8
SCC_OPEN_ORDER –>open order value
SCC_OPEN_DELIVERY –>open delivery value
SCC_OPEN_INVOICE –>open invoice value
3.PERFORM CREDIT_DELTA_ORDER is to calculate the current sales order value
Set BP at the next line after this Form and Press F5 to enter this FORM->
CALL FUNCTION ‘MCV_STATISTICS_ORDER’ –>FM for statistics update for order
SET BP at subroutine->
Then search for PERFORM cmpre_calculate(saplvkmp)–>program for credit price calculation
4.After CREDIT_DELTA_ORDER is complete DELTA_OEIKW is filled with current sales order
value, it is added to SCC_OPEN_ORDER(open order value)
SCC_SUM_OPENS = SCC_SUM_OPENS + SCC_OPEN_DELIVERY
Open order, delivery and invoice value is summed up.
IF SCC_SUM_OPENS GT SAV_KNKK_KLIMK.
PERFORM MESSAGE_EXCEEDED_VALUE USING SCC_FLG_ORDER SCC_SUM_OPENS.
MOVE CON_RC_NOK TO SCC_RC.
Then it is compared with the credit limit maintained in FD32.
If the open value is large than credit limit, message is issued to inform user that the credit check failed.
The message type depends on setting in OVA8.