|
Data: i_hkont like bseg-hkont ,
i_swlx1(1),
i_msg(100),
i_setname like setleaf-setname .
*Tcode: KDH1制作好ZBCS开头的科目组进行有效性检查
select single setname into i_setname
from setleaf
where valfrom = bseg-hkont
* and setclass = ‘0109’表示KDH1的集合组
and setname like 'ZBCS%' .
check sy-subrc eq 0 .
i_msg = '' .
i_swlx1 = bseg-bewar+0(1).
case i_setname .
*资产减值类科目组事务类型必须是A开头,注意AM集成类科目
when 'ZBCS_ZCJZ'.
if i_swlx1 = 'A'.
b_result = b_true.
else.
*排除坏帐的清帐,被清项无法带事务类型
if bkpf-blart <> 'AB' .
b_result = b_false.
concatenate '资产减值类科目' bseg-hkont
'要求输入A开头的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
endif.
*应交税费类科目组事务类型必须是C开头
when 'ZBCS_YJSF' .
if i_swlx1 = 'C'.
b_result = b_true.
else.
b_result = b_false.
concatenate '应交税费类科目' bseg-hkont
'要求输入C开头的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
*长期借款类科目组事务类型必须是F开头
when 'ZBCS_CQJQ'.
if i_swlx1 = 'F'.
b_result = b_true.
else.
b_result = b_false.
concatenate '长期借款类科目' bseg-hkont
'要求输入F开头的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
*长期应付款科目组事务类型必须是G开头
when 'ZBCS_CQYF'.
if i_swlx1 = 'G'.
b_result = b_true.
else.
b_result = b_false.
concatenate '长期应付款科目' bseg-hkont
'要求输入G开头的的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
when 'ZBCS_DYSY'.
*递延收益类科目组事务类型必须是H开头
if i_swlx1 = 'H'.
b_result = b_true.
else.
b_result = b_false.
concatenate '递延收益类科目' bseg-hkont
'要求输入H开头的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
*职工薪酬类科目组事务类型必须是I开头
when 'ZBCS_ZGXC'.
if i_swlx1 = 'I'.
b_result = b_true.
else.
b_result = b_false.
concatenate '职工薪酬类科目' bseg-hkont
'要求输入I开头的业务类型!' into i_msg .
message e001(00) with i_msg .
endif.
*投资收益科目组贸易伙伴必输
when ‘ZBCS_TZSY’ .
if bseg-vbund eq space .
concatenate '投资收益' bseg-hkont
'贸易伙伴必输!' into i_msg .
message e001(00) with i_msg .
endif .
*更多的逻辑。。。
endcase .
|