TCODE 

MR8M

DEMO:MR8M取消发票校验凭证BAPI_INCOMINGINVOICE_CANCEL_小程序


DEMO

DEMO:MR8M取消发票校验凭证BAPI_INCOMINGINVOICE_CANCEL_微信_02

DEMO:MR8M取消发票校验凭证BAPI_INCOMINGINVOICE_CANCEL_微信_03

DEMO:MR8M取消发票校验凭证BAPI_INCOMINGINVOICE_CANCEL_微信_04

REPORT  zlm_mr8m.

PARAMETERS p_inv  LIKE  bapi_incinv_fld-inv_doc_no.

DATA lv_invoicedocnumber_reversal LIKE  bapi_incinv_fld-inv_doc_no.

DATA  lt_return LIKE TABLE OF  bapiret2.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CANCEL'

  EXPORTING

    invoicedocnumber                = p_inv

    fiscalyear                      = '2018'

    reasonreversal                  = '01'

*   POSTINGDATE                     =

 IMPORTING

   invoicedocnumber_reversal       = lv_invoicedocnumber_reversal

*   FISCALYEAR_REVERSAL             =

  TABLES

    return                          = lt_return.

.

READ TABLE lt_return TRANSPORTING NO FIELDS

  WITH KEY type = 'E'.

IF sy-subrc = 0.

  WRITE 'Error'.

ELSE.

  WRITE lv_invoicedocnumber_reversal.

  COMMIT WORK AND WAIT .

ENDIF.