工艺路线清单

简介: *&---------------------------------------------------------------------**& Report  ZCA03_LIST*&*&----------------------------------...

*&---------------------------------------------------------------------*
*& Report  ZCA03_LIST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZCA03_LIST.
type-pools : slis.
types: slis_t_fieldcat_alv type slis_fieldcat_alv occurs 1.
data : g_events_t type slis_t_event,
       g_fieldcat_t type slis_t_fieldcat_alv.
data : g_layout_s type slis_layout_alv.
data: l_fieldcat_s type slis_fieldcat_alv.
define __field_tab.
  l_fieldcat_s-seltext_l = &1.
  l_fieldcat_s-seltext_m = &1.
  l_fieldcat_s-seltext_s = &1.
  l_fieldcat_s-ddictxt = ' '.
end-of-definition.

tables: mapl,makt,plko,plpo,crtx,crhd,plpod.
data: begin of itab occurs 0,
      matnr type mapl-matnr,"料号
      maktx type makt-maktx,"物料描述
      delkz type plko-delkz,"删除标记
      werks type plko-werks,"工厂
      vornr type plpo-vornr,"工序
      arbid type plpo-arbid,"OBJECTID
      arbpl type crhd-arbpl,"工作中心
      ktext type crtx-ktext,
"工作中心描述(CRHD-ARBPL找到OBJID,通过OBJID和CRTX关联再找到工作中心描述
")
      ktsch type plpo-ktsch,"标准文本
      vgw01  type plpo-vgw01,"准备时间
      vgw02 type plpo-vgw02,"机器时间
      vgw03 type plpo-vgw03,"工时
       vgw04 type plpo-vgw04,"工时

      splim type plpo-splim,"分解数
      andat type mapl-andat,"创建时间
      aedat type plko-aedat,"最后更改时间
      plnnr type mapl-plnnr,"组
      end of itab.


selection-screen begin of block b1 with frame. title text-001.
select-options w_matnr for mapl-matnr.
select-options w_werks for mapl-werks.
selection-screen end of block b1.

selection-screen begin of block b2 with frame. title text-002.
select-options w_arbpl for plpod-arbpl.
selection-screen end of block b2.

selection-screen begin of block b3 with frame. title text-003.
select-options w_andat for mapl-andat.
select-options w_aedat for mapl-aedat.
selection-screen end of block b3.

 


initialization.
  perform. layout_init    using g_layout_s.    "ALV GRID LAYOUT
  perform. eventtab_build using g_events_t[].  "ALV GRID EVENT

start-of-selection.

  if not ( w_matnr is initial ) and not ( w_arbpl is initial ).
    message '同时只能选一个查询' type 'E'.
    leave program.
  endif.

  if not ( w_matnr is initial ) and (  ( not  w_andat is initial ) or  (
  not  w_aedat is initial ) ).
    message '同时只能选一个查询' type 'E'.
    leave program.
  endif.

  if not ( w_arbpl is initial ) and (  ( not  w_andat is initial ) or  (
  not  w_aedat is initial ) ).
    message '同时只能选一个查询' type 'E'.
    leave program.
  endif.

perform. get_data.
  if sy-subrc = 0.
    perform. displaycatalog_merge using g_fieldcat_t[] 'ITAB'.
    perform. alv_display tables itab[].
*    leave to screen 100.
  else.
    write: 'NO DATA'.
  endif.

 

form. get_data.
  data: i_crhd like  crhd occurs 0.
  if not ( w_matnr is initial ) or w_werks is not initial.
    select mapl~matnr makt~maktx plko~delkz plko~werks plpo~vornr
    plpo~arbid crhd~arbpl crtx~ktext plpo~ktsch plpo~vgw01 plpo~vgw02 plpo~vgw03 plpo~vgw04
           plpo~splim mapl~andat plko~aedat mapl~plnnr
           into  corresponding fields of table itab
      from mapl inner join plko "任务清单 - 表头
      on mapl~plnnr = plko~plnnr and mapl~zaehl = plko~zaehl AND mapl~werks = plko~werks
                inner join plpo "任务清单 - 工序/作业
                on mapl~plnnr = plpo~plnnr "AND mapl~zaehl = plpo~zaehl
                inner join crhd "工作中心表头
                on plpo~arbid = crhd~objid
                inner join crtx "工作中心或生产资源/工具文本
                on plpo~arbid = crtx~objid
                inner join makt on mapl~matnr = makt~matnr and makt~spras = sy-langu
     where mapl~matnr in w_matnr and mapl~werks in w_werks and  mapl~loEKZ eq space
      .
    exit.
  endif.

  if not ( w_arbpl is initial ).
