Wednesday, September 23, 2015

Add customization to Invoice validation program In EBS

Sometime few clients come up with requirement of adding some customization to invoice validation process. Oracle allows that via hook  AP_CUSTOM_INV_VALIDATION_PKG.AP_Custom_Validation_Hook.

You can provide all the custom logic that you want the invoice validation program to perform and that should suffice clients requirement.

7 comments:

  1. Great post on customizing Invoice Validation.

    ReplyDelete
  2. Do you have any example code?

    ReplyDelete
  3. IT will be great if you can share a sample code.

    ReplyDelete
  4. Sure..
    PROCEDURE AP_Custom_Validation_Hook(
    P_Invoice_ID IN NUMBER,
    P_Calling_Sequence IN VARCHAR2) IS

    l_curr_calling_sequence VARCHAR2(2000);
    l_debug_info VARCHAR2(1000);
    l_debug_loc VARCHAR2(30);
    l_log_msg FND_LOG_MESSAGES.MESSAGE_TEXT%TYPE;

    BEGIN

    -- Update the calling sequence --

    l_debug_loc := 'AP_Custom_Validation_Hook';
    l_curr_calling_sequence := 'AP_CUSTOM_INV_VALIDATION_PKG.'||
    l_debug_loc||'<-'||
    p_calling_sequence;

    IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
    l_log_msg := 'Begin of procedure '|| l_debug_loc;
    FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||
    l_debug_loc, l_log_msg);
    END IF;

    XX_INV_VALIDATE_PROC.inv_validate_main( pi_invoice_id =>P_Invoice_ID
    ,po_err_msg =>l_log_msg);--Sid added

    IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL ) THEN
    l_log_msg := 'End of procedure '|| l_debug_loc;
    FND_LOG.STRING(G_LEVEL_PROCEDURE, G_MODULE_NAME||
    l_debug_loc, l_log_msg);
    END IF;

    ReplyDelete
    Replies
    1. Hi Sid,

      when you call xx_inv_validate_proc.inv_validate_main on ap custom validation hook can I add my business condition and insert a hold on invoice?
      Please let me know becaz I saw in Oracle community validation process take care of system hold if that's the case will my custom hold work ?
      Please let me know ASAP

      Delete
    2. Yes you can put Custom holds from there.

      Delete