ITPUB??ì3
新一届的微软MVP评选已经开始,欢迎各位推荐!
ITPUB论坛 » ERP二次开发 » 哪位做过BOM的数据导入(Data Conversion)

标题: [精华] 哪位做过BOM的数据导入(Data Conversion)
离线 ys_yansh
资深会员



精华贴数 0
个人空间 0
技术积分 1581 (1066)
社区积分 3 (20605)
注册日期 2004-12-3
论坛徽章:1
生肖徽章2007版:鼠     
      

发表于 2006-5-23 11:20 


QUOTE:
最初由 yqwd91 发布
按照你们的方法测试已经可以导入。
但是关于import详细的错误信息在那里可以看到??
求除1)request的log
        2)interface中的process_flag
以外的其它信息


在导入完成后的请求信息中,查看日志和诊断就可以找到了

后面就不知道你的意思了,说明白点(以外的其它信息)


__________________
我希望得到鱼,但更希望知道怎么做捕鱼的网
只看该作者    顶部
离线 yqwd91
永远是新手


精华贴数 0
个人空间 0
技术积分 150 (12100)
社区积分 0 (933389)
注册日期 2006-5-16
论坛徽章:0
      
      

发表于 2006-5-23 11:29 


QUOTE:
最初由 ys_yansh 发布

在导入完成后的请求信息中,查看日志和诊断就可以找到了

后面就不知道你的意思了,说明白点(以外的其它信息)


应该和前面的句子连起来读,意思是:
除了这两个地方外,还有其它的地方有相关的Error信息可以看吗??


__________________
学习,学习再学习
只看该作者    顶部
离线 hphubei
版主


精华贴数 14
个人空间 0
技术积分 25287 (38)
社区积分 41950 (19)
注册日期 2004-5-8
论坛徽章:8
      
      

发表于 2006-5-23 12:46 


QUOTE:
最初由 yqwd91 发布


应该和前面的句子连起来读,意思是:
除了这两个地方外,还有其它的地方有相关的Error信息可以看吗??


好像是没有了,就算有,也都是差不多的,为什么一定要其他地方的呢?


__________________
…………………………………………     用最少的悔恨面对过去     用最少的浪费面对现在     用最多的梦想面对未来…………………………………………
只看该作者    顶部
离线 yqwd91
永远是新手


精华贴数 0
个人空间 0
技术积分 150 (12100)
社区积分 0 (933389)
注册日期 2006-5-16
论坛徽章:0
      
      

发表于 2006-5-23 13:30 
基本要求:
现在需要定时(每半个小时)的从外围系统Import BOM信息到Oracle中。
如果每次run Request都去看Log太累了,而且不好找。
希望结果:
可以每次把详细的错误信息,写到一个log表中,以便以后追踪解决。
有没有办法把request中的Error log写到表里,或者是从其它途径获取详细的错误信息。
(interface表中的process_flag信息太简单了)


__________________
学习,学习再学习
只看该作者    顶部
离线 hphubei
版主


精华贴数 14
个人空间 0
技术积分 25287 (38)
社区积分 41950 (19)
注册日期 2004-5-8
论坛徽章:8
      
      

发表于 2006-5-23 14:22 


QUOTE:
最初由 yqwd91 发布
基本要求:
现在需要定时(每半个小时)的从外围系统Import BOM信息到Oracle中。
如果每次run Request都去看Log太累了,而且不好找。
希望结果:
可以每次把详细的错误信息,写到一个log表中,以便以后追踪解决。
有没有办法把request中的Error log写到表里,或者是从其它途径获取详细的错误信息。
(interface表中的process_flag信息太简单了)


有一个办法就是把这个Request最终调用的Package找出来,复制成自己客制的一个,然后修改里面的内容,增加的东西很少的,就是当出现错误的时候insert你自己客制的表,想要什么栏位都可以,然后新建成一个Request,这样就可以跑自己的Request了,二次开发,哈哈


__________________
…………………………………………     用最少的悔恨面对过去     用最少的浪费面对现在     用最多的梦想面对未来…………………………………………
只看该作者    顶部
离线 hphubei
版主


精华贴数 14
个人空间 0
技术积分 25287 (38)
社区积分 41950 (19)
注册日期 2004-5-8
论坛徽章:8
      
      

