Skip to main content

Posts

Showing posts from 2024

Identify the line number where an exception was thrown

To identify the line number where an exception was thrown in PL/SQL, you can use the  DBMS_UTILITY.FORMAT_ERROR_BACKTRACE  function. This function provides a backtrace that includes the line number(s) in the PL/SQL block, procedure, or function where the error occurred, making it easier to pinpoint the location of the problem. EXCEPTION WHEN OTHERS THEN  DBMS_OUTPUT.PUT_LINE('Error Message: ' || SQLERRM);  END; Output: ORA-06502: PL/SQL: numeric or value error: character string buffer too small The above Example will throw the Erro r "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" but we cannot find which line causing the issue without debugging the entire program. Here We can use DBMS_UTILITY.FORMAT_ERROR_BACKTRACE to identify the line number of the code which causing the issue. EXCEPTION WHEN OTHERS THEN...

Applying AR Credit Memo to AR Invoice using AR_CM_API_PUB.APPLY_ON_ACCOUNT

  In Oracle Apps R12, the process of applying on-account credits to customer invoices can be complex. Oracle provides the AR_CM_API_PUB.APPLY_ON_ACCOUNT API to facilitate this process. This API is particularly useful when there is a need for programmatic application of credit memos (CM) to invoices. API: AR_CM_API_PUB.APPLY_ON_ACCOUNT API Staging Table Design: CREATE TABLE XX_AR_CM_STG (    TRANSACTION_ID      NUMBER,     OPERATING_UNIT    VARCHAR2(240),    ORG_ID    NUMBER,     CM_NUMBER           VARCHAR2(50),  -- Credit Memo Number    INVOICE_NUMBER      VARCHAR2(50),  -- Invoice Number    APPLIED_AMOUNT      NUMBER,  -- Amount to be applied    APPLIED_DATE    DATE,    CT_REFERENCE    VARCHAR2(240),    CUSTOMER_NUMBER     VARC...

LDT Commands in Oracle Apps

 Oracle Applications (Oracle E-Business Suite) use Loader Data files (LDT files) for migrating application configurations and data between instances. What are LDT Files? LDT files are plain text files used by the FNDLOAD utility in Oracle E-Business Suite to upload or download data from the database. They are commonly used for migrating setups, such as concurrent programs, value sets, and lookups, across different environments. LDT Commands: 1.        Download Data to LDT File FNDLOAD apps/apps_pwd 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct output_file.ldt FND_PROGRAM APPLICATION_SHORT_NAME="Application_Short_Name" CONCURRENT_PROGRAM_NAME="Program_Name" 2.        Upload Data from LDT File FNDLOAD apps/apps_pwd 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct input_file.ldt Key Parameters apps/apps_pwd : The username and password for the Oracle Apps database. 0 Y...

How to Display Active URLs from XML Output in an RTF Template

  Adding Hyperlink (URL) to XML Publisher   When working with XML output, you might encounter fields that contain URL data. In many cases, it's not enough to simply display these URLs as plain text; you need to make them active links that users can click. Below will show you process of converting a URL field into an active hyperlink within an RTF (Rich Text Format) template, specifically for the field "CF_COURIER_URL". We the column name is " CF_COURIER_URL" which contains the active url. Create a form field in RTF for CF_COURIER_URL Edit the form field and use the below command   <?if@inlines: CF_COURIER_URL!='N/A'?><fo:basic-link external-destination="{.//CF_COURIER_URL}"   color="blue" text-decoration="underline">External Url</fo:basic-link><?end if?>   Output:

Query to Get Current Onhand Qty & Cost of Inventory Items

On-hand quantity represents the actual quantity of an item available in inventory at a specific location and point in time. SELECT     ood.organization_id,     ood.organization_code,     msi.inventory_item_id,     msi.segment1 item_code,     msi.description,     msi.primary_uom_code,     msi.creation_date item_creation_date,     nvl(SUM(moq.primary_transaction_quantity),0) onhand_qty,     (         SELECT             item_cost         FROM             cst_item_costs cst         WHERE                 cst.cost_type_id = 2             AND msi.inventory_item_id = cst.inventory_item_id             AND ood.organization_id = cst.organization_id     )        ...