cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid duplicate printing in Invoice

Former Member
0 Kudos

Dear ABAPer's,

I need to control Invoice printing like first time taking the Invoice print i has to print Original and next time while taking the print out it have to disply duplicate....Not like copy window concept...

<Priority normalized by moderator>

Thank Team...

Ramesh

Edited by: Vinod Kumar on Aug 30, 2011 1:33 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member193284
Active Participant
0 Kudos

Hello,

Please use below code.

This will help you to identify original or copy of an invoice.

**-->Check if original or copy

SELECT vstat INTO TABLE t_vstat FROM nast

WHERE kappl = nast-kappl

AND objky = nast-objky

AND kschl = nast-kschl

AND spras = nast-spras

AND parnr = nast-parnr

AND parvw = nast-parvw

AND nacha BETWEEN '1' AND '4'

AND vstat = '1'.

IF sy-subrc EQ 0.

w_repeat = c_copy.

ELSE.

w_repeat = c_original.

ENDIF.

Former Member
0 Kudos

Hi

You can use the system fields SFSY-COPYCOUNT or SFSY-COPYCOUNT0 to query whether the current output is the original or, respectively, which number the copy has.

SFSY-COPYCOUNT is the Copy counter where 1 = original, 2 = 1st copy, etc.

SFSY-COPYCOUNT0 is the Copy counter where 0 = original, 1 = 1st copy, etc.

More Info

Shiva

Former Member
0 Kudos

To be honest, when i read "Expecting fast response" i felt an urge to ignore that thread completeley.

SDN is a Service provided by SDN members, on a platform donated by SAP, and its completeley free.

People are willing to help here, but expecting things to work out and even fast, would be a bit harsh for a free service.

anyway back to topic.

You got to check this via table NAST.

Have a look (Select) if you already got an entry in table NAST with OBJKY = your invoce number, KSCHL = your output type, and VSTAT = 1 (sucessful processed).

If thats the case then you are printiung duplicates, if not, you are printing the original.

Former Member
0 Kudos

Hi,

That already i checked becoz when printer popup comes even i cancel the popup that table entry get changed to 1.....

Thanks

Former Member
0 Kudos

well that again is a problem of a not too good designed driver program.

normally you set the returncode to 999 or something not 0 at least at start of print program. so when operation is cancelled somewhen between or problems arise you DONT get an update of table nast telling you that output type was processed sucessfully.

You are doing it fine, the guy who designed the driver program has some room for improvement.

Former Member
0 Kudos

Hi,

By refering IS_NAST-VSTAT this field i am printing Original when the field value is 0, when others i am printing Copy ....

Now the problem is second time printout while print priview it showing copy text while printing its printing original text...

Any idea,

Regards,

Ramesh