on 09-12-2011 10:02 AM
Hi,
In VF02/VF03 transaction,smartform to make original copy and duplicate copy i am 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
Hello,
Use below logic should resolve your issue.
**-->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.
Thanks
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
checking vstat is not the way to go tho it has its place in the solution.
You have to read table nast with OBJKY = your document number (when talking of a output type on header level) and VSTAT = 1, and KSCHL = your output type.
If you can find such an entry in NAST, then it has been processed sucessfully, and so all following printouts/previews are copies.
If you dont find such a record, thne you are printing an original.
For this solution the update of table NAST by your driver program must work correctly tho.
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 |http://help.sap.com/saphelp_nw70/helpdata/en/b1/243fe0beee11d4b633006094192fe3/frameset.htm]
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please try any of the below options
1. check the field REPET in NAST than VSTAT.
*2. Select VSTAT field from the table NAST where VSTAT = 1 ( Successfully processed ). If it is already processed * successfully then it will have VSTAT = 1. If there is no entry or VSTAT = 0, then it is original copy.*
3. If you have copied the smartforms using the standard LB_BIL_INVOICE, thenthere is a field called IS_REPEAT, please check that
Shiva
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.