Updating custom fields on VBAP OR VBAK using BAPI

编程入门 行业动态 更新时间:2024-10-10 12:23:02

Updating custom <a href=https://www.elefans.com/category/jswz/34/1729880.html style=fields on VBAP OR VBAK using BAPI"/>

Updating custom fields on VBAP OR VBAK using BAPI

转载自:

根据客制化字段不同的位置需要扩展如下类型:

更新抬头:VBAK, BAPE_VBAK, BAPE_VBAKX, VBAKKOZ and VBAKKOZX.

更新行项目:VBAP, BAPE_VBAP, BAPE_VBAPX, VBAPKOZ and VBAPKOZX.

1.Append one structure in BAPE_VBAK with the fields which need to be changed

 
  1. field.. dataelement... datatype.. length
  2. zz_disp .. zzdisp .. char .. 4

 

2 Append one structure in BAPE_VBAKX with the fields with one character fields.

 
  1. field.. dataelement... datatype.. length
  2. zz_disp .. char01... char.. 1

 

3.Append the same fields of the structure which was appended in the BAPE_VBAK to VBAKKOZ

 
  1. field.. dataelement... datatype.. length
  2. zz_disp .. zzdisp .. char .. 4

 

4.Append the same structure which was appended in the BAPE_VBAKX to VBAKKOZX.

 
  1. field.. dataelement... datatype.. length
  2. zz_disp .. char01... char.. 1

 

 

Now, check this program how to fill the EXTENSION parameter

Report ZTEST_NP.
parameters: p_vbeln like vbak-vbeln.start-of-selection.data: l_vbeln like BAPIVBELN-VBELN,l_inx   like BAPISDH1X.
data: it_ret like BAPIRET2 occurs 0 with header line,it_ext like BAPIPAREX occurs 0 with header line,is_hdr like BAPISDH1.l_inx-UPDATEFLAG = 'U'.
l_vbeln = p_vbeln.
* fill the table with values to be changed
it_ext-STRUCTURE = 'BAPE_VBAK'.      "Strcture with the fields
it_ext-VALUEPART1+0(10) = l_vbeln.
it_ext-valuepart1+11(4) = 'TEST'.          "<< My ZZ_DISP field
append it_ext.* mark the fields which you need to change
it_ext-STRUCTURE = 'BAPE_VBAKX'.     " Strcture with the flags
it_ext-VALUEPART1+0(10) = l_vbeln.
it_ext-VALUEPART1+10(1) = 'X'.
it_ext-VALUEPART1+11(1) = 'X'.
append it_ext.*it_ext-STRUCTURE = 'ZAVBAK'.     " Strcture with the flags
*it_ext-VALUEPART1+24(1) = 'T'.
*append it_ext.CALL FUNCTION 'BAPI_SALESORDER_CHANGE'EXPORTINGSALESDOCUMENT               = l_vbelnORDER_HEADER_INX            = l_inxTABLESRETURN                      = it_retEXTENSIONIN                 = it_ext.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'EXPORTINGWAIT          = 'X'.

 

 

 

更多推荐

Updating custom fields on VBAP OR VBAK using BAPI

本文发布于:2024-03-05 12:05:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1712247.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:fields   custom   Updating   BAPI   VBAK

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!