*根据工作中心线获取PLPO~ARBID.
    select objid into corresponding fields of table i_crhd
    from crhd where arbpl in w_arbpl.

    if lines( i_crhd[] ) > 0 .
      select mapl~matnr makt~maktx
      plpo~splim
      plko~delkz plko~werks plpo~vornr
plpo~arbid crhd~arbpl crtx~ktext plpo~ktsch
      plpo~vgw01 plpo~vgw02 plpo~vgw03 plpo~vgw04 mapl~andat plko~aedat mapl~plnnr
      into  corresponding fields of table itab
      from plpo
      inner join plko on plpo~plnnr = plko~plnnr
    "  AND plpo~zaehl = plko~zaehl
      inner join mapl on plpo~plnnr = mapl~plnnr
      and mapl~zaehl = plpo~zaehl
      inner join crhd on plpo~arbid = crhd~objid
      inner join crtx on plpo~arbid = crtx~objid
      inner join makt on mapl~matnr = makt~matnr and makt~spras =
      sy-langu
      for all entries in i_crhd where plpo~arbid = i_crhd-objid  and mapl~werks in w_WERKS and mapl~LOEKZ eq space
      .
    endif.
    exit.
  endif.
  if ( not  w_andat is initial ) or  ( not  w_aedat is initial ).
    select mapl~matnr makt~maktx
plpo~splim
    plko~delkz plko~werks plpo~vornr
plpo~arbid crhd~arbpl crtx~ktext plpo~ktsch
      plpo~vgw01 plpo~vgw02 plpo~vgw03 plpo~vgw04 mapl~andat plko~aedat mapl~plnnr
      into  corresponding fields of table itab
      from mapl inner join plko on mapl~plnnr = plko~plnnr
    "  AND   mapl~zaehl = plko~zaehl
      inner join plpo on mapl~plnnr = plpo~plnnr
      and mapl~zaehl = plpo~zaehl
      inner join crhd on plpo~arbid = crhd~objid
      inner join crtx on plpo~arbid = crtx~objid
      inner join makt on mapl~matnr = makt~matnr and makt~spras =
      sy-langu
      where  mapl~werks in w_werks and mapl~andat in w_andat and  plko~aedat IN w_aedat and mapl~LOEKZ eq space
      .

    exit.
  endif.
endform.                    "GET_DATA


  form. displaycatalog_merge using p_g_fieldcat_t
                                type slis_t_fieldcat_alv
                                p_tabname.
  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'MATNR'.
  l_fieldcat_s-no_zero = 'X'.
  l_fieldcat_s-seltext_m = '料号'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'MAKTX'.
  l_fieldcat_s-seltext_m = '物料描述'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'WERKS'.
  l_fieldcat_s-seltext_m = '工厂'.
  append l_fieldcat_s to p_g_fieldcat_t.

 

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'VORNR'.
  l_fieldcat_s-seltext_m = '工序'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'KTSCH'.
  l_fieldcat_s-seltext_m = '标准文本码'.
*    l_fieldcat_s-outputlen = 20.
  append l_fieldcat_s to p_g_fieldcat_t.


  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'ARBPL'.
  l_fieldcat_s-seltext_m = '工作中心'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'KTEXT'.
  l_fieldcat_s-seltext_m = '工作中心描述'.
*    l_fieldcat_s-outputlen = 20.
  append l_fieldcat_s to p_g_fieldcat_t.

 

 


  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'VGW01'.
  l_fieldcat_s-seltext_m = '准备时间'.
  append l_fieldcat_s to p_g_fieldcat_t.


  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'VGW02'.
  l_fieldcat_s-seltext_m = '机器时间'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'VGW03'.
  l_fieldcat_s-seltext_m = '工时'.
  append l_fieldcat_s to p_g_fieldcat_t.


  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'VGW04'.
  l_fieldcat_s-seltext_m = '产能'.
  append l_fieldcat_s to p_g_fieldcat_t.


*  CLEAR l_fieldcat_s.
*  l_fieldcat_s-fieldname = 'SPLIM'.
*  l_fieldcat_s-seltext_m = '分解数'.
*
*  APPEND l_fieldcat_s TO p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'ANDAT'.
  l_fieldcat_s-seltext_m = '创建时间'.
  append l_fieldcat_s to p_g_fieldcat_t.

  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'AEDAT'.
  l_fieldcat_s-seltext_m = '最后更改时间'.
  append l_fieldcat_s to p_g_fieldcat_t.


  clear l_fieldcat_s.
  l_fieldcat_s-fieldname = 'PLNNR'.
  l_fieldcat_s-seltext_m = '组'.
  append l_fieldcat_s to p_g_fieldcat_t.

 