发表于 2006-5-23 14:22 
版主啊,这个帖子可以加精了吧?


__________________
…………………………………………     用最少的悔恨面对过去     用最少的浪费面对现在     用最多的梦想面对未来…………………………………………
只看该作者    顶部
离线 ghita
资深会员



精华贴数 0
个人空间 0
技术积分 920 (2035)
社区积分 0 (542694)
注册日期 2005-8-2
论坛徽章:1
      
      

发表于 2006-5-23 14:26 
雖然我們在導入時系統的log及相應的table中會記錄我們的error信息并把不能導入的記錄放在interface中﹐但建議在bom or item or routing 導入前做一個check﹐把CHECK正確的Data才INSERT到Interface中﹐這樣會減少你的工作量。我導過N次基礎資料﹐都是把資料導入到臨時表﹐在臨時表內進行check﹐把check后的數據導入到interface中。


只看该作者    顶部
离线 Harry_shan
跟着ORACLE走


精华贴数 11
个人空间 0
技术积分 21768 (42)
社区积分 11277 (138)
注册日期 2003-2-28
论坛徽章:59
现任管理团队成员2008北京奥运纪念徽章:跆拳道2008北京奥运纪念徽章:篮球2008北京奥运纪念徽章:蹦床2008北京奥运纪念徽章:击剑2008北京奥运纪念徽章:沙滩排球
2008北京奥运纪念徽章:花样游泳2008北京奥运纪念徽章:举重2008北京奥运纪念徽章:赛艇生肖徽章2007版:牛生肖徽章:牛 

发表于 2006-5-23 14:27 
不错,以后导入BOM可以做为参考


__________________
只看该作者    顶部
离线 hphubei
版主


精华贴数 14
个人空间 0
技术积分 25287 (38)
社区积分 41950 (19)
注册日期 2004-5-8
论坛徽章:8
      
      

发表于 2006-5-23 14:48 


QUOTE:
最初由 ghita 发布
雖然我們在導入時系統的log及相應的table中會記錄我們的error信息并把不能導入的記錄放在interface中﹐但建議在bom or item or routing 導入前做一個check﹐把CHECK正確的Data才INSERT到Interface中﹐這樣會減少你的工作量。我導過N次基礎資料﹐都是把資料導入到臨時表﹐在臨時表內進行check﹐把check后的數據導入到interface中。

这种做法的前提是在对BOM和Routing导入的过程比较熟悉,包括经常会出现那些错误和那些栏位会出问题,但是对于新手来说,就是要慢慢的积累经验的。

有哪位做过这个的可以把一些经常用到的Check调节列出来一下呢,后面我们就可以参考了,谢谢


__________________
…………………………………………     用最少的悔恨面对过去     用最少的浪费面对现在     用最多的梦想面对未来…………………………………………
只看该作者    顶部
离线 ghita
资深会员



精华贴数 0
个人空间 0
技术积分 920 (2035)
社区积分 0 (542694)
注册日期 2005-8-2
论坛徽章:1
      
      

发表于 2006-5-23 15:49 
在所有的導入中﹐item的導入是比較麻煩的﹐因為在導入后﹐還要手動更新它的catalog ,catalog
的更新比較復雜,下面是item check的語句
rem PL/SQL Developer Test Script

set feedback off
set autoprint off

rem Execute PL/SQL Block
/*******************************************\
Created by :Jerry
Created at :2005-07-26
\*******************************************/

declare
  cursor cu_item is

      ------------- 潰脤笭葩腔訧蹋 -----------------------
      
      select 'Item'   err_type
           ,  item_no err_item
           ,  count(*) err_number
           ,  'Exists move than 1 record(s)'   err_msg
        from aic_import_item_temp
      group by  item_no
      having  count(*)>1
      ;

     ----------- 潰脤炵苀笢羶衄膘蕾腔UOM--------------------------

   cursor cu_uom is
      select 'UOM'  err_type
           , primary_uom_code err_item
           , count(*)  err_number
           , 'This UOM is not created!'  err_msg
        from aic_import_item_temp  aic_table
       where not exists
             ( select 1
                 from Mtl_Units_Of_Measure_Tl  muom
                where muom.uom_code =aic_table.primary_uom_code            
             )
         group by primary_uom_code   
         ;


