SAP中XKO5冻结供应商(冻结所有与选择)
程序员文章站
2024-03-20 12:59:28
...
TCODE:XK05:
如果某供应商不允许发生采购业务或者付款业务,可以在系统里将该供应商冻结。系统提供了采购冻结和记账冻结两种冻结方式。选中了采购冻结,该供应商不允许建订单。选中了记账冻结,该供应商不允许预付款、发票校验和付款清帐。并且,可以选择冻结的范围,是所有公司代码和采购组织,还是特定的。Tcode:xk05
冻结分类:
若选中了冻结所有的公司代码,会修改表字段LFA1~SPERR值为’X”
若选中冻结选中的公司代码,会修改表字段LFB1~SPERR值为’X”
若选中了冻结所有的采购组织,会修改表字段LFA1~SPERM值为’X”
若选中冻结选中的采购组织,会修改表字段LFM1~SPERR值为&rsq……
实例说明:
DATA: lt_xlfas TYPE TABLE OF flfas,
lt_xlfb5 TYPE TABLE OF flfb5,
lt_xlfbk TYPE TABLE OF flfbk,
lt_xlfza TYPE TABLE OF flfza.
DATA: l_lfb1 LIKE lfb1,
l_ylfb1 TYPE lfb1,
l_lfa1 TYPE lfa1,
l_ylfa1 TYPE lfa1,
l_lfm1 TYPE lfm1.
CLEAR :lt_xlfas,lt_xlfb5,lt_xlfbk, lt_xlfza,l_lfb1,l_ylfb1,l_lfa1,l_ylfa1,l_lfm1.
DATA: t_bukrs LIKE zmmsrmvmd-bukrs,
t_lifnr LIKE zmmsrmvmd-lifnr.
t_bukrs = '1000'.
t_lifnr = '0BP'.
CALL FUNCTION 'VENDOR_READ'
EXPORTING
i_bukrs = t_bukrs
i_lifnr = t_lifnr
IMPORTING
e_lfa1 = l_lfa1
* E_LFB1 =
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
l_lfa1-sperm = 'X'. "所有采购组织冻结
IF l_lfa1 IS NOT INITIAL.
CALL FUNCTION 'VENDOR_UPDATE' IN UPDATE TASK
EXPORTING
i_lfa1 = l_lfa1
i_lfm1 = l_lfm1
i_ylfa1 = l_ylfa1
i_ylfb1 = l_ylfb1
i_ylfm1 = l_lfm1
TABLES
t_xlfas = lt_xlfas
t_xlfb5 = lt_xlfb5
t_xlfbk = lt_xlfbk
t_xlfza = lt_xlfza
t_ylfas = lt_xlfas
t_ylfb5 = lt_xlfb5
t_ylfbk = lt_xlfbk
t_ylfza = lt_xlfza.
COMMIT WORK AND WAIT.
ENDIF.
下一篇: 3.创建并显示视图