cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform gets printed multiple times absed on internal table records

Former Member
0 Kudos

Hello Experts

I have a smartform with a single page . I pass internal table from driver program to it to print 2 copies

But the smartform prints copies based on the number of records in the internal table .

For example if the internal table contains 5 records the output is repeated 5 times .

How to correct this ? Expecting an early reply .

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Martina

Check with field TDCOPIES in the structure whether it is filled more than once.

Regards,

Sravanthi

Former Member
0 Kudos

ru passing the FM SSF_smartform within loop in your print program... if yes remove that and call the FM only once....

former_member555112
Active Contributor
0 Kudos

Hi,

It depends upon how you have called the smartforms function module in the driver program.

Are you looping on you internal table and calling the smartforms within the loop?

Can you post your code of your driver program?

Regards,

Ankur Parab

Former Member
0 Kudos

Hi

I am not passing the Fm in a loop .. I am jus passing the copies as 2 in l_wa_output_options

but if thr are 50 records 100 copies are printed . Kindly see the code

SORT it_zfthundi_chq BY chqno vbeln.

  • } mod2


  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = 'ZFHUNDI_CHQ'
    IMPORTING
      fm_name            = fname
    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.

  IF sy-subrc = 0.


    CALL FUNCTION fname
      EXPORTING
       output_options             = l_wa_output_options
        w_total                      = w_total
        w_ded                      = w_ded
       TABLES
            it_zfthundi_chq1 = it_zfthundi_chq1
            it_zfthundi_chq  = it_zfthundi_chq
          EXCEPTIONS
            formatting_error = 1
            internal_error   = 2
            send_error       = 3
            user_canceled    = 4
            OTHERS           = 5.
  ENDIF.


ENDFORM.                    " P_CHQ_DATA

Former Member
0 Kudos

Hi,

Try like it :

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZFHUNDI_CHQ'

IMPORTING

fm_name = fname

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.

IF sy-subrc = 0.

l_wa_output_options-TDNEWID = 'X'. "New Spool Number

l_wa_output_options-TDCOPIES : '2'.

CALL FUNCTION fname

EXPORTING

output_options = l_wa_output_options

w_total = w_total

w_ded = w_ded

TABLES

it_zfthundi_chq1 = it_zfthundi_chq1

it_zfthundi_chq = it_zfthundi_chq

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

ENDIF.

Former Member
0 Kudos

Hi,

You will be using the FM SSF_FUNCTION_MODULE_NAME.. You may be calling this FM inside your internal table..

That could be the reason why you form is geting printed as per the number of records in the internal table

Regards

Ansari

Former Member
0 Kudos

Hi,

Check whether you called the SF in a loop of the internal table.

Check you have passed the no of copies field to the smartforms.

Please close the thread, if solved

Regards,

Aditya