码迷,mamicode.com
首页 > 其他好文 > 详细

取未清PO逻辑

时间:2019-12-10 10:21:34      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:status   func   filter   审批   标识   lte   title   类别   tables   

技术图片

 

 技术图片

 

 注意这里的 GR qty 【   WEMNG】 和 Open Quantity 【OBMNG】

 技术图片

 

 

技术图片

 

 

*&---------------------------------------------------------------------*
*& Report  ZMM_GET_OPEN_PO                                             *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  zmm_get_open_po                         .

TYPE-POOLS: slis.
TABLES:ekko,ekpo,eket.
DATA:  gt_fcat TYPE slis_t_fieldcat_alv,
       g_layout      TYPE slis_layout_alv,
       wa_fcat TYPE slis_fieldcat_alv.
*PARAMETERS:i_werks LIKE eine-werks  OBLIGATORY   .
SELECT-OPTIONS: i_werks FOR ekpo-werks,
                i_ebeln FOR ekpo-ebeln,
                i_matnr FOR ekpo-matnr.
DATA:BEGIN OF tb_po OCCURS 0,
     ebeln TYPE ekpo-ebeln,
     ebelp TYPE ekpo-ebelp,
     pstyp TYPE ekpo-pstyp,
     loekz TYPE ekpo-loekz,
     txz01 TYPE ekpo-txz01,
     matnr TYPE ekpo-matnr,
     werks TYPE ekpo-werks,
     lgort TYPE ekpo-lgort,
     bednr TYPE ekpo-bednr,
     matkl TYPE ekpo-matkl,
     infnr TYPE ekpo-infnr,
     idnlf TYPE ekpo-idnlf,
     menge TYPE ekpo-menge,
     meins TYPE ekpo-meins,
     elikz TYPE ekpo-elikz,
     bsart TYPE ekko-bsart,
     lifnr TYPE ekko-lifnr,
     ernam TYPE ekko-ernam,
     aedat TYPE ekko-aedat,
     frggr TYPE ekko-frggr,
     frgsx TYPE ekko-frgsx,
     frgke TYPE ekko-frgke,
     wamng TYPE eket-wamng,
     flag(30),
   END OF tb_po.

SELECT      ekpo~ebeln
     ekpo~ebelp
     ekpo~loekz
     ekpo~pstyp
     ekpo~txz01
     ekpo~matnr
     ekpo~werks
     ekpo~lgort
     ekpo~bednr
     ekpo~matkl
     ekpo~infnr
     ekpo~idnlf
     ekpo~menge
     ekpo~meins
     ekpo~elikz
     ekko~bsart
     ekko~lifnr
     ekko~ernam
     ekko~aedat
     ekko~frggr
     ekko~frgsx
     ekko~frgke
     eket~wamng
 INTO CORRESPONDING FIELDS OF TABLE tb_po  FROM ekpo
 INNER JOIN ekko ON ekpo~ebeln = ekko~ebeln
 INNER JOIN eket ON ekpo~ebeln = eket~ebeln AND ekpo~ebelp = eket~ebelp
 WHERE ekpo~loekz EQ space
   AND ekpo~elikz EQ space
   AND ekpo~werks IN i_werks
   AND ekpo~matnr IN i_matnr
   AND ekpo~ebeln IN i_ebeln
   AND ekpo~bstyp = F
   AND ekko~bsart <> ZIO.

LOOP AT tb_po.


  IF tb_po-wamng = 0.
    tb_po-flag = 未交货.
  ELSE.
    IF tb_po-menge = tb_po-wamng.
      tb_po-flag = 已交货,需勾选交货完成.
    ELSE.
      IF tb_po-wamng < tb_po-menge .
        tb_po-flag = 部分交货.
      ENDIF.
    ENDIF.
  ENDIF.
  MODIFY tb_po.
  CLEAR tb_po.
ENDLOOP.


wa_fcat-fieldname = BSART.
wa_fcat-seltext_m = 凭证类型.
APPEND wa_fcat TO gt_fcat.

