8 Haziran 2022 Çarşamba

IFS İş Emri Kapatma / IFS Shop Order Close Code

 DECLARE
   attr_ VARCHAR2(32000);
   dummy varchar2(2000);
   dummy2 varchar2(2000);
   a_ VARCHAR2(32000) := ''; --p0
   b_ VARCHAR2(32000) := 'AAASX0AAFAABDyXAAE'; --p1
   c_ VARCHAR2(32000) := '20190905140741'; --p2
   d_ VARCHAR2(32000) := 'CLOSE_TOLERANCE'||chr(31)||'0'||chr(30)||'CLOSE_OPER'||chr(31)||'Evet'||chr(30)||'CLOSE_CODE'||chr(31)||'Manual Kapat'||chr(30)||'SIMPLIFIED_MATERIAL'||chr(31)||'Hayır'||chr(30)||'CLOSED_BY_SERVER'||chr(31)||'TRUE'||chr(30); --p3
BEGIN

 FOR rec_ IN 
  ( SELECT a.objid,a.objversion,a.contract,a.order_no,a.release_no,a.sequence_no,a.qty_on_order,a.qty_released,a.qty_complete
     FROM SHOP_ORD A
      WHERE
       a.contract='XXX'
       and a.state in ('Başlatıldı','Planlandı','Yayımlandı') 
       and to_date(a.earliest_start_date,'dd.mm.yyyy')<=to_date('01.01.2022','dd.mm.yyyy')
       AND a.qty_complete=0
       --A.QTY_COMPLETE>A.REVISED_QTY_DUE*0.97 
			 --AND a.order_no='1029'
        and a.order_no||'-'||a.release_no||'-'||a.sequence_no NOT IN  
               ( SELECT s.order_no||'-'||s.release_no||'-'||s.sequence_no
                         FROM Shop_Material_Assign s
                         WHERE s.qty_assigned>0) 
   )  LOOP  
     
	  BEGIN
      Client_SYS.Clear_Attr(attr_);  
      client_sys.Set_Item_Value('CLOSE_TOLERANCE','0',attr_);
      client_sys.Set_Item_Value('CLOSE_OPER','Evet',attr_);
      client_sys.Set_Item_Value('CLOSE_CODE','Manual Kapat',attr_);
      client_sys.Set_Item_Value('SIMPLIFIED_MATERIAL','Hayır',attr_);
      client_sys.Set_Item_Value('CLOSED_BY_SERVER','TRUE',attr_);
      b_:=rec_.objid;
      c_:=rec_.objversion;
          
      DBMS_OUTPUT.put_line(rec_.order_no||'-'||rec_.release_no||'-'||rec_.sequence_no); 
                    
      IFSAPP.Shop_Ord_API.Close__( a_ , b_ , c_ , attr_ , 'DO' );                
      --shop_ord_api.Close(dummy,dummy2,rec_.order_no,rec_.release_no,rec_.sequence_no,91,'Y');
     EXCEPTION
      WHEN OTHERS THEN NULL;
       DBMS_OUTPUT.put_line('Alınan Hata:' || sqlerrm);  
     END;
          
  END LOOP;
  
  
END;


Share:

PL/SQL Exception Hata Kontrollu Çalışmaya Devam Etme / PL/SQL Continue exection after error handled

PL/SQL Continue exception after error handled PL/SQL Exception hata yakalama kontrolü ile programın çalışmasına devam etmeyi sağlama
 DECLARE
        extension_already_exists  EXCEPTION;
        PRAGMA EXCEPTION_INIT(extension_already_exists, -20007);
        l_hidden_col_name  varchar2(32);
    BEGIN
        FOR t IN (  SELECT table_name, cast(extension as varchar2(200)) ext
                    FROM all_stat_extensions
                    WHERE owner='{{ prev_schema }}'
                      and droppable='YES'
                    ORDER BY 1
                 )
        LOOP
            BEGIN
                l_hidden_col_name := dbms_stats.create_extended_stats('{{ schema }}', t.table_name, t.ext);
            EXCEPTION
                WHEN extension_already_exists THEN NULL;   -- ignore exception and go to next loop iteration
            END;
        END LOOP;
    END;
Share:

6 Haziran 2022 Pazartesi

IFS Report Designer Connect To IFS

 IFS Report Designer Connect to IFS




Share:

Blog Arşivi