FUNCTION ZOA_35.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(IP_DATE) LIKE MARA-ERSDA
*" TABLES
*" GT_MARA STRUCTURE ZMARA
*"----------------------------------------------------------------------
SELECT
mara~MATNR "物料号
ERSDA "创建日期
ERNAM "创建对象的人员名称
LAEDA "上次更改的日期
AENAM "对象更改人员的名称
MTART "物料类型
MATKL "物料组
BISMT "旧物料号
MEINS "基本计量单位
MAKTX "物料描述(短文本)
MAKTG "有关匹配码的大写的物料描述
from mara
INNER JOIN makt on mara~matnr = makt~matnr "两表
INTO CORRESPONDING FIELDS OF TABLE GT_MARA
WHERE MTART = '1001'
AND ERNAM = '1006'
AND ERSDA < IP_DATE.
*data: BEGIN OF gt_mara occurs 0,
* mara like mara-MATNR,
* mara like mara-ERSDA ,
* mara like mara-ERNAM ,
* mara like mara-LAEDA,
* mara like mara-AENAM,
* mara like mara-MTART,
* mara like mara-MATKL,
* mara like mara-BISMT ,
* mara like mara-MEINS,
* makt like makt-MAKTX,
* makt like makt-MAKTG,
* end of gt_mara.
* select mara~matnr mara~ersda mara~ernam mara~laeda mara~aenam mara~mtart
* mara~matkl mara~bismt mara~meins makt~maktx makt~maktg
* INTO CORRESPONDING FIELDS OF TABLE GT_MARA
* from INNER JOIN makt on mara~matnr = makt~matnr
* WHERE MTART = '1001'
* AND ERNAM = '1006'
* AND ERSDA < IP_DATE.
ENDFUNCTION.