on 08-30-2011 5:37 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.