Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7184752
  • 博文数量: 655
  • 博客积分: 10264
  • 博客等级: 上将
  • 技术积分: 8278
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-04 17:47
个人简介

ABAP顾问

文章分类

全部博文(655)

文章存档

2017年(2)

2014年(8)

2013年(3)

2012年(2)

2011年(18)

2010年(102)

2009年(137)

2008年(274)

2007年(134)

分类:

2009-02-26 14:36:06

REPORT  z_barry_test123.

TYPE-POOLS: slis.
TABLES mara.
DATA: gd_fieldcat TYPE slis_t_fieldcat_alv.
DATA: sla TYPE slis_layout_alv ,
      ivariant LIKE disvariant,
      i_repid LIKE sy-repid ,
      i_excluding TYPE slis_t_extab.

DATA:BEGIN OF itab OCCURS 0 ,
      objek LIKE ksskausp-objek ,
      klart LIKE ksskausp-klart ,
      atinn LIKE ksskausp-atinn ,
      class LIKE ewa_cawnksml-class ,
      atwrt LIKE ewa_cawnksml-atwrt ,
      atbez LIKE ewa_cawnksml-atbez ,
      atwtb LIKE ewa_cawnksml-atwtb ,
      spras LIKE ewa_cawnksml-spras ,
     END OF itab.

SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY.

START-OF-SELECTION.
  PERFORM getdata.
  PERFORM outdata.

*&---------------------------------------------------------------------*
*&      Form  getdata
*&---------------------------------------------------------------------*
FORM getdata.
  SELECT ksskausp~objek
         ksskausp~klart
         ksskausp~atinn
         ewa_cawnksml~class
         ewa_cawnksml~atbez
         ewa_cawnksml~atwrt
         ewa_cawnksml~atwtb
         ewa_cawnksml~spras
*         ewa_cawnksml~clint
    INTO CORRESPONDING FIELDS OF TABLE itab
  FROM ksskausp INNER JOIN ewa_cawnksml  ON
              ewa_cawnksml~atinn = ksskausp~atinn AND
              ewa_cawnksml~atwrt = ksskausp~atwrt AND
              ewa_cawnksml~clint = ksskausp~clint AND
              ewa_cawnksml~klart1 = ksskausp~klart
    WHERE ksskausp~objek IN s_matnr .

  LOOP AT itab.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input  = itab-objek
      IMPORTING
        output = itab-objek.
    MODIFY itab.
  ENDLOOP.
ENDFORM.                    "getdata

*&---------------------------------------------------------------------*
*&      Form  OUTDATA
*&---------------------------------------------------------------------*
FORM outdata .
  PERFORM fieldcat_init .
  sla-colwidth_optimize = 'X'.
  sla-zebra             = 'X'.
  i_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = i_repid
      it_fieldcat        = gd_fieldcat[]
      i_save             = 'A'
      is_variant         = ivariant
      is_layout          = sla
    TABLES
      t_outtab           = itab
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.

ENDFORM.                    " OUTDATA

*---------------------------------------------------------------------*
*       FORM fieldcat_init                                            *
*---------------------------------------------------------------------*
FORM fieldcat_init .
  PERFORM frm_catlg_set USING:   'OBJEK'  '物料' ,
                                 'KLART'  '类别种类' ,
                                 'CLASS'  '类别' ,
                                 'ATINN'  '内部特性' ,
                                 'ATBEZ'  '特性描述' ,
                                 'ATWRT'  '特性值' ,
                                 'ATWTB'  '特性值描述' ,
                                 'SPRAS'  '语言' .
ENDFORM.                    "fieldcat_init

*---------------------------------------------------------------------*
*       FORM frm_catlg_set                                            *
*---------------------------------------------------------------------*
FORM frm_catlg_set USING p_field
                         p_text.
  DATA: ls_fieldcat TYPE slis_fieldcat_alv.

  ls_fieldcat-fieldname     =  p_field.
  ls_fieldcat-seltext_l     =  p_text.

  APPEND ls_fieldcat TO gd_fieldcat .
  CLEAR ls_fieldcat .
ENDFORM.                    "frm_catlg_set

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

上一篇:换裤子

下一篇:更改物料的MRP区域数据

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