endform.  " FIELDCATALOG_MERGE
*&--------------------------------------------------------------------*
*&      Form  LAYOUT_INIT
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->P_G_LAYOUT_text
*---------------------------------------------------------------------*
form. layout_init using p_g_layout_s type slis_layout_alv.
** Build layout for list display
  p_g_layout_s-detail_popup = 'X'.
  p_g_layout_s-colwidth_optimize = 'X'.
*  p_g_layout_s-no_vline = 'X'.

endform.  " LAYOUT_INIT
*--------------------------------------------------------------------
*       FORM. EVENTTAB_BUILD
*--------------------------------------------------------------------
form. eventtab_build using  p_g_events_t  type slis_t_event.
** Registration of events to happen during list display
  data: l_event type slis_alv_event.
  call function 'REUSE_ALV_EVENTS_GET'
    exporting
      i_list_type = 0
    importing
      et_events   = p_g_events_t.
* GUI STATUS
  read table p_g_events_t with key name = slis_ev_pf_status_set
                          into l_event.
  if sy-subrc eq 0.
    move 'PF_STATUS_SET' to l_event-form.
    append l_event      to p_g_events_t.
  endif.
endform.  " EVENTTAB_BUILD
*--------------------------------------------------------------------
*       FORM. ALV_DISPLAY
*--------------------------------------------------------------------
form. alv_display tables p_int_t.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program = 'ZPP_R_012' "G_REPID
      is_layout          = g_layout_s
      it_fieldcat        = g_fieldcat_t[]
      i_save             = 'A'
    tables
      t_outtab           = p_int_t
    exceptions
      program_error      = 1
      others             = 2.
endform.  " ALV_DISPLAY

目录
相关文章
|
6月前
|
自然语言处理 物联网 vr&ar
图像理解与生成统一模型——前沿模型架构理解
前言生成式多模态模型近年来一直是业界的研究热点。视觉语言模型(VLM)一直是多模态文本生成领域的核心路线,能够完成图像理解任务;扩散模型(Diffusion Model)则一直是图像和视频生成领域的核心方法。
1081 9
|
缓存 负载均衡 算法
有哪些方法可以提高硬件负载均衡设备的性能?
有哪些方法可以提高硬件负载均衡设备的性能?
437 58
|
安全 小程序 Java
weixin027校园二手平台的设计与实现+ssm(文档+源码)_kaic
本项目基于微信小程序开发校园二手交易平台,旨在解决大学生闲置物品交易问题。系统采用Java语言和MySQL数据库设计,支持用户浏览、收藏、评价商品及发布闲置物品。管理员可审核商品和用户信息,确保交易安全。系统具备在线搜索功能,方便用户查找商品,并提供实时沟通渠道,增强平台透明度和用户体验。该平台简化了二手交易流程,满足了大学生对便捷、高效交易的需求,具有重要的实际应用价值。
|
Ubuntu Linux Shell
Docker CE 镜像源站
Docker CE 镜像源站
247612 209
|
JavaScript
vant(一)基于picker单选组件自定义picker多选组件~
vant(一)基于picker单选组件自定义picker多选组件~
2346 0
|
架构师 数据可视化 测试技术
架构设计方法论和思维
架构设计方法论和思维
|
安全 API 网络安全
查询和开启3389端口方式总结
查询和开启3389端口方式总结
3235 0
|
传感器 芯片
基于51单片机的智能热水器STC89C52水位检测传感器DS18B20温度探头传感器
基于51单片机的智能热水器 由STC89C52单片机+水位检测传感器+DS18B20温度探头传感器+按键模块+继电器模块+报警及指示模块+LCD1602显示模块+电源构成。 具体功能: 1、LCD1602显示屏第一行显示温度及定时时间,第二行显示温度上限和下限值; 2、按键可以设置温度的上下限值及定时时间;定时时间到开始加热 3、用两个水位检测传感器检测水位:当水位下限传感器检测到有水时,继电器开始控制加水;当水位上限传感器检测到有水时,停止加水; 4、当温度低于设置的下限温度值时,继电器开始控制加热;当温度高于设置的上限温度值时,停止加热。
|
存储 C# 图形学
从零开始做一款Unity3D游戏<一>——亲自上手使用Unity(二)
从零开始做一款Unity3D游戏<一>——亲自上手使用Unity
从零开始做一款Unity3D游戏<一>——亲自上手使用Unity(二)
|
安全 网络协议 网络安全
什么是网闸?
什么是网闸?
2571 0

热门文章

最新文章