Chinaunix首页 | 论坛 | 博客
  • 博客访问: 688564
  • 博文数量: 194
  • 博客积分: 7067
  • 博客等级: 少将
  • 技术积分: 2008
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-09 14:48
个人简介

我很好

文章分类

全部博文(194)

文章存档

2019年(1)

2018年(1)

2017年(3)

2015年(2)

2012年(2)

2011年(1)

2010年(27)

2009年(15)

2008年(142)

分类: WINDOWS

2008-05-23 10:32:26

库存/需求清单(MD04)和MRP清单-物料(MD05)无论是输入和显示的内容都非常相像,它们的区别在于:MD04是动态的,实时显示库存/需求的变化情况;MD05是静态的,它仅仅显示对上一次MRP运行后的结果。

另外,为了防止新运行MRP时将原来旧的计划订单更改,可以将计划订单的“确定的”栏将计划订单钩上。(其后会显示一个*号)
 
MD_STOCK_REQUIREMENTS_LIST_API这个函数好象更有用,与MD04的数据是一致的
别人写的一段取md04中信息的程序:

REPORT ZCR_TEST .
*TABLES : TSTCT.
**
*
*DATA : BEGIN OF I_TSTCT OCCURS 0.
*INCLUDE STRUCTURE TSTCT.
*DATA : END OF I_TSTCT.
**
*DATA I_RESULT LIKE I_TSTCT OCCURS 0 WITH HEADER LINE.
*DATA : L_TTEXT LIKE TSTCT-TTEXT.
**
*PARAMETERS : PSTR LIKE TSTCT-TTEXT.
**
*START-OF-SELECTION.
*SELECT * FROM TSTCT INTO I_TSTCT
*WHERE SPRSL = 'EN'.
*APPEND I_TSTCT.
*ENDSELECT.
**
*CONCATENATE '*' PSTR '*' INTO PSTR.
*LOOP AT I_TSTCT .
*CLEAR L_TTEXT.
*MOVE I_TSTCT-TTEXT TO L_TTEXT.
*IF L_TTEXT CP PSTR .
*MOVE-CORRESPONDING I_TSTCT TO I_RESULT.
*APPEND I_RESULT.
*ENDIF.
*ENDLOOP.
**
*WRITE :/5 'Tran. code'.
*WRITE : 20 'Description'.
*SKIP 1.
*LOOP AT I_RESULT.
*WRITE :/5 I_RESULT-TCODE.
*WRITE : 20 I_RESULT-TTEXT.
*ENDLOOP.
*******************************************
TABLES:
        cm61w,                "MRP Control
        cm61m,                "MRP Control Indicator -Material Level-
        t399d,                "Control Parameters for MRP
        masel,               "Help fields for line selection
        mdkp,
        mtcom,
        mt61d,
        cm61x,
        t001w,
        mdst.                "Control string for stock

DATA: BEGIN OF i_mdpsx OCCURS 0.
        INCLUDE STRUCTURE mdps.
DATA: END OF i_mdpsx.
DATA:    BEGIN OF dummy OCCURS 0,
            dummy,
         END OF dummy.
 DATA: BEGIN OF i_mdsta OCCURS 1.
        INCLUDE STRUCTURE mdsta.
DATA: END   OF i_mdsta.

  SELECT SINGLE mdobj
                mdaty
                mdakt
           into cm61x
           FROM t450n
*           INTO (t450n-mdobj,t450n-mdaty,t450n-mdakt)
          WHERE tcode = 'MD04'.

*  IF sy-subrc = 0.
*    MOVE t450n-mdobj TO cm61x-plobj.
*    MOVE t450n-mdaty TO cm61x-plauf.
*    MOVE t450n-mdakt TO cm61x-plakt.
*    MOVE sy-datlo    TO cm61x-dispd.
*  ENDIF.
  SELECT SINGLE *
           FROM t001w
           INTO t001w
          WHERE werks = '2031'.

  SELECT SINGLE *
           FROM t399d
           INTO t399d
          WHERE werks = '2031'.

  MOVE t001w-fabkl TO cm61w-fabkl.
  MOVE t001w-fabkl TO cm61w-fabkl.
  MOVE t399d-umthz TO cm61w-umthz.
  MOVE cm61x-dispd TO cm61w-dispd.
  MOVE t399d-gterm TO cm61w-gterm.     "Hinweis 40847
*--> Welche Zug?nge gehen in Bestandsreichweite 2 ein ?
  MOVE t399d-selfe TO cm61w-selfe.
  MOVE t399d-selbe TO cm61w-selbe.
  MOVE t399d-selqm TO cm61w-selqm.
  MOVE t399d-selba TO cm61w-selba.
  MOVE t399d-selpa TO cm61w-selpa.
  MOVE t399d-selpz TO cm61w-selpz.
  MOVE t399d-selzr TO cm61w-selzr.
  MOVE t399d-sella TO cm61w-sella.

  MOVE 'MT61D'       TO mtcom-kenng.
  MOVE sy-langu      TO mtcom-spras.
  MOVE '000000000101000022'       TO mtcom-matnr.
  MOVE '2031'      TO mtcom-werks.

  CALL FUNCTION 'MATERIAL_LESEN'
    EXPORTING
      schluessel = mtcom
    IMPORTING
      matdaten   = mt61d
    TABLES
      seqmat01   = dummy.
   IF sy-subrc = 0.
   endif.

  CALL FUNCTION 'AUFBAUEN_MDPSX_ANZEIGEN'
    EXPORTING
      emt61d        = mt61d
      ecm61x        = cm61x
      ecm61w        = cm61w
      et399d        = t399d
*      ecm61b        = cm61b
*      esfilt        = sfilt
    IMPORTING
      imdkp         = mdkp
      imdsta        = i_mdsta
      icm61m        = cm61m
    TABLES
      mdpsx         = i_mdpsx
    EXCEPTIONS
      error_message = 01.
*   IF sy-subrc = 0.
*   endif.
    LOOP AT i_mdpsx.
      write : / i_mdpsx-MNG01.
    ENDLOOP. 

阅读(3075) | 评论(0) | 转发(0) |
0

上一篇:GR/IR

下一篇:几个用到的T-CODE说明

给主人留下些什么吧!~~