---------------   潰脤炵苀笢羶衄膘蕾腔catalog_group ------


  cursor cu_catalog_group is
      select 'Catalog Group'  err_type
           , item_catalog_group_name  err_item
           , count(*) err_number
           , 'This Catalog Group is not created !' err_msg
         from aic_import_item_temp        aic_table
        where item_catalog_group_id is null
          and item_catalog_group_name is not null
          group by item_catalog_group_name         
      
             ;

---------------   潰脤炵苀笢羶衄膘蕾腔template name ------
   cursor cu_item_template is
         
      select
             'Item Template'  Err_type
           , aic_table.template_name     err_item
           , count(*)                    err_number
           , 'This item template is not created!'  err_msg
         from aic_import_item_temp        aic_table
        where template_id is null
          and template_name is not null
         group by aic_table.template_name        
            ;

/*-----category_group Check*/
    cursor cu_category_group is
            
            select 'Catogory Group' err_type
                 , err_item         err_item
                 , count(*)         err_number
                 , 'Not exists this catogory group !' err_msg
              
              from (
                           select  category1_set_name err_item        
                             from  aic_import_item_temp aic_table
                            where  CATEGORY1_SET_ID is null
                               and CATEGORY1_SET_name is not null
                             union all
                          
                           select  category2_set_name err_item        
                             from  aic_import_item_temp aic_table
                            where  CATEGORY2_SET_ID is null
                               and CATEGORY2_SET_name is not null
                          
                             union all
                             
                           select  category3_set_name err_item        
                             from  aic_import_item_temp aic_table
                            where  CATEGORY3_SET_ID is null
                               and CATEGORY3_SET_name is not null
                          
                             union all
                          
                           select  category4_set_name err_item        
                             from  aic_import_item_temp aic_table
                            where  CATEGORY4_SET_ID is null
                               and CATEGORY4_SET_name is not null
                             union all
                             
                           select  category5_set_name err_item        
                             from  aic_import_item_temp aic_table
                            where  CATEGORY5_SET_ID is null
                               and CATEGORY5_SET_name is not null
                      )  catogory_list
             group by err_item                     
                      ;                             
                     
   


--------------- 潰脤炵苀笢羶衄膘蕾腔 categroy segment  --------------------
    cursor cu_category_seg is
           select 'Category segment'  err_type
               ,  err_item
               ,  count(*)            err_number
               ,  'Error category segment values !' err_msg
               
            from (         select category1_set_name||': '||category1_Seg1||'.'||category1_Seg2||'.'||category1_Seg3  err_item
                              from aic_import_item_temp aic_table
                            where category1_id is null
                              and category1_set_name is not null
                              
                         union
                          
                         select
                                category2_set_name||': '||category2_Seg1||'.'||category2_Seg2 err_item
                         from aic_import_item_temp aic_table
                            where category2_id is null
                              and category2_set_name is not null
                        
                         union
               
                          select category3_set_name||': '||category3_Seg1||'.'||category3_Seg2 err_item
                               from aic_import_item_temp aic_table
                             where category3_id is null
                               and category3_set_name is not null
              
                        union
                         select category4_set_name||': '||category4_Seg1||'.'||category4_Seg2 err_item
                              from aic_import_item_temp aic_table
                            where category4_id is null
                              and category4_set_name is not null
                        
                        union
                         select category5_set_name||': '||category5_Seg1||'.'||category5_Seg2 err_item
                              from aic_import_item_temp aic_table
                            where category5_id is null
                              and category5_set_name is not null
                        ) category_seg
              group by err_item                        
          ;
         
   -------------  Check buyer code -------  
   cursor cu_buyer is
        select 'Buyer'  err_type
             , buyer_code    err_item
             , count(*) err_number
             , 'Error buyer' err_msg
         from aic_import_item_temp aic_table
        where aic_table.buyer_id is null
          and aic_table.buyer_code is not null
         group by buyer_code
          ;
      
   -------------  Check planner code -------  
   cursor cu_planner is
        select 'Planner'  err_type
             , planner_code    err_item
             , count(*) err_number
             , 'Error planner' err_msg
         from aic_import_item_temp aic_table
        where aic_table.planner_id is null
          and aic_table.planner_code is not null
          group by planner_code
          ;
              


              
