在表VBAP和VBAK上增加新字段的标准BAPI 
If you have custom ZZ fields on VBAP and VBAK then you can update these fields using the standard BAPI to create or change the order and update these fields.
A lot has been spoken about this but nowhere does it spell out the pitfalls and give you an end-to-end procedure on how to do it. I even found some "SAP Experts - Ask a question" on Search SAP give a complete wrong answer!!! So here is the correct way to do it.
--------------------------------------------------------------------------------
To do so you first need to ensure that the following 5 tables are in synch.
1) VBAP: In your append structure you specify your ZZFIELD with the data type as needed
2) BAPE_VBAP: In the append structure here also add the ZZFIELD with the data type as needed with limitations. No decimals. Try and stick to char characters
3) BAPE_VBAPX: In the append structure add the field ZZFIELD of type BAPIUPDATE
(NOTE: (2) and (3) must have the same number of fields in the same order)
4) VBAPKOZ: In the append structure here also add the ZZFIELD with the data type as needed with limitations. No decimals. Try and stick to char characters
5) VBAPKOZX: In the append structure add the field ZZFIELD of type BAPIUPDATE
(NOTE: (4) and (5) must have the same number of fields in the same order)
Similarly do for VBAK, BAPE_VBAK, BAPE_VBAKX, VBAKKOZ and VBAKKOZX.
Next we get to the code to fill in the structure EXTENSIONIN
I will demonstrate how to call the create sales order BAPI with custom fields.
* Local definitions
  DATA: wa_extensionin TYPE bapiparex,
        wa_bape_vbap   TYPE bape_vbap,
        wa_bape_vbapx  TYPE bape_vbapx,
        wa_bape_vbak   TYPE bape_vbak,
        wa_bape_vbakx  TYPE bape_vbakx,
        lv_posnr       TYPE posnr.
* Processing the header extension
  CLEAR wa_bape_vbak.
  wa_bape_vbak-ZZFIELD     = 'HDRTEST'.
  wa_extensionin-structure = 'BAPE_VBAK'.
  wa_extensionin+30(960)   = wa_bape_vbak.
  append wa_extensionin to lt_extensionin.
  clear wa_extensionin.
* Processing the line extension
LOOP AT line_items INTO wa_lineitems.
  ADD 10 TO lv_posnr.   
  CLEAR wa_bape_vbap.
  wa_bape_vbap-ZZFIELD     = 'TEST'.
  wa_extensionin-structure = 'BAPE_VBAP'.
  wa_bape_vbap-posnr       = lv_posnr.
  wa_extensionin+30(960)   = wa_bape_vbap.
  append wa_extensionin to lt_extensionin.
  clear wa_extensionin.
  CLEAR wa_bape_vbapx.
  wa_bape_vbapx-ZZFIELD    = 'X'.
  wa_extensionin-structure = 'BAPE_VBAPX'.
  wa_bape_vbapx-posnr      = lv_posnr.
  wa_extensionin+30(960)   = wa_bape_vbapx.
  append wa_extensionin to lt_extensionin.
  clear wa_extensionin.
ENDLOOP.
* Then the call to the BAPI
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in  = ls_order_header_in
          order_header_inx = ls_order_header_inx
        IMPORTING
          salesdocument    = lv_salesdocument
        TABLES
          return           = lt_ret2
          order_items_in   = lt_order_items_in
          order_items_inx  = lt_order_items_inx
          order_partners   = lt_order_partners
          order_keys       = lt_order_keys
          extensionin      = lt_extensionin.
Note: If you have a need to force a different Business Object type or wish to see the extension return fields then use the function SD_SALESDOCUMENT_CREATE instead.
      CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
        EXPORTING
          sales_header_in     = ls_order_header_in
          sales_header_inx    = ls_order_header_inx
          business_object     = 'BUS2032'
        IMPORTING
          salesdocument_ex    = lv_salesdocument
          sales_header_out    = lv_sales_header_out
          sales_header_status = lv_sales_header_status
        TABLES
          return              = lt_ret2
          sales_items_in      = lt_order_items_in
          sales_items_inx     = lt_order_items_inx
          sales_partners      = lt_order_partners
          sales_keys          = lt_order_keys
          extensionin         = lt_extensionin
          incomplete_log      = lt_incomplete_log
          extensionex         = lt_extensionex.

