Skip to Content
avatar image
Former Member

smartforms more than one page

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 16, 2008 at 07: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • avatar image
    Former Member
    Oct 16, 2008 at 07:07 AM

    within Open form - close form call the same smartform 5 times, it would generate the file in the same spool.

    Regards

    Shashi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07:28 AM

    Hi,

    In 1st page attribute you first set the Next page Attribute as the 2nd page for that.

    Regards,

    Tarak

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 08: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.
    
    
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 13, 2008 at 09: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

    Add comment
    10|10000 characters needed characters exceeded