Friday 26 July 2019

AutoInvoice: "Stuck in the Interface" issue: Interface line not created in AR/ Reprocess stuck records from AR Interface

Steps to reprocess the stuck records in ra_interface_lines_all

1. Make sure Auto Invoice program is not running
2. Clear the flags from ra_interface_lines_all

UPDATE ra_interface_lines_all
   SET interface_line_id = NULL,
       customer_trx_id = NULL,
       request_id = NULL,
       link_to_line_id = NULL,
       interface_status  = null
 WHERE NVL (interface_status, 'x') != 'P';

commit

3. Re-run AutoInvoice.

Refer below note for more details:
Troubleshooting AutoInvoice: "Stuck in the Interface" issues: Interface line not created in AR and no error is showing in the interface (Doc ID 1146573.1)

Tuesday 23 July 2019

Query to get on-hand quantity

   
The quantity on hand of an item at any particular control level and location can be
found by summing TRANSACTION_QUANTITY for all records that match the
criteria


 SELECT SUM (primary_transaction_quantity)
        FROM mtl_onhand_quantities_detail
       WHERE     inventory_item_id = p_inventory_item_id
             AND organization_id = p_organization_id
             AND subinventory_code = p_subinventory_code
             AND NVL (lot_number, '$') = NVL (p_lot_number, '$')
             AND revision = p_item_revision;

ra_customer_trx_lines_all Interface Line columns mapping for ORDER ENTRY Source



INTERFACE_LINE_ATTRIBUTE1 Order Number   OE_ORDER_HEADERS_ALL.ORDER_NUMBER
INTERFACE_LINE_ATTRIBUTE2 Order Type Order Type
INTERFACE_LINE_ATTRIBUTE3 Delivery Delivery
INTERFACE_LINE_ATTRIBUTE6 Line ID oe_order_lines_all.LINE_ID
INTERFACE_LINE_ATTRIBUTE7 Picking Line ID Picking Line ID
INTERFACE_LINE_ATTRIBUTE11 Price Adjustment ID oe_price_adjustments.PRICE_ADJUSTMENT_ID

Other columns can be viewed from DFF setup

Descriptive Flex Segments
  -- Query using -- Application > Receivables &  Title > Line Transaction Flexfield
    Go to context "Order Entry"

Cancel Line API Error ORA-01403: No Data Found in Package OE_ORDER_GRP Procedure Automatic_account_creation

Issue: Cancel Line API Error ORA-01403: No Data Found in Package OE_ORDER_GRP Procedure Automatic_account_creation

Steps: Used API oe_order_pub.process_order to Cancel Line with proper init commands but still got the error.

      oe_msg_pub.initialize;
      oe_debug_pub.initialize;
      mo_global.init ('ONT');
      mo_global.set_org_context (g_org_id, NULL, 'ONT');
      fnd_global.set_nls_context ('AMERICAN');
      mo_global.set_policy_context ('S', g_org_id);

In order for the API to work correctly, we need to set the org context and initialize  correctly.

Upon further investigation found that the ORG_ID passed to the script does not match with Order Org :D