DBA Data[Home] [Help]

APPS.PO_CREATE_SR_ASL SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 53

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 118

   	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 147

  SELECT pl.po_line_id,
         pl.line_num,
         ph.start_date,
         ph.end_date,
         pl.item_id,
         ph.vendor_id,
         ph.vendor_site_id,
         DECODE(ph.approved_flag,'Y','APPROVED',null)
    FROM po_lines_all pl,
         po_headers_all ph
   WHERE pl.po_header_id = ph.po_header_id
     AND ph.po_header_id = x_header_id
     AND pl.item_id is not null
     AND nvl(pl.closed_code,'OPEN') <> 'FINALLY CLOSED'
     AND nvl(pl.cancel_flag,'N') = 'N'
     AND NOT EXISTS
         (SELECT 'Line included in Prior Revision'
            FROM po_lines_archive pla
           WHERE pla.po_line_id = pl.po_line_id
             AND pla.revision_num < ph.revision_num)
     AND pl.line_num > x_prev_line_num
   ORDER BY ph.po_header_id, pl.line_num;
Line: 172

  SELECT pl.po_line_id,
         pl.line_num,
         ph.start_date,
         ph.end_date,
         pl.item_id,
         ph.vendor_id,
         ph.vendor_site_id,
         DECODE(ph.approved_flag,'Y','APPROVED',null)
    FROM po_lines_all pl,
         po_headers_all ph
   WHERE pl.po_header_id = ph.po_header_id
     AND ph.po_header_id = x_header_id
     AND pl.item_id is not null
     AND nvl(pl.closed_code,'OPEN') <> 'FINALLY CLOSED'
     AND nvl(pl.cancel_flag,'N') = 'N'
     AND pl.line_num > x_prev_line_num
   ORDER BY ph.po_header_id, pl.line_num;
Line: 259

select vendor_site_id
from po_ga_org_assignments
where po_header_id = v_doc_id
and enabled_flag = 'Y';
Line: 268

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 293

         select global_agreement_flag,vendor_site_id
         into l_ga_flag , l_vendor_site_id
         from po_headers_all
         where po_header_id = l_document_id;
Line: 345

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 354

     	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 380

l_create_update_flag VARCHAR2(20);
Line: 385

l_update_sourcing_rule_flag varchar2(1);
Line: 391

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 422

	l_update_sourcing_rule_flag := wf_engine.GetItemAttrText(itemtype, itemkey, 'UPDATE_SOURCING_RULE');
Line: 425

		l_create_update_flag := 'CREATE';
Line: 428

	if l_update_sourcing_rule_flag = 'Y' then
		l_create_update_flag := 'CREATE_UPDATE';
Line: 435

    PO_SOURCING_RULES_SV.create_update_sourcing_rule(
          p_interface_header_id 	=> l_interface_header_id,
 	      p_interface_line_id 	    => l_interface_line_id,
          p_item_id               	=> l_item_id,
          p_vendor_id             	=> l_vendor_id,
          p_po_header_id          	=> l_document_id,
          p_po_line_id            	=> l_po_line_id,
          p_document_type         	=> l_document_type,
          p_approval_status       	=> l_approved_flag,
          p_rule_name             	=>l_rule_name,
          p_rule_name_prefix   	    =>l_rule_prefix,
          p_start_date    		    =>l_start_date,
          p_end_date              	=>l_end_date,
          p_create_update_code 	    => l_create_update_flag,
          p_organization_id     	=> l_sr_organization_id,
          p_assignment_type_id 	    => l_assignment_type_id,
          p_po_interface_error_code =>'ASR',
          x_header_processable_flag => l_header_processable_flag,
          x_return_status   	    =>l_return_status);
Line: 461

       PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 470

     	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 560

       p_update_sourcing_rule  IN  VARCHAR2,
       p_agreement_lines_selection IN VARCHAR2,
       p_sourcing_level        IN  VARCHAR2,
       p_inv_org               IN  HR_ALL_ORGANIZATION_UNITS.organization_id%type,
       p_sourcing_rule_name    IN  VARCHAR2,
       p_release_gen_method    IN  PO_ASL_ATTRIBUTES.release_generation_method%type,
       p_assignment_set_id     IN  MRP_ASSIGNMENT_SETS.assignment_set_id%type) IS

/* Local variables declared for Concurrent Program specific requirements */
l_archive_on_approve PO_DOCUMENT_TYPES_ALL.archive_external_revision_code%type;
Line: 589

l_create_update_flag VARCHAR2(20);
Line: 614

  SELECT pl.po_line_id,
--         pl.line_num,
         ph.start_date,
         ph.end_date,
         pl.item_id,
         DECODE(ph.approved_flag,'Y','APPROVED',null)
    FROM po_lines_all pl,
         po_headers_all ph
   WHERE pl.po_header_id = ph.po_header_id
     AND ph.po_header_id = p_document_id
     AND pl.item_id is not null
     AND nvl(pl.closed_code,'OPEN') <> 'FINALLY CLOSED'
     AND nvl(pl.cancel_flag,'N') = 'N'
/*     AND NOT EXISTS
         (SELECT 'Line included in Prior Revision'
            FROM po_lines_archive pla
           WHERE pla.po_line_id = pl.po_line_id
             AND pla.revision_num < ph.revision_num)*/
     AND pl.line_num > l_previous_line_num
	 AND NVL(pl.expiration_date ,sysdate+1) >= sysdate ---Bug 10022351,10192008
   ORDER BY ph.po_header_id, pl.line_num;
Line: 641

  SELECT pl.po_line_id,
