SAP 销售订单创建修改 BAPI 的行项目增强字段

当增强字段过多时,创建或修改销售订单用如下 valuepart1,valuepart2的方式增强字段修改不成功。

*    CALL METHOD cl_abap_container_utilities=>fill_container_c
*      EXPORTING
*        im_value     = ls_zavbap
*      IMPORTING
*        ex_container = lv_string.
*
*    MOVE lv_string+0(240) TO ls_parex-valuepart1.
*    MOVE lv_string+240(240) TO ls_parex-valuepart2.
*    MOVE lv_string+480(240) TO ls_parex-valuepart3.
*    MOVE lv_string+720(240) TO ls_parex-valuepart4.
*    APPEND ls_parex TO lt_parex[].

以下是另一个方法:
步骤1:
将附加结构 BAPE_VBAPX、BAPE_VBAP、VBAPKOZ、VBAPKOZX 维护上自定义字段。
步骤2:
SAP 销售订单创建修改 BAPI 的行项目增强字段_第1张图片

      CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
        EXPORTING
          sales_header_in      = ls_headdata
          sales_header_inx     = ls_headdatax
        IMPORTING
          salesdocument_ex     = lv_vbeln
        TABLES
          return               = lt_return
          sales_items_in       = lt_item
          sales_items_inx      = lt_itemx
          sales_partners       = lt_parnr
          sales_schedules_in   = lt_schdl
          sales_schedules_inx  = lt_schdlx
          sales_conditions_in  = lt_condin
          sales_conditions_inx = lt_condinx
          extensionin          = lit_extensionin ."这里赋值增强字段值

你可能感兴趣的:(ABAP,SAP)