cancel
Showing results for 
Search instead for 
Did you mean: 

how to determine if a smartform is printed

Former Member
0 Kudos

good day gurus...

i have develop a print program and a smartform which prints the official receipt. now, what i need this time, is to determine, if the smartform is already printed or not. so what i am thinking is, i have to create a z_table that will store the spool number and the document number once it is printed.

my problem now are the following:

1. what are the tables that are linked to the spool numbers and the document number(belnr).

2. how could i determine if the print button on the smartform is already pressed or not.

thanks a lot for your help.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

i got it now. thanks .

former_member196280
Active Contributor
0 Kudos

Spool numbers are stored in table TSP01

*To get spool Number

Example:

DATA: l_rqident like tsp01-rqident,

l_rq2name like tsp01-rq2name.

concatenate sy-repid0(9) sy-uname0(3)

into l_rq2name.

select * from tsp01 where rq2name = l_rq2name

order by rqcretime descending.

l_rqident = tsp01-rqident.

exit.

endselect.

if sy-subrc ne 0.

clear l_rqident.

endif.

Close thread once your question is answered.

Regards,

SaiRam

Former Member
0 Kudos

thanks sai ram for your reply.

but my problem here is not to get the spool number alone but how to determine that a certain document has that specific spool number.

For your information why I want to know which spool for a certain document is, I want to determine if a form is already printed or not. So I think, the spool is the best way to get as the determinant if a document is already printed. But my question now is, how could I pinpoint exactly that the a certain document belongs to that spool number?

Thanks again in advance...

Former Member
0 Kudos

hi,

In the Ztable you add another one field PRINT

wa_ztable-print = 'X'.

APPEND wa_ztable TO i_ztable.

clear wa_ztable.

MODIFY ztable FROM TABLE i_ztable.

once print the form, you will check it in ztable updated field PRINT with 'X' or not.

regards

bhupal

Former Member
0 Kudos

hi bhupal,

thanks for your reply.

Actually, the code you have given is correct. But my question is, when do you execute this code? Isn't that when you click the print button? thats my problem actually.. How do I know, if the user had already click the print button. If I am correct, we can determine via the SPOOL numbers... (see thread)...

Do you have any idea further on my problem I mentioned above?

Thanks again.

Former Member
0 Kudos

Hi,

According to my knowledge there is no need to store any spool request what you do is, just add one more field in your ztable give name as CHECK.

Then whenever you press print, update that ztable field ZTABLE-CHECK = 'X' according to that perticular document.

So next time whenever you press print for the same document check tha ztable

if it is 'X'

then pass a message that 'Doc is already printed'.

else

Print

And Update the field againt to 'X'.

endif.

Hope this will helpfull for you,

Regards,

KP

Edited by: krishna prasad on Aug 19, 2008 6:52 AM

Edited by: krishna prasad on Aug 19, 2008 6:52 AM

former_member585060
Active Contributor
0 Kudos

For spool numbers it is stored in TSP01 Table &

TSP02L Tables

Edited by: Bala Krishna on Aug 19, 2008 10:21 AM

Former Member
0 Kudos

thanks bala for the reply...

TSP01 have records on it while TSP02L has none at all.

In this tables, spool numbers are created once the document (example is smartform) is printed.

Now, how could I determine if the smartform was printed or not. Is there any field on the TSP01 that is related on the BSEG,BSAD,BSID tables which has the document numbers(BELNR)?

former_member585060
Active Contributor
0 Kudos

Not sure which table stores the document details, U do a SQL trace for that using ST05.

See what all tables it access while printing.