Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform

Former Member
0 Kudos

Dear All,

How to call multiple layouts in Smartform.

Ex., start form and end form in Scripts.

THanks,

Ranjan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ranjan

Only you should manage the opening and closing of SF dialog.

This step usually is done from fm of the sf, but you can manage it by yourself.

- 1) Open dialog for print:

CALL FUNCTION 'SSF_OPEN'

  • EXPORTING

  • ARCHIVE_PARAMETERS =

  • USER_SETTINGS = 'X'

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJ =

  • OUTPUT_OPTIONS =

  • CONTROL_PARAMETERS =

  • IMPORTING

  • JOB_OUTPUT_OPTIONS =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

EXIT.

ENDIF.

-


Here you call all sf you need to print:

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMART_1'

importing

fm_name = fm_name_1

exceptions

no_form = 1

no_function_module = 2

others = 3.

  • Remember you're managing the open out of sf, so

ssfctrlop-no_open = 'X'.

ssfctrlop-no_close = 'X'.

call function fm_name

exporting

..........

control_parameters = ssfctrlop

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

exit.

endif.

  • Next sf

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMART_2'

importing

fm_name = fm_name_2

exceptions

no_form = 1

no_function_module = 2

others = 3.

call function fm_name_2

exporting

..........

control_parameters = ssfctrlop

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

exit.

endif.

.....and so

2- Close print

CALL FUNCTION 'SSF_CLOSE'

  • IMPORTING

  • JOB_OUTPUT_INFO =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Max

5 REPLIES 5

Former Member
0 Kudos

Hi Ranjan

Only you should manage the opening and closing of SF dialog.

This step usually is done from fm of the sf, but you can manage it by yourself.

- 1) Open dialog for print:

CALL FUNCTION 'SSF_OPEN'

  • EXPORTING

  • ARCHIVE_PARAMETERS =

  • USER_SETTINGS = 'X'

  • MAIL_SENDER =

  • MAIL_RECIPIENT =

  • MAIL_APPL_OBJ =

  • OUTPUT_OPTIONS =

  • CONTROL_PARAMETERS =

  • IMPORTING

  • JOB_OUTPUT_OPTIONS =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

EXIT.

ENDIF.

-


Here you call all sf you need to print:

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMART_1'

importing

fm_name = fm_name_1

exceptions

no_form = 1

no_function_module = 2

others = 3.

  • Remember you're managing the open out of sf, so

ssfctrlop-no_open = 'X'.

ssfctrlop-no_close = 'X'.

call function fm_name

exporting

..........

control_parameters = ssfctrlop

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

exit.

endif.

  • Next sf

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMART_2'

importing

fm_name = fm_name_2

exceptions

no_form = 1

no_function_module = 2

others = 3.

call function fm_name_2

exporting

..........

control_parameters = ssfctrlop

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

exit.

endif.

.....and so

2- Close print

CALL FUNCTION 'SSF_CLOSE'

  • IMPORTING

  • JOB_OUTPUT_INFO =

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • OTHERS = 4

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Max

0 Kudos

dear all

How to call a smart form if there are multiple vendors?

the requirement is for every new vendor the page number must be reset to 1.

regards

ranjan

0 Kudos

Hi,

Use the event inside the loop or table whatever it is.Inside that reset a variable to one each time when new vender came inside the loop.

Use Text element to print the variable.

Kindly reward points by clicking the star on the left of reply,if it helps.

Former Member
0 Kudos

Hi,

U have to use FM SSF_FUNCTION_MODULE_NAME in ur driver program Which generate one FM name. So,Pass ur parameters to that FM. Here ur FM name is generated at runtime.

For eg.

TABLES : mara.

DATA : it LIKE mara OCCURS 0 WITH HEADER LINE.

DATA : fm TYPE rs38l_fnam.

SELECT-OPTIONS : p_matnr FOR mara-matnr.

START-OF-SELECTION.

SELECT * FROM mara INTO TABLE it

WHERE matnr IN p_matnr.

SORT it BY matnr.

IF sy-subrc = 0.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'YSDM_INV_COV_LETTER'

IMPORTING

fm_name = fm

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

CALL FUNCTION fm

TABLES

it = it.

ENDIF.

Regards,

Digesh Panchal

Former Member
0 Kudos

Use COMMAND Node to generate New-page based on condition