• 需求朔源——MD_PEGGING_NODIALOG


    MD04供需状况:

    ①生产订单19084582和19090790的供给都是给安库需求使用

    ②生产订单20019995的供给是给订单200006134项目50使用

    ①CTYB0757-P1库存量满足第一笔EQ-101046-01-DE需求使用,也就是上图的生产订单19084582 (库存87 - 需求84  = 结余3)

    ②生产订单20025412的供给是给第二笔EQ-101046-01-DE需求使用,也就是上图的生产订单19090790(结余3 - 需求1428 + 供给11 = 结余-1414)

    ③生产订单20019183的1414个供给是给第二笔EQ-101046-01-DE需求使用,也就是上图的生产订单19090790 (结余-1414 + 供给1824 =  结余410 )

    ④生产订单20019183的410个供给是给第三笔EQ-101046-01-DE需求使用,也就是上图的生产订单20019995(结余410 - 需求1554 = 结余 -1144)

    ⑤生产订单20027828的供给是给第三笔EQ-101046-01-DE需求使用,也就是上图的生产订单20019995 (结余-1144 + 供给1150 = 结余6)

    代码:

    *&---------------------------------------------------------------------*
    *& Report ZPPRTEST4
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT ZPPRTEST4.
    
    TYPE-POOLS: slis.
    DATA: gs_layout TYPE slis_layout_alv,
              gt_fieldcat TYPE slis_t_fieldcat_alv,
              wa_fieldcat TYPE slis_fieldcat_alv.
    
    DATA: lt_mdrq TYPE TABLE OF mdrq,
          lt_mdrq_fc LIKE mdrq OCCURS 0 WITH HEADER LINE.
    
    CALL FUNCTION 'MD_PEGGING_NODIALOG'
      EXPORTING
        edelkz                      = 'FE' "MRP元素
        edelnr                      = '000020019183' "MRP元素號碼
        edelps                     = '000001'     "MRP 元素項目
        ematnr                      = 'CTYB0757-P1' "物料编号
        ewerks                      = '2000'  "工厂
        eberid                      = '2000'   "MRP范围
      TABLES
        imdrqx                      = lt_mdrq
     EXCEPTIONS
       error                       = 1
       no_requirements_found       = 2
       order_not_found             = 3
       OTHERS                      = 4.
    
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'LT_MDRQ_FC'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = gt_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    
    gs_layout-colwidth_optimize = 'X'.
    
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-repid
        is_layout                = gs_layout
        it_fieldcat              = gt_fieldcat[]
        i_save                   = 'A'
      TABLES
        t_outtab            =  lt_mdrq
      EXCEPTIONS
        program_error            = 1
        OTHERS                   = 2.

    效果:

  • 相关阅读:
    (转)用Ajax技术让IE Web Control Tree View实现大数据量读取
    您试图从目录中执行CGI、ISAPI 或其他可执行程序,但该目录不允许执行程序
    oracle数据库中ORA28000: the account is locked问题
    C#动态生成html页面
    oracle 用户权限解释
    HCPC2013校赛训练赛 2
    ZOJ2770 Burn the Linked Camp 差分约束
    POJ2570 Fiber Network 状态压缩+floyd
    ZOJ3088 Easter Holidays 最短路
    POJ1364 King 差分约束
  • 原文地址:https://www.cnblogs.com/StephenAmell/p/13045319.html
Copyright © 2020-2023  润新知