VA02修改销售订单拒绝原因的BAPI:BAPI_SALESORDER_CHANGE
*&---------------------------------------------------------------------*
*& Form rechazar
*&---------------------------------------------------------------------*
FORM rechazar .DATA: i_hdr TYPE bapisdh1,i_hdrx TYPE bapisdh1x,i_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,i_itm TYPE bapisditm OCCURS 0 WITH HEADER LINE,i_itmx TYPE bapisditmx OCCURS 0 WITH HEADER LINE.REFRESH: i_itm, i_itmx, i_ret.CLEAR: i_hdr, i_hdrx.i_hdr-sd_doc_cat = 'C'.i_hdrx-updateflag = 'U'.SELECT * FROM vbapWHERE vbeln = i_listado-vbeln.i_itm-itm_number = vbap-posnr.i_itm-reason_rej = 'Z1'.i_itmx-updateflag = 'U'.i_itmx-itm_number = vbap-posnr.i_itmx-reason_rej = 'X'.APPEND i_itm.APPEND i_itmx.ENDSELECT.CALL FUNCTION 'BAPI_SALESORDER_CHANGE'EXPORTINGsalesdocument = i_listado-vbelnorder_header_in = i_hdrorder_header_inx = i_hdrxbehave_when_error = 'P'TABLESreturn = i_retorder_item_in = i_itmorder_item_inx = i_itmx.ENDFORM. " rechazar