BAPI_BATCH_CREATE有时候不会更新CUOBJ_BM字段。
如果想通过特征值AUSP-ATWRT反查批次值得时候会显得
乏力,而且不知道批次会不会出现问题。(期待大神解决原因)
如果用VB_CREATE_BATCH创建的话,则不存在这个问题,
经测有效。
*&---------------------------------------------------------------------*
*& Report ZTESTSQ
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ztestsq.
DATA:wa_mcha TYPE mcha.
DATA:it_batch TYPE TABLE OF clbatch.
DATA:lt_return TYPE TABLE OF bapiret2 WITH HEADER LINE.
wa_mcha-matnr = '000000000001000022'.
wa_mcha-werks = '2100'.
wa_mcha-charg = '0855AN01'.
CALL FUNCTION 'VB_CREATE_BATCH'
EXPORTING
ymcha = wa_mcha
* new_lgort = lgort
kzcla = '1'
xkcfc = 'X'
class = 'ZTF_BATCH'
IMPORTING
ymcha = wa_mcha
TABLES
char_of_batch = it_batch
return = lt_return.
READ TABLE lt_return WITH KEY type = 'E'.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.