cancel
Showing results for 
Search instead for 
Did you mean: 

User cancelled commerical invoice but forgot to excise invoice

Former Member
0 Kudos

Hi ,

Excise invoice cancellation process , sometime user cancelled the commerical invoice and forgot to cancelled the excise invoice and

this creating lot of differnce between G/l vs Excise register

My question is that .In case if user cancelled the commerical invoice is there anyway we cancel the auto Excise invoice Or

If user cancelled the excise invoice can we Auto cancel of commerical invoice

Please suggest me

we are reffering the report as J1IIEXCP to track the detail, but this is not so helpful

Accepted Solutions (1)

Accepted Solutions (1)

former_member220617
Contributor
0 Kudos

Dear Piwal ,

as per my knowledge It is not possible to cancel the excise invoice in normal process , once user canceled the commercial invoice . this will possible in debugging mode discuss with abaper .

you can put validation in billing userexit  that when user is trying to cancel the commercial invoice with out canceling the excise invoice it has to through the error that cancel the excise invoice first.

Regards,

C.B Reddy.

Answers (2)

Answers (2)

bsivasankarreddy_reddy
Active Contributor
0 Kudos

hi

when cancel the excise invoice automatically invoice cancel

include :MJ1IHF01

Form  COMMIT_WORK

if sy-tcode = 'J1IH' and v_trans_type = 'CEIV' .

   data: l_RDOC2 type J_1IEXCDTL-RDOC2.

   DATA : lt_return   TYPE TABLE OF bapireturn1,

          lt_success  TYPE TABLE OF bapivbrksuccess,

          lw_return   TYPE          bapireturn1.

    l_rdoc2 = j_1iexcdtl-rdoc2.

    if l_RDOC2 is not INITIAL.

   CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'

     EXPORTING

       billingdocument = l_RDOC2

       testrun         = ''"c_space " c_x

     TABLES

       return          = lt_return

       success         = lt_success.

       READ TABLE lt_return INTO lw_return WITH KEY type = 'E'.

   IF sy-subrc NE 0.

*       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' IN UPDATE TASK.

   else.

     CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

   endif.

   endif.

   endif.

Former Member
0 Kudos

Thanks Reddy

bsivasankarreddy_reddy
Active Contributor
0 Kudos

hi

when you can the invoice its allow only after cancel the excise invoice

just write logic like below

include: ZXV60AU01

DATA : w_j_1iexchdr TYPE j_1iexchdr,
w_vbak      
TYPE vbak,
w_xkomfk    
TYPE komfk,
l_text
(60) TYPE c.
IF sy-tcode = 'VF11' OR sy-tcode = 'VF02'.
LOOP AT xkomfk INTO w_xkomfk.
SELECT SINGLE * FROM j_1iexchdr INTO w_j_1iexchdr WHERE trntyp = 'DLFC' AND  rdoc = w_xkomfk-vbeln AND ( status NE 'D' AND status NE 'R' ).
IF sy-subrc IS INITIAL.
CONCATENATE 'Cancellation not possible while Excise Inv exist' w_j_1iexchdr-exnum INTO l_text SEPARATED BY space.
MESSAGE l_text TYPE 'E'.
ENDIF.
ENDLOOP.
ENDIF.