Quantcast
Channel: SCN : Popular Discussions - ABAP和Java开发 (ABAP & Java Development)
Viewing all articles
Browse latest Browse all 4604

BAPI - BAPI_INTERNALORDER_CREATE 中的自定义字段

$
0
0

各位好,

我现在需要通过BAPI BAPI_INTERNALORDER_CREATE来创建内部订单,之前我把AUFK表中的CI_AUFK中做了增强,增加一个自定义字段u201CZZTYPEu201D(4位字符),现在我想在BAPI创建订单的时候把ZZTYPE字段也填充,但测试多次皆发现无法实现,请不吝赐教!代码如下:

 

form create_io changing c_succeed type flag

                        c_order_id type aufnr.

  data: ls_master_i type bapi2075_7,

        ls_master_e type bapi2075_2,

        l_order_id type bapi2075_2-order,

        lt_rule type standard table of bapi2075_6 with header line initial size 0,

        lt_return type standard table of bapiret2 with header line initial size 0,

        lt_extension type standard table of bapiparex.

 

  clear c_succeed.

 

  ls_master_i-order_type = '0600'.

  ls_master_i-co_area = '1000'.

  ls_master_i-comp_code = '1000'.

  ls_master_i-bus_area = '1000'.

 

  perform get_extension using lt_extension.

 

  call function 'BAPI_INTERNALORDER_CREATE'

    exporting

      i_master_data = ls_master_i

    importing

      e_master_data = ls_master_e

      orderid       = l_order_id

    tables

      srules        = lt_rule

      return        = lt_return

      extensionin   = lt_extension.

 

  if sy-subrc eq 0.

    c_succeed = 'X'.

 

    loop at lt_return where type eq 'E'.

      c_succeed = ''.

      message lt_return-message type lt_return-type.

    endloop.

  endif.

 

  if c_succeed = 'X'.

    commit work.

    c_order_id = l_order_id.

  else.

    rollback work.

  endif.

endform.

 

 

 

 

form get_extension changing ct_extention like gt_extensionin.

  data: ls_ci_aufk type standard table of ci_aufk with header line.

  data: ls_extension type bapiparex,

        ls_bapi_te_aufk type bapi_te_aufk.

 

  clear ct_extention.

  clear ls_bapi_te_aufk-orderid.

 

  ls_ci_aufk-zztype = 'tes4'.

 

  move-corresponding ls_ci_aufk to ls_bapi_te_aufk.

 

  move 'BAPI_TE_AUFK' to ls_extension-structure.

  move ls_bapi_te_aufk to ls_extension-valuepart1.

 

  append ls_extension to ct_extention.

endform.


Viewing all articles
Browse latest Browse all 4604

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>