wa_fcat-fieldname = EBELN.
wa_fcat-seltext_m = PO号.
APPEND wa_fcat TO gt_fcat.

wa_fcat-fieldname = EBELP.
wa_fcat-seltext_m = PO项目号.
APPEND wa_fcat TO gt_fcat.

wa_fcat-fieldname = PSTYP.
wa_fcat-seltext_m = 类别.
APPEND wa_fcat TO gt_fcat.
*
*wa_fcat-fieldname = ‘LOEKZ‘.
*wa_fcat-seltext_m = ‘PO删除标识‘.
*APPEND wa_fcat TO gt_fcat.

wa_fcat-fieldname = TXZ01.
wa_fcat-seltext_m = 短文本.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = MATNR.
wa_fcat-seltext_m = 物料号.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = WERKS.
wa_fcat-seltext_m = 工厂.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = LGORT.
wa_fcat-seltext_m = 库存地点.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = BEDNR.
wa_fcat-seltext_m = 需求跟踪号.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = MATKL.
wa_fcat-seltext_m = 物料组.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = INFNR.
wa_fcat-seltext_m = 采购信息记录号.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = IDNLF.
wa_fcat-seltext_m = 供应商物料编号.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = MENGE.
wa_fcat-seltext_m = 采购订单数量.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = WAMNG.
wa_fcat-seltext_m = 交货数量.
APPEND wa_fcat TO gt_fcat.

wa_fcat-fieldname = MEINS.
wa_fcat-seltext_m = 订单单位.
APPEND wa_fcat TO gt_fcat.
*wa_fcat-fieldname = ‘ELIKZ‘.
*wa_fcat-seltext_m = ‘交货已完成‘.
*APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = LIFNR.
wa_fcat-seltext_m = 供应商.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = ERNAM.
wa_fcat-seltext_m = 人名.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = AEDAT.
wa_fcat-seltext_m = 创建日期.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = FLAG.
wa_fcat-seltext_m = 状态.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = FRGGR.
wa_fcat-seltext_m = 审批组.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = FRGSX.
wa_fcat-seltext_m = 批准策略.
APPEND wa_fcat TO gt_fcat.
wa_fcat-fieldname = FRGKE.
wa_fcat-seltext_m = 批准标识.
APPEND wa_fcat TO gt_fcat.

g_layout-colwidth_optimize = X.
g_layout-info_fieldname = COL_COLOR.
*  g_layout-coltab_fieldname = ‘COL_COLOR‘.
CALL FUNCTION REUSE_ALV_GRID_DISPLAY
 EXPORTING
*     I_INTERFACE_CHECK                 = ‘ ‘
*     I_BYPASSING_BUFFER                = ‘ ‘
*     I_BUFFER_ACTIVE                   = ‘ ‘
   i_callback_program                = sy-repid
*     I_CALLBACK_PF_STATUS_SET          = ‘ ‘
*     I_CALLBACK_USER_COMMAND           = ‘ ‘
*     I_CALLBACK_TOP_OF_PAGE            = ‘ ‘
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ‘ ‘
*     I_CALLBACK_HTML_END_OF_LIST       = ‘ ‘
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ‘ ‘
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
   is_layout                         = g_layout
   it_fieldcat                       = gt_fcat[]
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
*     IT_SORT                           =
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
*     I_DEFAULT                         = ‘X‘
   i_save                            = A
*     IS_VARIANT                        =
*     IT_EVENTS                         =
*     IT_EVENT_EXIT                     =
*     IS_PRINT                          =
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     I_HTML_HEIGHT_TOP                 =
*     I_HTML_HEIGHT_END                 =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
  TABLES
    t_outtab                          = tb_po
*   EXCEPTIONS
*     PROGRAM_ERROR                     = 1
*     OTHERS                            = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

 

取未清PO逻辑

标签:status   func   filter   审批   标识   lte   title   类别   tables   

原文地址:https://www.cnblogs.com/rainysblog/p/12015016.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!