REPORT zscm_tax .
“从T007A T007S取得税务代码(共享表取数据)
TABLES: t007a,t007s.
DATA: BEGIN OF itab OCCURS 0,
spras LIKE t007s-spras,
mwskz LIKE t007a-mwskz,
text1 LIKE t007s-text1,
END OF itab.
DATA: BEGIN OF it_t007s OCCURS 0.
INCLUDE STRUCTURE t007s.
DATA: END OF it_t007s.
PERFORM gettaxcodedata.
*---------------------------------------------------------------------*
* FORM gettaxcodedata *
*---------------------------------------------------------------------*
FORM gettaxcodedata.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE itab
FROM t007a
WHERE t007a~kalsm = 'TAXCN'.
*T007S为共享表格,不可以使用INNER JOIN
CHECK NOT itab[] IS INITIAL.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE it_t007s
FROM t007s
FOR ALL ENTRIES IN itab
WHERE t007s~mwskz = itab-mwskz AND
t007s~kalsm = 'TAXCN' AND
t007s~spras IN ('1','E','M').
*('1','E','M')即t007s~spras = '1' or t007s~spras = 'E' or t007s~spras = 'M'
CLEAR itab.
REFRESH itab.
LOOP AT it_t007s.
MOVE-CORRESPONDING it_t007s TO itab.
APPEND itab.
ENDLOOP.
ENDFORM.
阅读(1478) | 评论(0) | 转发(0) |