REPORT zzwastor .
TABLES: mkpf, imkpf, emkpf, likp.
DATA: BEGIN OF xmesg OCCURS 0.
INCLUDE STRUCTURE mesg.
DATA: END OF xmesg.
* Selection-screen
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-001.
PARAMETERS : p_vbeln LIKE likp-vbeln OBLIGATORY.
SELECTION-SCREEN : END OF BLOCK blk.
START-OF-SELECTION.
* Reverse the goods issue
PERFORM reverse_goodsissue.
*&---------------------------------------------------------------------*
*& Form reverse_goodsissue
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM reverse_goodsissue .
* Local Variable
DATA : lv_vbtyp LIKE likp-vbtyp.
CLEAR :xmesg,
lv_vbtyp.
REFRESH : xmesg.
SELECT SINGLE vbtyp FROM likp INTO lv_vbtyp
WHERE vbeln = p_vbeln.
CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
EXPORTING
i_vbeln = p_vbeln
i_budat = sy-datum
* i_count = count
* i_mblnr = xlikpukwa-mblnr
i_tcode = 'VL09'
i_vbtyp = lv_vbtyp
TABLES
t_mesg = xmesg
EXCEPTIONS
error_reverse_goods_issue = 1
OTHERS = 2.
IF sy-subrc = 0.
COMMIT WORK AND WAIT.
MESSAGE '冲销成功!' TYPE 'S'.
ELSE.
MESSAGE '没有过账,无法冲销!' TYPE 'S'.
ENDIF.
ENDFORM. " reverse_goodsissue
阅读(5866) | 评论(0) | 转发(0) |