ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 维护物料主数据的bapi

维护物料主数据的bapi

原创 Linux操作系统 作者:AntiDesert 时间:2011-08-14 14:48:49 0 删除 编辑
1.BAPI_MATERIAL_SAVEDATA
使用该BAPI,除了可以导入物料主数据外,还可以对物料作删除标志。
 cldata-DEL_FLAG = 'X'.
 cldatax-DEL_FLAG = 'X'.
  call function 'BAPI_MATERIAL_SAVEDATA'
            exporting
              HEADDATA     = p_headdata
              CLIENTDATA   = cldata
              CLIENTDATAX  = cldatax
             importing
               return  = rtn.
2.'BAPI_MATINSPCTRL_SAVEREPLICA' for Quality view
根据检验类型,导入质量视图
 SELECT single * FROM TQ34
    INTO WA_TQ
    WHERE ART = P_QM-ART.
  bapi_qmat-INSPTYPE = p_qm-art.
  bapi_qmat-MATERIAL = p_qm-matnr.
  bapi_qmat-plant = p_qm-plant.
  bapi_qmat-IND_INSPTYPE_MAT_ACTIVE = 'X'.
  bapi_qmat-IND_INSP_WITH_TSK_LIST = wa_tq-PPL.
  bapi_qmat-IND_SPEC_MATSPEC = wa_tq-spezueber.
  bapi_qmat-IND_SPEC_CONFIG = wa_tq-conf.
  bapi_qmat-IND_SPEC_BATCH = wa_tq-TLS.
  bapi_qmat-IND_AUTO_ASSIGN = wa_tq-APP.
  bapi_qmat-IND_INSP_BY_CHARAC = wa_tq-MER.
  bapi_qmat-IND_POST_TO_INSP_STOCK = wa_tq-INSMK.
  bapi_qmat-IND_AUTOMATIC_UD = wa_tq-AVE.
  bapi_qmat-SAMPLING_PROCEDURE = wa_tq-STICHPRVER.
  bapi_qmat-DYN_MODIF_RULE = wa_tq-DYNREGEL.
  bapi_qmat-INSP_PERCENTAGE = wa_tq-SPROZ.
  bapi_qmat-IND_100_PERCENT_INSPECTION = wa_tq-HPZ.
  bapi_qmat-IND_SKIPS_ALLOWED = wa_tq-DYN.
  bapi_qmat-IND_MANUAL_SAMPLE = wa_tq-MPB.
  bapi_qmat-IND_MANUAL_SAMPLE_CALC = wa_tq-MST.
  bapi_qmat-IND_SINGLE_UNITS_POSSIBLE = wa_tq-EIN.
  bapi_qmat-AVE_INSP_DURATION = wa_tq-MPDAU.
  bapi_qmat-CONTR_INSP_LOT_CREATE = wa_tq-CHG.
  bapi_qmat-QUAL_SCORE_PROCEDURE = wa_tq-QKZVERF.
  bapi_qmat-ALLOWED_SCRAP_SHARE = wa_tq-QPMAT.
  append bapi_qmat.

 call function 'BAPI_MATINSPCTRL_SAVEREPLICA'
    tables
       INSPECTIONCTRL = bapi_qmat
       RETURN = p_BAPIRET2.
3.CLMM_MAINTAIN_CLASSIFICATIONS for classification view
data:p_com like  COMW
 SELECT SINGLE kssk~klart class kssk~clint kssk~statu stdcl
            FROM inob
            inner join  kssk on inob~klart = kssk~klart and
                                inob~CUOBJ =  kssk~OBJEK
            inner join klah on kssk~clint = klah~clint
            into  corresponding  fields of wa_ac
            WHERE inob~KLART = '023'
            AND inob~OBJEK = mtnr.
append  wa_ac to t_ac.
call function 'CLMM_MAINTAIN_CLASSIFICATIONS'
   exporting
      CLASS_TYPE   = p_ac-klart   "类的种类
      OBJECT_TABLE = 'MARA'
      KEY_DATE     = SY-DATUM
   tables
      OBJECTS      = t_clobj[]
      CLASS_ALLOCS_SET = t_ac[]
      VALUATION_NEW    = p_com[]      “包含特性值
    exceptions
      VALUATION_MISSING = 1.
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26168649/viewspace-704816/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ABAP的SQL优化方案
请登录后发表评论 登录
全部评论

注册时间:2011-08-14

  • 博文量
    10
  • 访问量
    11345