ABAP 关于通过使用BAPI创建销售订单(抬头信息中:含增强字段)

2020-11-30 10:02:35 浏览数 (1)

通过bapi函数创建销售订单,并更新增强字段

1,为构造增强字段(BAPE_VBAK,BAPE_VBAKX,VBAK,VBAKKOM,)

2,增强标准程序:将增强的字段赋给标准程序

(FV45KFAK -> FV45KFAK_VBAK_FUELLEN_VBAKKOM -> vbak_fuellen_vbakkom)

代码语言:javascript复制
ENHANCEMENT 1  ZSD_SAPFV45K.    "active version
* 创建销售订单时候,维护自定义字段
  IF US_VBAKKOM1-ZZZG IS NOT INITIAL.
    VBAK-ZZZG = US_VBAKKOM1-ZZZG.
*    VBAKX-ZZZG = US_VBAKKOMX1-ZZZG.
  ENDIF.
 ENDENHANCEMENT.

3,调用bapi函数

代码语言:javascript复制
  MOVE 'BAPE_VBAK' TO LWA_EXTENSIONIN-STRUCTURE.

  CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C
    EXPORTING
      IM_VALUE     = LWA_BAPE_VBAK
    IMPORTING
      EX_CONTAINER = LWA_EXTENSIONIN-VALUEPART1.

  APPEND LWA_EXTENSIONIN TO LT_EXTENSIONIN.

  CLEAR LWA_EXTENSIONIN.
  CLEAR LT_EXTENSIONIN.

  MOVE 'BAPE_VBAKX' TO LWA_EXTENSIONIN-STRUCTURE.
  MOVE LWA_BAPE_VBAKX TO LWA_EXTENSIONIN-VALUEPART1.
  APPEND LWA_EXTENSIONIN TO LT_EXTENSIONIN.
  CLEAR LT_EXTENSIONIN.
vba

0 人点赞