Skip to Content
User Experience Insights
Author's profile photo Chen Feng

如何设置销售订单行项目自定义字段为必读字段

业务需求

对于手工录入的销售订单,有时销售员在系统录入时会遗漏一些重要的自定义字段,此时IT管理员需要系统对于这些自定义字段设定为必输字段。

系统实现

1. Web-Gui 应用控制,APP:创建销售订单VA01

销售订单行项目自定义字段BUsection:

使用自定义逻辑,销售项目字段属性。

注意:此自定义逻辑只能控制Web-Gui APP,不能控制Fiori APP。

参考代码如下,注意如果用售达方,需要添加前置0;对于自定义字段代码需全部大写

loop at field_properties assigning field-symbol(<fs_field_properties>).
if salesdocument-soldtoparty = ‘0013100001’.
if <fs_field_properties>-field_name = ‘YY1_BUSECTION_SDI’.
<fs_field_properties>-mandatory = ‘X’.
endif.
endif.
endloop.

系统效果

2. Fiori 应用控制,APP:创建销售订单

销售订单行项目自定义字段SD_ITEM_CHECK_XZH:

使用自定义逻辑,销售项目检查。

注意:即使设置了Error Message,但是订单依然可以保存,Error Message只是提示功能。

if salesdocument-soldtoparty = ‘0013100001’.
if salesdocumentitem_extension-yy1_sd_item_check_xzh_sdi = ‘ ‘.
append value #( messagetype = ‘E’ messagetext = ‘BU分类不能为空。’ ) to messages.
endif.
endif.

系统效果

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.