sap abap在表VBAP和VBAK上增加新字段的标准BAPI相关推荐

  1. 【转】ABAP在表VBAP和VBAK上增加新字段的标准BAPI

    [转载收藏] 在表VBAP和VBAK上增加新字段的标准BAPI 及实现方式: If you have custom ZZ fields on VBAP and VBAK then you can up ...

  2. 73. 如何手动通过增强的方式,给 SAP ABAP 数据库表增添新的字段

    有个朋友向我咨询关于 SAP 产品增强字段扩展(Field Extensibility) 的问题: Jerry,你好.看过你写的SAP产品增强Field Extensibility文章,对扩展字段在物 ...

  3. SAP abap内表分类与增删改查操作

    SAP abap内表分类与增删改查操作 1.内表的分类 1.1.标准表 (standard table ) 系统为该表每一行生成一个院级索引.填表是可以将数据附加在现有行之后,也可以插入到指定的位置, ...

  4. SAP ABAP 配置表开发常见问题总结与开发指南(SM30 SM34 SE54)

    SAP ABAP 配置表开发常见问题总结与开发指南(SM30 SM34 SE54) 引言: 需求开发时,我们经常会通过配置表实现配置/基础/主数据的维护,但企业实际应用中,开发的配置表经常存在种种问题 ...

  5. 使用Jackson忽略JSON对象上的新字段[复制]

    本文翻译自:Ignoring new fields on JSON objects using Jackson [duplicate] This question already has an ans ...

  6. anki模板_【授权转载】【Anki高级操作技巧】(19)-如何在模板上添加新字段

    如何在模版上添加新字段? 有些时候,我们需要为一些需要发音的是卡片添加音频,但是会碰到一个问题就是现有的字段已经填满了,没有字段再放置发音的字段,所以今天我们解决的问题就是如何为模版添加新的字段.第一 ...

  7. 如何在HP服务器上增加新的硬盘

    为了在HP服务器上增加新的硬盘,需要做两件事情:① 将新增硬盘挂到主板上: ② 在磁盘管理中,对新增的硬盘进行分区.那么我们下面介绍如何完成,上述两步. ① 将新增硬盘挂到主板上.插入新服务器硬盘,然 ...

  8. SAP ABAP 内表使用

    SAP里面主要有三处类型的内表:standard table,sorted table,hashed table 定义语法:TYPES|DATA itab {TYPE|LIKE} tabkind OF ...

  9. 【转载】SAP ABAP内表OCCURS,WORK AREA等 语法对比

    先来看看内表是什么东西.顾名思义内表是一张存在内存中的表.首先,它是由很多work area组成.所谓work area,说通俗一点即是表的一行,占用一定的内存空间.那么为什么要有内表存在呢?原因在于 ...

最新文章

  1. 【总结整理】JQuery基础学习---DOM篇
  2. python predict y和x是必须一致吗_数据科学python错误 - ValueError:x和y必须具有相同的第一维...
  3. mailcore(一)
  4. 论文浅尝 | 图神经网络的对抗攻击和防御相关文献集
  5. 消息队列之事务消息,RocketMQ 和 Kafka是如何做的?
  6. python在工业上的应用_工业+python - IT屋-程序员软件开发技术分享社区
  7. 一个成功企业家立下的22条规矩
  8. R语言使用aov函数建立单因素方差分析模型、使用TukeyHSD函数采用Tukey法对各组均值的差异进行成对检验、使用plot函数可视化TukeyHSD函数的事后分析的结果、并获得的95%置信区间
  9. 一场分销裂变活动,不止是发发朋友圈这么简单
  10. failed to req API:/nacos/v1/ns/instance after all servers([192.168.43.148:8848]) tried: ErrCode:503,
  11. vue+js input文本框输入时自动填充邮箱后缀组件封装
  12. POJ3322(bfs+状态限制)
  13. canvas实现黑客帝国效果
  14. [CodeForces877 E. Danil and a Part-time Job]dfs序+线段树
  15. NYOJ597 完数?
  16. Mac下Cisco Packet Tracer 7.2.2 汉化
  17. 案例分享 | 机场急救中心项目中BIM应用
  18. 很燃基于掘金量化平台的《Python量化交易实战》新书介
  19. 计算机应用工程是本科吗,计算机应用自考难度大吗?计算机应用自考本科考什么?...
  20. css3与页面布局-概要,选择器,特殊性,刻度单位

热门文章

  1. 蜻蜓FM战略项目经理程彤博:真实需求背后的供给关系
  2. 互联网公司败局汇总,这些公司都是怎么死的?(下篇)
  3. CSS-非常有用的css变量
  4. Wireshark 【OSI三层】抓包过滤规则和显示过滤规则实例
  5. MySQL 隐式类型转换导致条件等号的异常
  6. springboot日志笔记
  7. 聊聊spring security的permitAll以及webIgnore
  8. 移动H5开发入门知识,CSS的单位汇总与用法
  9. Docker从入门到实践笔记(一)
  10. PXE大批量安装Linux系统