-------------- check  sales_account -----------
   cursor cu_Sale_acc is

        select 'Sale_acc'  err_type
             , sale_acc     err_item
             , count(*) err_number
             , 'Error Sale_acc' err_msg
         from aic_import_item_temp aic_table
        where aic_table.Sale_acc_id is null
          and aic_table.sale_acc  is not null
          group by sale_acc
          ;

         
   -------------------  show error message
    cursor cu_err is
      select distinct rpad(err_type,20,' ')||rpad(err_item,60,' ')||err_msg  err_msg
       from   aic_import_item_error;
      
              
            
begin
      ----------  replace cagalog_group_name  -----------
      update aic_import_item_temp
       set   item_catalog_group_name = replace(item_catalog_group_name,' ','')   ;   

      -----------------  update Primary UOM ----
       update  aic_import_item_temp aic_table
           set primary_UOM_code =UPPER(replace(aic_table.primary_uom_code,' ',''));
      
      ---------------  update CATALOG_GROUP_ID      -----------
      
      
       UPDATE  aic_import_ITEM_TEMP  TEMP_TABLE
       SET Item_Catalog_group_id =
        (
      select  mic.item_catalog_group_id
        from  MTL_ITEM_CATALOG_GROUPS   mic
        where mic.segment1=TEMP_TABLE.Item_Catalog_group_NAME
          and nvl(mic.inactive_date,sysdate+1)>sysdate  
        );

               
        ---------------  update template    ------------
         update aic_import_item_temp   aic_table
          set   template_id =(
                               select template_id
                                 from mtl_item_templates
                                where upper(template_name) = upper(aic_table.template_name)
                             )
         where  aic_table.template_name is not null;

      
      ---------------  update CATEGORY_SET_ID  and STRUCTURE ID     ---------------------   
        UPDATE aic_import_ITEM_TEMP TEMP_table
         SET   (CATEGORY1_SET_ID,STRUCTURE1_ID) =
         (
          SELECT distinct MCST.CATEGORY_SET_ID,MCSB.STRUCTURE_ID
            FROM MTL_CATEGORY_SETS_TL MCST,
                 MTL_CATEGORY_SETS_B  MCSB
           WHERE MCST.CATEGORY_SET_NAME =     temp_table.category1_set_name
             AND MCST.CATEGORY_SET_ID   = MCSB.CATEGORY_SET_ID
      
          )
          ;
              
            UPDATE aic_import_ITEM_TEMP TEMP_table
         SET   (CATEGORY2_SET_ID,STRUCTURE2_ID) =
         (
          SELECT distinct MCST.CATEGORY_SET_ID,MCSB.STRUCTURE_ID
            FROM MTL_CATEGORY_SETS_TL MCST,
                 MTL_CATEGORY_SETS_B  MCSB
           WHERE MCST.CATEGORY_SET_NAME =     temp_table.category2_set_name
             AND MCST.CATEGORY_SET_ID   = MCSB.CATEGORY_SET_ID
      
          )
      
          ;
            UPDATE aic_import_ITEM_TEMP TEMP_table
         SET   (CATEGORY3_SET_ID,STRUCTURE3_ID) =
         (
          SELECT distinct MCST.CATEGORY_SET_ID,MCSB.STRUCTURE_ID
            FROM MTL_CATEGORY_SETS_TL MCST,
                 MTL_CATEGORY_SETS_B  MCSB
           WHERE MCST.CATEGORY_SET_NAME =     temp_table.category3_set_name
             AND MCST.CATEGORY_SET_ID   = MCSB.CATEGORY_SET_ID
      
          )
          ;
            UPDATE aic_import_ITEM_TEMP TEMP_table
         SET   (CATEGORY4_SET_ID,STRUCTURE4_ID) =
         (
          SELECT distinct MCST.CATEGORY_SET_ID,MCSB.STRUCTURE_ID
            FROM MTL_CATEGORY_SETS_TL MCST,
                 MTL_CATEGORY_SETS_B  MCSB
           WHERE MCST.CATEGORY_SET_NAME =     temp_table.category4_set_name
             AND MCST.CATEGORY_SET_ID   = MCSB.CATEGORY_SET_ID
      
          )
          ;
            UPDATE aic_import_ITEM_TEMP TEMP_table
         SET   (CATEGORY5_SET_ID,STRUCTURE5_ID) =
         (
          SELECT distinct MCST.CATEGORY_SET_ID,MCSB.STRUCTURE_ID
            FROM MTL_CATEGORY_SETS_TL MCST,
                 MTL_CATEGORY_SETS_B  MCSB
           WHERE MCST.CATEGORY_SET_NAME =     temp_table.category5_set_name
             AND MCST.CATEGORY_SET_ID   = MCSB.CATEGORY_SET_ID
      
          )
          ;
      
         
      -------------------  update  category id  -----
        
      update  aic_import_item_temp aic_table
        set   category1_id =
               ( select  category_id
                   from  mtl_categories_b  mc  
                  where  aic_table.category1_seg1||'.'||aic_table.category1_seg2||'.'||aic_table.category1_seg3=mc.segment1||'.'||mc.segment2||'.'||mc.segment3
                    and  aic_table.structure1_id =mc.structure_id
                )
      ;
        
      update  aic_import_item_temp aic_table
        set   category2_id =
               ( select  category_id
                   from  mtl_categories_b  mc  
                  where  aic_table.category2_seg1||'.'||aic_table.category2_seg2||aic_table.category2_seg3=mc.segment1||'.'||mc.segment2||mc.segment3
                    and  aic_table.structure2_id =mc.structure_id
                )
      ;
        
      update  aic_import_item_temp aic_table
        set   category3_id =
               ( select  category_id
                   from  mtl_categories_b  mc  
                  where  aic_table.category3_seg1||'.'||aic_table.category3_seg2=mc.segment1||'.'||mc.segment2
                    and  aic_table.structure3_id =mc.structure_id
                )
      ;
      update  aic_import_item_temp aic_table
        set   category4_id =
               ( select  category_id
                   from  mtl_categories_b  mc  
                  where  aic_table.category4_seg1||'.'||aic_table.category4_seg2=mc.segment1||'.'||mc.segment2
                    and  aic_table.structure4_id =mc.structure_id
                )
      ;
      update  aic_import_item_temp aic_table
        set   category5_id =
               ( select  category_id
                   from  mtl_categories_b  mc  
                  where  aic_table.category5_seg1||'.'||aic_table.category5_seg2=mc.segment1||'.'||mc.segment2
                    and  aic_table.structure5_id =mc.structure_id
                );
      
       ---------  update buyer     ------------
       update aic_import_item_temp aic_table
         set  buyer_id =
               (
                 select agent_id
                   from  PO_AGENTS_v pa
                  where pa.agent_name = buyer_code
               );   
       ---------  update planner   ------------        
       update aic_import_item_temp aic_table
         set  planner_id =
               ( select 1
                   from mtl_planners mp
                      , aic_import_organization a
                  where mp.planner_code= aic_table.planner_code

                    and mp.organization_id=a.organization_id
                    and a.organization_code='TJ1'
                    
                  
               );   

      
       update aic_import_item_temp aic_table
         set  Sale_acc_id =
             (
                select gcc.code_combination_id
                  from gl_code_combinations  gcc
                 where  gcc.segment1 ||'.'||segment2   ||'.'||segment3 ||'.'||segment4||'.'||segment5 ||'.'||segment6 =aic_table.sale_acc
             );

   
      commit;
     -----------   check data  ---------------            
        delete from aic_import_item_error;
        for lr in cu_item loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;
        
        for lr in cu_uom loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;
        
        for lr in cu_catalog_group loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;
                  
        for lr in cu_item_template loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;

        for lr in cu_category_group loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;

        for lr in cu_category_seg loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;

        for lr in cu_buyer loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;
         for lr in cu_planner loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;

         for lr in cu_planner loop
           insert into aic_import_item_error (err_type, err_item,err_number, err_msg)
                       values (lr.err_type,lr.err_item,lr.err_number,lr.err_msg);
        end loop;

      


    commit;
    ---------------------- show  the error message ---------------------------------   
   
    dbms_output.put_line('Now list the error message.......');
    dbms_output.put_line(rpad('err_type',20,' ')||rpad('err_item',60,' ')||'err_msg');
    dbms_output.put_line(rpad('=',20,'=')||rpad('=',60,'=')||rpad('=',50,'='));
    for lr in cu_err loop
     dbms_output.put_line( lr.err_msg);
    end loop;        
    dbms_output.put_line('Error message is list OK.');

   
end;
/


只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问