Skip to Content

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

firstly open Preview ?

hi

ı m to prepare to a smartform

ı click print button open the choose print windows. this normally.

but ı want to firstly open Preview window .

how can ı do ?

thanks.

Tags:
replied

Hi,

try like this....

hi,

DATA: CPARAM TYPE SSFCTRLOP,

CONTROL TYPE SSFCTRLOP,

OUTOP TYPE SSFCOMPOP,

INPUT TYPE SSFCOMPIN,

FM_NAME TYPE RS38L_FNAM,

MY_TABIX TYPE SY-TABIX,

FM_NAME1 TYPE RS38L_FNAM,

RESULT TYPE SSFCRESOP.

CONTROL-NO_DIALOG = 'X'.

CONTROL-PREVIEW = 'X'.

CONTROL-NO_OPEN = 'X'.

CONTROL-NO_CLOSE = 'X'.

CONTROL-DEVICE = 'PRINTER'.

OUTOP-TDDEST = 'LP01'.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

CONTROL_PARAMETERS = CONTROL

OUTPUT_OPTIONS = OUTOP

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.

EXIT.

ENDIF.

**********************call for statement1***************

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZSFORM_STATEMENTF'

VARIANT = ' '

DIRECT_CALL = ' '

IMPORTING

FM_NAME = FNAME2.

CALL FUNCTION 'SSF_CLOSE'

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.

rgds,

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question