cancel
Showing results for 
Search instead for 
Did you mean: 

print preview while getting otf data

Former Member
0 Kudos

hi experts,

can somebody tell me how to get the print preview of sap script

while getting the otf data.

I have set the ITCPO-TDGETOTF = 'X' option in OPEN FORM but when i give it its not showing the output. How can I see output ?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ajay,

I also have the similar requirement of populating print preview and also get the otf and send it to mail.

For mail I am able to send but I am not getting the print preview.

Could you please tell me how did u resolve the issue .

Thanks

Raj

Former Member
0 Kudos

hi ajay,

TABLES ITCPO.

DATA: T_OTF TYPE TABLE OF ITCOO.

ITCPO-TDGETOTF = 'X'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

DEVICE = 'PRINTER'

DIALOG = 'X'

FORM = 'ZPRG_TEST'

OPTIONS = ITCPO

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

INVALID_FAX_NUMBER = 8

MORE_PARAMS_NEEDED_IN_BATCH = 9

SPOOL_ERROR = 10

OTHERS = 11.

IF SY-SUBRC 0.

ELSE.

CALL FUNCTION 'CLOSE_FORM'

TABLES

OTFDATA = T_OTF

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

SEND_ERROR = 3

SPOOL_ERROR = 4

OTHERS = 5.

ENDIF.

Check this code ok.

why dont you try giving a pdf preview which will be possible.

Regards,

Midhun Abraham

Edited by: Midhun Abraham on Oct 12, 2008 11:01 AM

Edited by: Midhun Abraham on Oct 12, 2008 11:05 AM