Skip to Content
avatar image
Former Member

Multiple smartform

Develop smartform for multiple printing using control parameter .It is working fine for more than one entry sheet but it is not showing result for single when i execute it for single entry sheet its showing the print pop but after clicking on print preview it return on selection screen.

fm_name = 'ZML_SERVICE_ENTRY'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = fm_name
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = l_fmname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i398(00) WITH 'Error in displaying form output'(004).
ENDIF.

LOOP AT it_result.
w_cnt2 = sy-tabix .
CASE w_cnt2.

WHEN 1.
control_parameters-no_open = space.
* control_parameters-no_close = space.
control_parameters-no_close = 'X' .
WHEN w_cnt .
control_parameters-no_open = 'X' .
control_parameters-no_close = space .
WHEN OTHERS.
control_parameters-no_open = 'X' .
control_parameters-no_close = 'X' .
ENDCASE.
CALL FUNCTION l_fmname
EXPORTING
control_parameters = control_parameters
output_options = output
lblni_low = s_lblni-low
lblni_high = s_lblni-high
lbldt_fr = s_lbldt-low
lbldt_to = s_lbldt-high
sbnam_low = s_sbnam-low
sbnam_high = s_sbnam-high
sbna_low = s_sbna-low
sbna_high = s_sbna-high
kzabn_low = s_kzabn-low
kzabn_high = s_kzabn-high
ebeln_low = s_ebeln-low
ebeln_high = s_ebeln-high

TABLES
it_result = it_result
it_line = t_esll

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.
ENDLOOP.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 04, 2016 at 05:34 AM

    Hi below link may be useful to you.

    To Print Multiple Smartform in a Loop at one Go and converting into PDF

    Regards,

    Vishal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 04, 2016 at 06:41 AM

    Hi Aditya,

    Use Control_parameters parameter in FM

    and before passing it to FM. Fill this entries.

    LOOP GT_TABLE.

    CONTROL_PARAMETERS-NO_CLOSE = SPACE

    CONTROL_PARAMETERS-NO_OPEN = 'X'


    At the last record


    CONTROL_PARAMETERS-NO_CLOSE = 'X'

    CONTROL_PARAMETERS-NO_OPEN = 'SPACE


    ENDLOOP.


    Hope this may help full.

    Regards,

    E. Ananthachari.


    Capture.GIF (12.8 kB)
    Add comment
    10|10000 characters needed characters exceeded