Thursday, May 23, 2013

Concatenated Sales Order Line Number - Oracle Applications OrderManagement

Concatenated Sales Order Line Number in Oracle Applications Order Management

Wondering there should be an easy way to get the concatenated sales order line number in Oracle Applications Order Management? Tired of writing a concatenation logic with NVL/DECODE conditions? Here is the amazing solution.


Syntax:
SELECT oe_order_misc_pub.get_concat_line_number (<line_id>) so_line_number
  FROM DUAL


Example:

SELECT oe_order_misc_pub.get_concat_line_number (22366203) so_line_number
  FROM DUAL 



If you follow the traditional way here how it looks like


SELECT oola.line_number
             || '.'
             || oola.shipment_number
             || DECODE (oola.option_number, NULL, NULL, '.' || oola.option_number)
             || DECODE (oola.component_number,
                   NULL, NULL,
                   DECODE (oola.option_number, NULL, '.') || '.' || oola.component_number)
             || DECODE (oola.service_number,
                        NULL,
                        NULL,
                           DECODE (oola.option_number, NULL, '.')
                        || DECODE (oola.component_number, NULL, '.')
                        || '.'
                        || oola.service_number
                ) so_line_number
FROM oe_order_lines_all oola
WHERE oola.line_id = 22366203;



***Please leave a comment***

6 comments:

  1. Excellent ..... very useful function on OM processes....

    ReplyDelete
  2. Amazing.... I didn't know this all these years. Its so easy to use. Thank you Kiran.

    ReplyDelete
  3. || DECODE (oola.service_number,
    NULL,
    NULL,
    DECODE (oola.component_number, NULL, '.')
    || '.'

    Change to this

    ReplyDelete
    Replies
    1. Article has correct information and the query is correct. If changed as per this comment, a dot will be missed for Service Lines.

      Delete
  4. perfect sql to cover null values, Thanks a lot!

    ReplyDelete
  5. Thanks a lot! This is was very helpful.

    ReplyDelete

Please provide your valuable feedback which helps us to improve the content.