Segregating the US&UK templates using a procedure

CREATE OR REPLACE PROCEDURE APPS.AMETEK_PACKING_SLIP_PROC (errbuf OUT VARCHAR2, retcode OUT NUMBER,P_org_id IN  NUMBER,  warehouse IN VARCHAR2,delivery_name IN VARCHAR2, print_customer_item IN VARCHAR2, item_display_option IN VARCHAR2, print_mode IN VARCHAR2, print_all_option IN VARCHAR2, sort_option IN VARCHAR2, delivery_date_low IN DATE, delivery_date_high IN DATE, freight_carrier IN VARCHAR2, quantity_precision IN VARCHAR2, display_unshipped_item IN VARCHAR2)  AS
/*
   Create or replace procedure PACKING_SLIP_PROC  
   Purpose: This procedure picks the two different format of templates for the US and UK
  
   Modification history  

   Person       date            division      CR Number    comments
   ----------   -----------    -------------  ---------     -----------------------------------------
   Pavanchand   22-03-2012       new procedure created -- Packing Slip
*/
l_set_layout_option BOOLEAN;
-- p_country VARCHAR2(100) := 'US';
-- l_org_id number := 108;
l_req_id NUMBER;


BEGIN
 IF P_org_id  = 108 -- p_country = 'US'
 THEN l_set_layout_option := Fnd_Request.add_layout('CUSTOM',PACKING_SLIP_REPORT_BI','en','US','PDF');
ELSE
l_set_layout_option := Fnd_Request.add_layout('CUSTOM',UK_PACKING_SLIP_BI','en','US','PDF');
END IF;
  IF l_set_layout_option THEN
Fnd_File.put_line(Fnd_File.LOG,'TRUE');
ELSE
Fnd_File.put_line(Fnd_File.LOG,'FALSE');
END IF;

  -- added GH 2011/12/01
  DECLARE
 
    l_printer fnd_concurrent_Requests.PRINTER%TYPE;
    l_copies  NUMBER;
  BEGIN 
    SELECT printer, number_of_copies
      INTO l_printer, l_copies
    FROM fnd_concurrent_Requests
    WHERE request_id = Fnd_Global.conc_request_id;
 
    l_set_layout_option := Fnd_Request.add_printer(l_printer,l_copies);
 
    Fnd_File.put_line(Fnd_File.LOG,'Set Printer/Copies to ' || l_printer || ' Copies:' || l_copies);
  EXCEPTION
    WHEN OTHERS THEN
      Fnd_File.put_line(Fnd_File.LOG,'Exception Setting Printer/Copies:' || SQLERRM);
  END;

l_req_id := Fnd_Request.SUBMIT_REQUEST(
             'CUSTOM',
             'PACKING_SLIP_REPORT_BI',
             'Packing Slip Report',
              NULL,
              FALSE,
              warehouse,
              delivery_name,
              print_customer_item,
              item_display_option,
              print_mode,
              print_all_option,
              sort_option,
              delivery_date_low,
              delivery_date_high,
              freight_carrier,
              quantity_precision,
              display_unshipped_item);
END PACKING_SLIP_PROC;

No comments:

Post a Comment

Oracle Application Story

Oracle Application Story :- ----------------------------- This article is design to explain what's all about the Ora...