更改销售订单配置

本文档详细描述了如何在SAP系统中更改销售订单配置的过程,包括配置合法性检查、更新配置、更新状态和创建头部文本等步骤。通过示例代码展示了如何执行这些操作,并在遇到错误时提供相应的错误处理策略。
摘要由CSDN通过智能技术生成

   这个事情,反映了自己做事情不够坚决,中间尝试了BAPI_SALESORDER_CHANGE,浪费了不少时间。

  既然可以同步了已经存在的配置,有配置但没有维护过的,应该也可以维护,可自己没有再深入一步。多走了许多弯  路。

  type-pools:ibco2.
  data:it_config_old type ibco2_instance_tab2,
       g_object      type cuib_business_object,
       g_cuobj       type vbap-cuobj.

 

 *& 检查配置的合法性,即当传入的特性,在系统里没有的直接报错
  perform configuration_validity_check tables cfg_list
                                       using it_config_old
                                             salesdocument
                                             ret_msg
                                             g_object
                                             g_cuobj.


*& update configuration.
  check ret_msg is initial.
  perform  update_configuration using  it_config_old
                                       g_cuobj
                                       g_object
                                       ret_msg .

*& update status
  check ret_msg is initial.
  if not status is initial.
    perform update_order_header_status using salesdocument
                                             status
                                             ret_msg.
  endif.
*& create header text.
  check ret_msg is initial.
  if not text[] is initial.
    perform create_order_header_text tables text
                                     using salesdocument
                                           ret_msg.

  endif.

  if ret_msg is initial.
    ret_msg-type = 'S'.
    ret_msg-message = '系统同步成功!'.

  endif.

 

 *&---------------------------------------------------------------------*
*&      Form  configuration_validity_check
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->T_CFG_LIST            text
*      -->CFG_OLD               text
*      -->P_VBELN               text
*      -->R_MSG                 text
*      -->CUIB_BUSINESS_OBJECT  text
*----------------------------------------------------------------------*
form configuration_validity_check tables t_cfg_list
                                   using  cfg_old type ibco2_instance_tab2
                                          p_vbeln
                                          r_msg   type bapiret2
                                          p_object type cuib_business_object
                                          p_cuobj.

  data:wa type ibvalue0,
       wa_config type  line of ibco2_instance_tab2 ,
       wa_ibco2  type ibco2_value_rec,
       g_object  type cuib_business_object,
       l_index   like sy-tabix,
       l_atinn_inner_format(10).
*& 注意应该修改,不 应该硬编码:特性不能指定内部形式
  loop at t_cfg_list into wa.

    if wa-atinn <> '0000002288' and
       wa-atinn <> '0000002291' and
       wa-atinn <> '0000002292' .
      r_msg-type = 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值