10-16-2008 8:00 AM
Hi,
I have created a smartform and it is working very fine.But now i got issue that i need to print the same page 5 times...Only heading i want to chage.
They will selecty the printer and give print once means it want to take five pages of printout.with only the heading chages.
But now i copied the first page and paste in the second page but its showing only one page in print preview.Can anyone help how to achieve this
10-16-2008 8:04 AM
Hi
In the first page attributes, give next page as second page. Also , in the second page,next page as same page.
Regards,
Vishwa.
10-16-2008 8:04 AM
Hi
In the first page attributes, give next page as second page. Also , in the second page,next page as same page.
Regards,
Vishwa.
10-16-2008 8:07 AM
Hi,
In the page attributres nothing its showing on the next page field...
Can u give any other suggextion
10-16-2008 8:05 AM
Hi,
You can use DO 5 times.
and within this use:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
CALL FUNCTION l_fmname
And use a counter and pass its value to your smartform, and design your smartform heading depending on this counter number.
Hope it will satisfy your requirement.
Regards
Debarshi
10-16-2008 8:15 AM
HI,
Thanks for ur reply..But when i give do 5 times means i will ask the printer name five times.Becoz printer is not set as default,They will printer only once,That means the FM what u have given
SSF_.......
will work five times,The printer popup will come 5 times.So how to eliminete this
10-16-2008 8:21 AM
Ok....after SSF_ use
op_option-no_dialog = 'X'.
op_option-preview = 'X'. " no preview
pr_option-tddest = 'LOCL'.
pr_option-tdprinter = 'SAPWIN'.
pr_option-tdnewid = 'X'.
pr_option-tdimmed = 'X'.
pr_option-tddelete = 'X'. " 'X' after tests
pr_option-tdlifetime = '0'. " '0' days after test
pr_option-tdautority = space.
pr_option-tdfinal = 'X'.
pr_option-tdcover = ' '. " no cover sheet
pr_option-tdcopies = '001'.
Try it..
10-16-2008 8:36 AM
I have do 5 times for the SSF_........FM
But i dnt knw how to pass the values,Because the heading value different for the pages..
It want to print first page,second.........fifth page...
can anybody give sample code
10-16-2008 8:50 AM
Hi you can try like this..
Do 5 times.
if sy-index = 1.
<headind para> = '<name>'.
endif.
if sy-index = 2.
<headind para> = '<name>'.
endif.
if sy-index = 3.
<headind para> = '<name>'.
endif.
if sy-index = 4.
<headind para> = '<name>'.
endif.
call SSF....NAME.
exporting
header name = <headeing para>
enddo.
10-16-2008 8:07 AM
within Open form - close form call the same smartform 5 times, it would generate the file in the same spool.
Regards
Shashi
10-16-2008 8:07 AM
Hi,
I think u can do this with the one page only.
Set the next page as same page.
use the loop to print 5 pages and use command to
goto next page and at runtime change the heading using
program line.
Regards,
Vishal
10-16-2008 8:28 AM
Hi,
In 1st page attribute you first set the Next page Attribute as the 2nd page for that.
Regards,
Tarak
10-16-2008 9:04 AM
Hi,
If your heading contains any value do like this :
first fill up your work area using the conditions required....
Do 5 times.
perform show_smartforms.
enddo.
form show_smartforms.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = <your form name>
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = fm_pac_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
op_option-no_dialog = 'X'.
op_option-preview = 'X'. " no preview
pr_option-tddest = 'LOCL'.
pr_option-tdprinter = 'SAPWIN'.
pr_option-tdnewid = 'X'.
pr_option-tdimmed = 'X'.
pr_option-tddelete = 'X'. " 'X' after tests
pr_option-tdlifetime = '0'. " '0' days after test
pr_option-tdautority = space.
pr_option-tdfinal = 'X'.
pr_option-tdcover = ' '. " no cover sheet
pr_option-tdcopies = '001'.
CALL FUNCTION fm_pac_name
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
control_parameters = op_option
output_options = pr_option
wa_header = wa_header *this is your header area which will change depending on your selection. mentioned above
<watever you have to pass>
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
<your tables/table>
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
now if your header will show texts depending on the pages :
do 5 times .
count = 1.
perform print.
count = count + 1.
enddo.
form print.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = <your form name>
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = fm_pac_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
op_option-no_dialog = 'X'.
op_option-preview = 'X'. " no preview
pr_option-tddest = 'LOCL'.
pr_option-tdprinter = 'SAPWIN'.
pr_option-tdnewid = 'X'.
pr_option-tdimmed = 'X'.
pr_option-tddelete = 'X'. " 'X' after tests
pr_option-tdlifetime = '0'. " '0' days after test
pr_option-tdautority = space.
pr_option-tdfinal = 'X'.
pr_option-tdcover = ' '. " no cover sheet
pr_option-tdcopies = '001'.
CALL FUNCTION fm_pac_name
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
control_parameters = op_option
output_options = pr_option
count = count * you have to declare this count in your smartform form interface also. Now in smartform in your heading part create 5 header texts and in each of its condition tab write depending on your count.
i.e. count =1 or count = 2.....
<watever you have to pass>
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
<your tables/table>
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
11-13-2008 9:27 AM
hi experts
i am doing smartform.in the smartform i maintained two pages.in the first page i have given page2 as nextpage and in the second page i ahve given page2 as nextpage.but in output second page its not coming.i dont know what happend.ple give me suggestins to solve my problem
regards
polusree