cancel
Showing results for 
Search instead for 
Did you mean: 

Stop printing cancelled invoices..

Former Member
0 Kudos

Hi,

Some how the cancelled invoices are getting printed in the batch job. Can you please guide me on how to prevent this situation? Is there any place where we can check for the status of invoice whether it is cancelled or not?

Thank you,

Samay

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Samay

In the routine for the invoice output put a check like

if vbrk-fksto = 'X'.

Sy-subrc = 4.

Endif.

If vbrk-fksto = x then the invoice has been cancelled.

Hope this helps.

Thanks

Former Member
0 Kudos

I am agree with richard. Just one modifcation.

After Sy-Subrc=4 statement. Use exit statement to come out of block. else it will get modified further.

if vbrk-fksto = 'X'.

Sy-subrc = 4.

exit.

else.

Sy-subrc = 0.

Endif.

Is it right Richard ?

Note : Please reward all helpful answers.

Former Member
0 Kudos

Hi Geeta

Thanks for the correction.

Former Member
0 Kudos

HI -- I have a similar issue, however we do not want the cancelled billing document to print, rather we want it to be posted to accounting upon release and hence coded the routine.. We have these lines stated up there..

FORM KOBED_912.

*{ INSERT DRTK906112 1

*

if KOMKBV3-trtyp = 'L'.

sy-subrc = 4.

endif.

SY-SUBRC = 4.

CHECK : KOMKBV3-UVALL CA ' C'.

CHECK : KOMKBV3-UVPRS CA ' C'.

CHECK : KOMKBV3-UVALS CA ' C'.

CHECK : KOMKBV3-RELIK EQ SPACE.

CHECK : KOMKBV3-RFBSK EQ 'C'.

SY-SUBRC = 0.

*} INSERT

ENDFORM.

FORM KOBEV_912.

*{ INSERT DRTK906612 1

if KOMKBV3-TRtYP = 'L'.

sy-subrc = 4.

endif.

SY-SUBRC = 4.

CHECK : KOMKBV3-UVALL CA ' C'.

CHECK : KOMKBV3-UVPRS CA ' C'.

CHECK : KOMKBV3-UVALS CA ' C'.

CHECK : KOMKBV3-RELIK EQ SPACE.

CHECK : KOMKBV3-RFBSK EQ 'C'.

SY-SUBRC = 0.

*} INSERT

ENDFORM.

The routine # is 912, and DTRK906612 the transport.. "C" is the processing status -- post to accounting

I Do not understand what KOMKBV3-TRTYP eq L means though and where to look up these..

TRTYp is the transaction type and L is for cancellation, I am sure we have other codes like H and a few others, but dod not remember where I saw them..

Can you help guys.. I activated the routine thro RV80HGEN too

Former Member
0 Kudos

Check domain TRTYP and value range tab. 'L' stands for delete.

Former Member
0 Kudos

Hey,

This is probably due to the routine that this is happening.

You could check the status of the billing document through the table VBAK.. it is E for cancelled invoices.

If the message output is automated , it is due to the routine and it needs to be changed by your technical counterpart