--         pl.line_num,
         ph.start_date,
         ph.end_date,
         pl.item_id,
         DECODE(ph.approved_flag,'Y','APPROVED',null)
    FROM po_lines_all pl,
         po_headers_all ph
   WHERE pl.po_header_id = ph.po_header_id
     AND ph.po_header_id = p_document_id
     AND pl.item_id is not null
     AND nvl(pl.closed_code,'OPEN') <> 'FINALLY CLOSED'
     AND nvl(pl.cancel_flag,'N') = 'N'
	 AND NVL(pl.expiration_date ,sysdate+1) >= sysdate ---Bug 10022351,10192008
   ORDER BY ph.po_header_id, pl.line_num;
Line: 678

                PO_DEBUG.put_line(l_progress||' : Input Parameter : '||'p_update_sourcing_rule : '||p_update_sourcing_rule);
Line: 679

                PO_DEBUG.put_line(l_progress||' : Input Parameter : '||'p_agreement_lines_selection : '||p_agreement_lines_selection);
Line: 718

            SELECT archive_external_revision_code
            INTO l_archive_on_approve
            FROM po_document_types_all
            WHERE org_id=l_orgid
            AND document_type_code='PA'
            AND document_subtype='BLANKET';
Line: 764

            IF(p_agreement_lines_selection='NEW')THEN

                IF g_po_pdoi_write_to_file ='Y' THEN
                    l_progress :='005';
Line: 768

                    PO_DEBUG.put_line(l_progress||' : Agreement Lines Selection :'||p_agreement_lines_selection);
Line: 776

                    SELECT max(pola.line_num)
                    INTO l_previous_line_num
                    FROM
                           po_lines_archive_all pola,
                           po_headers_all poh
                    WHERE
                         poh.po_header_id=p_document_id
                    AND  pola.po_header_id=poh.po_header_id
                    AND  pola.revision_num < poh.revision_num ;
Line: 795

                    PO_DEBUG.put_line(l_progress||': Previous Line Number :'||p_agreement_lines_selection);
Line: 805

            IF p_agreement_lines_selection='NEW' THEN
               OPEN  get_new_lines_to_be_processed;
Line: 824

                l_create_update_flag := 'CREATE';
Line: 827

            IF p_update_sourcing_rule = 'Y' THEN
                l_create_update_flag := 'CREATE_UPDATE';
Line: 833

                    IF p_agreement_lines_selection='NEW' THEN
                       FETCH get_new_lines_to_be_processed
                       INTO l_po_line_id, l_start_date, l_end_date,
                            l_item_id, l_approved_flag;
Line: 873

                      p_create_update_code        =>  l_create_update_flag,
                      p_interface_error_code      =>  'PO_DOCS_OPEN_INTERFACE',
                      x_header_processable_flag   =>  l_header_processable_flag
                    );
Line: 884

             IF p_agreement_lines_selection='NEW' THEN
                CLOSE get_new_lines_to_be_processed;
Line: 904

          IF p_agreement_lines_selection='NEW' and get_new_lines_to_be_processed%isopen THEN
             CLOSE get_new_lines_to_be_processed;
Line: 1059

        p_create_update_code            IN      VARCHAR2,
        p_interface_error_code          IN      VARCHAR2,
        x_header_processable_flag       IN OUT NOCOPY VARCHAR2
 )IS
 l_document_id PO_HEADERS_ALL.po_header_id%type;
Line: 1077

    select vendor_site_id
    from po_ga_org_assignments
    where po_header_id = p_document_id
    and enabled_flag = 'Y';
Line: 1086

            PO_DEBUG.put_line(l_progress||'Calling procedure create_update_sourcing_rules ');
Line: 1095

     PO_SOURCING_RULES_SV.create_update_sourcing_rule(
          p_interface_header_id       =>  p_interface_header_id,
          p_interface_line_id         =>  p_interface_line_id,
          p_item_id                   =>  p_item_id,
          p_vendor_id                 =>  p_vendor_id,
          p_po_header_id              =>  p_document_id,
          p_po_line_id                =>  p_po_line_id,
          p_document_type             =>  p_document_type,
          p_approval_status           =>  p_approval_status,
          p_rule_name                 =>  p_rule_name,
          p_rule_name_prefix          =>  p_rule_name_prefix,
          p_start_date                =>  p_start_date,
          p_end_date                  =>  p_end_date,
          p_create_update_code        =>  p_create_update_code,
          p_organization_id           =>  p_inv_org_id,
          p_assignment_type_id        =>  l_assignment_type_id,
          p_po_interface_error_code   =>  p_interface_error_code,
          x_header_processable_flag   =>  x_header_processable_flag,
          x_return_status             =>  x_return_status,
    --
          p_assignment_set_id         =>  p_assignment_set_id,
          p_vendor_site_id            =>  p_vendor_site_id);
Line: 1138

           SELECT global_agreement_flag,vendor_site_id
           INTO l_ga_flag , l_vendor_site_id
           FROM po_headers_all
           WHERE po_header_id = p_document_id;
Line: 1260

         /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 1267

                        select vendor_id, vendor_site_id
                          into l_vendor_id, l_vendor_site_id
                                from po_headers_all
                                where po_header_id = l_document_id;
Line: 1282

               PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 1309

                                                                                                   ,'ALL'                                                            --        select agreement lines
                                                                                                   ,null                                                            --        assignment set
                                                                                                   ,null                                                            --        sourcing level
                                                                                                   ,null                                                            --  Inv org enable
                                                                                                   ,null                                                            --        inventory organization
                                                                                                   ,null                                                            --        sourcing rule name
                                                                                                   ,l_release_generation_method        --        Release generation method
                                                                                                   );
Line: 1320

               PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 1335

               PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);