Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Smartform Design Advice

I am currently writing a program the collects some contract data and prints them using a smartform.

The user enters a pair of dates, and the program collects all the contracts that have been billed within those dates. This part works fine, and I have 2 internal tables populated with data. One contains some header data for the contracts, the other contains the items for the contracts.

What I want to do is call the smartform an print all that data in one form. The smartform should print a new page for each contract, with all the items listed.

I know I could do it by looping on the 'header' table in the abap and then calling the smartform for each contract, but that would make lots of print spools. Is there any way I can put that loop within the smartform so that all the contracts are printed together?

Tags:
replied

Hi

If the system creates a spool for every contract it means you open your smartform for every contract.

If you want to create only one spool you need only to open smartforms only once.

You can do it calling direclty the fm to open and close smartforms:

data: ssfcompin type ssfcompin,

ssfctrlop type ssfctrlop.

start-of-selection.

ssfcompin-dialog = 'X'.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

input = ssfcompin

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

EXIT.

ENDIF.

ssfctrlop-no_open = 'X'.

ssfctrlop-no_close = 'X'.

LOOP AT ITAB.

CALL FUNCTION SMARTFORMS

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = ssfctrlop

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

.............

ENDLOOP.

CALL FUNCTION 'SSF_CLOSE'.

Max

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question