SSFCOMP_PDF_PREVIEW - print preview + mail
Hi Experts,
I am using the function module SSFCOMP_PDF_PREVIEW to preview my layout in pdf. Now the users want to mail it. I know the function module to send mails. I am not asking for that. I would like to know if I can send the pdf as email to an external address entered by the user(optional).
I am talking about the standard layouts here like sales orders/invoices so no option of creating a field on selection screen.
Please let me know if it is possible.
Warm Regards,
Abdullah
Hi Kartik,
Thanks for your response. Currently I am calling a Z screen, after close_form function module of my sap script(It is called every time the user exits the screen. The requirement is that on the print preview window, I should have the option of mailing along with a user defined body in my layout (sap script/smartform). And the mail that goes should have the layout in pdf format. This process should be available only if the user wants to send the mail.
The transactions are standard like sales order/delivery note etc. but the scripts/smartforms are developed in my scenario.
Warm Regard,
Abdullah
Similar Messages
-
SSFCOMP_PDF_PREVIEW - print preview problem
Hi Experts,
I am using the following function module SSFCOMP_PDF_PREVIEW to display my layout in pdf. It works fine on some systems, for other users, the window opens up but no preview is available.
May I please know if any GUI patch is to be applied, or what version of Adobe Reader is required for display.
Warm Regards,
AbdullahHi,
Please check the adobe versions in the systems its working and in the system in which its not working
and compare them... you will get a fare idea
and then if still you are not able to get any idea then check the release of SAP of those systems...
Regards,
Siddarth -
QM02 (mail to vendor when clicking on Print Preview)
Hi Expert,
When user click on Print Preview(QM02-Notification-Print-Notifiaction ,enter email address in QM02 transaction.it shoots a mail to specified address. After EHP4 upgradation its not working.
What may be the reason,Solved
-
Can't print from Mail, TextEdit, or Preview in Snow Leopard
Installed Snow Leopard on a new Mac Mini with a newly formatted drive. Successfully set up network HP printers using IP Printing option. Able to print to these printer from all installed applications EXCEPT TextEdit, Preview, and Mail. Print dialog never displays at all after selecting "print" in Mail. Print dialog window does display for TexEdit and Preview but clicking "print" in the dialog window all the options blank out and can't cancel or close the print dialog window without quitting app.
However, when we take this same mini to a different physical location on a different network, printing works normally in all apps. We are guessing that Appletalk has something to do with this. The problem network uses a Cisco 3600 router. We disabled Appletalk in the configuration but that had no effect.Nothing shows up in CUPS error log to trying to print from Mail. Pasted below is consistent message we get in Console when attempting to print from Mail.
Today, inexplicably, we can print from Preview and TextEdit.
1/20/10 5:04:02 PM Mail[164] HIToolbox: ignoring exception '* -[NSCFDictionary setObject:forKey:]: attempt to insert nil key' that raised inside Carbon event dispatch
0 CoreFoundation 0x00007fff84ad8444 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff8223a0f3 objcexceptionthrow + 45
2 CoreFoundation 0x00007fff84ad8267 +[NSException raise:format:arguments:] + 103
3 CoreFoundation 0x00007fff84ad81f4 +[NSException raise:format:] + 148
4 Foundation 0x00007fff81a24a84 -[NSCFDictionary setObject:forKey:] + 164
5 libSystem.B.dylib 0x00007fff85ce8273 handlebrowseresponse + 236
6 libSystem.B.dylib 0x00007fff85ce8047 DNSServiceProcessResult + 717
7 PrintCocoaUI 0x00000001157230c5 RunningAsRoot + 84360
8 Foundation 0x00007fff81a3285a nsnotecallback + 167
9 CoreFoundation 0x00007fff84a80e3a __CFXNotificationPost + 954
10 CoreFoundation 0x00007fff84a6d3e8 _CFXNotificationPostNotification + 200
11 Foundation 0x00007fff81a297c4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 101
12 Mail 0x0000000100002611 0x0 + 4294977041
13 Foundation 0x00007fff81af4167 _performFileHandleSource + 1254
14 CoreFoundation 0x00007fff84a76271 __CFRunLoopDoSources0 + 1361
15 CoreFoundation 0x00007fff84a74469 __CFRunLoopRun + 873
16 CoreFoundation 0x00007fff84a73c2f CFRunLoopRunSpecific + 575
17 Foundation 0x00007fff81a6da24 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270
18 Mail 0x00000001000b1b85 0x0 + 4295695237
19 AppKit 0x00007fff84053ccf -[NSView(NSPrinting2) _knowsPagesFirst:last:] + 168
20 AppKit 0x00007fff83ead333 -[NSConcretePrintOperation(NSInternal) _validatePagination] + 198
21 AppKit 0x00007fff840c2c8b -[NSPrintPreviewController start] + 811
22 Foundation 0x00007fff81a3285a nsnotecallback + 167
23 CoreFoundation 0x00007fff84a80e3a __CFXNotificationPost + 954
24 CoreFoundation 0x00007fff84a6d3e8 _CFXNotificationPostNotification + 200
25 Foundation 0x00007fff81a297c4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 101
26 Mail 0x0000000100002611 0x0 + 4294977041
27 PrintCocoaUI 0x000000011571aacb RunningAsRoot + 50062
28 PrintCocoaUI 0x000000011570b9a4 0x0 + 4654676388
29 PrintCocoaUI 0x000000011570cb43 0x0 + 4654680899
30 PrintCocoaUI 0x000000011570b513 0x0 + 4654675219
31 PrintCocoaUI 0x00000001157189ca RunningAsRoot + 41613
32 PrintCocoaUI 0x00000001157182de RunningAsRoot + 39841
33 AppKit 0x00007fff83a9095d -[NSWindowController _windowDidLoad] + 538
34 AppKit 0x00007fff83a2e113 -[NSWindowController window] + 112
35 AppKit 0x00007fff83eb1462 -[NSPrintPanel beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:] + 627
36 AppKit 0x00007fff83eafb51 -[NSConcretePrintOperation runOperationModalForWindow:delegate:didRunSelector:contextInfo:] + 478
37 Mail 0x00000001000b095f 0x0 + 4295690591
38 AppKit 0x00007fff83b9d09a -[NSApplication sendAction:to:from:] + 95
39 AppKit 0x00007fff83bc1602 -[NSMenuItem _corePerformAction] + 365
40 AppKit 0x00007fff83bc136c -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 121
41 AppKit 0x00007fff83e440b8 -[NSMenu _internalPerformActionForItemAtIndex:] + 35
42 AppKit 0x00007fff83cf69d5 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 136
43 AppKit 0x00007fff83ba3b60 NSSLMMenuEventHandler + 321
44 HIToolbox 0x00007fff823d3bd7 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1002
45 HIToolbox 0x00007fff823d3126 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14H andlerCallRec + 395
46 HIToolbox 0x00007fff823f0d49 SendEventToEventTarget + 45
47 HIToolbox 0x00007fff8241fd45 ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5PP14OpaqueEventRef + 387
48 HIToolbox 0x00007fff8244ca1a SendMenuCommandWithContextAndModifiers + 56
49 HIToolbox 0x00007fff8244c9d4 SendMenuItemSelectedEvent + 101
50 HIToolbox 0x00007fff8244c8dc ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2 + 150
51 HIToolbox 0x00007fff8242dcf9 _ZL14MenuSelectCoreP8MenuData5PointdjPP13OpaqueMenuRefPt + 453
52 HIToolbox 0x00007fff8242d461 _HandleMenuSelection2 + 453
53 AppKit 0x00007fff83a74b79 _NSHandleCarbonMenuEvent + 236
54 AppKit 0x00007fff83a486a2 _DPSNextEvent + 1908
55 AppKit 0x00007fff83a47b41 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
56 AppKit 0x00007fff83a0d747 -[NSApplication run] + 395
57 AppKit 0x00007fff83a06468 NSApplicationMain + 364
58 Mail 0x0000000100002150 0x0 + 4294975824
) -
How to activate "Send mail" from print preview in ME23N
In ME23N there is a "print preview"-button that shows a preview of the PO. In the preview-windows there is a Text-menu with a "Send mail"-command, but that command is not active. How can I activate this command so that it is possible to send the PO to an email-recepient?
I have configured the smtp-functionality (SCOT++) and sending PO's as email to suppliers in ME9F works fine by choosing "Send external". But still the Send mail-option is inactive in preview-mode. Any tips?
Regards,
Thor-Egilplease maintain output condition record (MN04) as "external send"
Also make sure that you have maintained the proper email ID in vendor master -
Enable Send Mail option in print preview
Hi,
Is it possible to enable the 'Send Mail' option in the print preview of the form output. If possible how do we do that. Please let me know.
<removed by moderator>
Thanks & Regards,
Prasanth
Edited by: Thomas Zloch on May 13, 2010 11:17 AMHai ,
Your can send mail using the function Module : SO_NEW_DOCUMENT_SEND_API1 , check where you need to use this function module any user exit is available for this at the time of print preview .
Regards,
K.Vinay Kumar -
Hi,
I have a report which consists of 9 subreports in 2 tables..
When the run report I do see data.
when i export to a pdf and print preview the report in Bids.. i see data for the first 22 pages and then the remaining pages are blank with just the header showing up...
when i go to the pdf and select page 25 it is blank but when i go the report and not in print preview mode.. and i type in 25 in the page number data shows up on that page...
the report is set to a portrait and the margins are set to 0.
How can I solve this problems and why is it happening... the size of the sub report are the same..
Any help will be appreciated.
Thanks
KarenI should add that when I e-mail this document to myself and print it directky from the iMac, it prints fine.
-
Print Preview of PO before saving .
Dear Experts ,
Is it possible to view a print preview of a PO after just checking the PO & before saving it ??
If yes pls let me know how ?
Regards
AnisHi Anis,
yes, you can view a PO in print preview in ME21N before saving it but the following are pre-requisities:
1 - There are valid messages defined for the PO - check by clicking on 'Messages' at the top of the screen. So long as there is a message defined, you can display, if not, add the output type that you would like to use (NEU for example).
2 - The output type must be pointing correctly to a printer or valid e-mail address (for e-mail outputs)
3 - You must have access to transaction ME9F in authorisations - although you are not navigating to ME9F, you will still need the access
If these things are OK, click on print preview and you will get an image of what the printed document will look like.
Rob -
Print Preview as an attachment
Respected All,
I got a requirement from client side that, "On PO save an email(external) will be send to agent with print preview of PO as an attachment"
I'm new to worflow can you suggested me what should be the steps, where should i start
I appreciate you spend your time replay.
Regards,
FarrukhHi Farrukh,
The requirement that you have will require some efforts from ABAP side.
First you have to make changes in standard print program of the PO and provide necessary data that is required for the print preview of the PO.
Customize the standard program to get the PDF data of smart form ( u will get lots of details in ABAP forum) and attach that to the mail being sent to external mail ID.
And then create a method in BOR object, that will call the customised print Program and pass data using SET and GET commands.
Regards,
Sangvir Singh -
PO email output type program causes unable to print preview
Hi Guys,
i am customising a program for print preview email for PO output type, but the preview does not come out , here is the code:
form entry_neu using ent_retco ent_screen.
data: dtext like tline.
data: l_druvo like t166k-druvo,
l_nast like nast,
l_from_memory,
l_doc type meein_purchase_doc_print.
clear ent_retco.
if nast-aende eq space.
l_druvo = '1'.
else.
l_druvo = '2'.
endif.
call function 'ME_READ_PO_FOR_PRINTING'
exporting
ix_nast = nast
ix_screen = ent_screen
importing
ex_retco = ent_retco
ex_nast = l_nast
doc = l_doc
changing
cx_druvo = l_druvo
cx_from_memory = l_from_memory.
check ent_retco eq 0.
concatenate l_nast-kschl 'for ' l_doc-xekko-ebeln into
l_nast-TDCOVTITLE separated by space.
ekko = l_doc-xekko.
perform set_textsymbol using '&EKKO-WAERS&' EKKO-WAERS.
select adrc~name1 into rm06b-ltex1
from t001
join adrc
on adrcaddrnumber eq t001adrnr and
adrc~date_from le sy-datum and
adrc~nation eq space
where t001~bukrs = ekko-bukrs.
endselect.
select single regno into t9s01-regno
from t9s01
where bukrs = ekko-bukrs.
if sy-subrc eq 0.
T9S01-BUKRS = EKKO-BUKRS.
endif.
perform set_textsymbol using '&RM06B-LTEX1&' RM06B-LTEX1.
perform set_textsymbol using '&T9S01-REGNO&' t9s01-regno.
perform set_textsymbol using '&T9S01-BUKRS&' T9S01-BUKRS.
lfa1-lifnr = ekko-lifnr.
select single adrc~str_suppl3 into lfa1-name4
from lfa1
join adrc
on adrcaddrnumber = lfa1adrnr
where lfa1~lifnr = ekko-lifnr.
perform set_textsymbol using '&LFA1-LIFNR&' LFA1-LIFNR.
perform set_textsymbol using '&LFA1-NAME4&' LFA1-NAME4.
perform set_textsymbol using '&EKKO-WAERS&' EKKO-WAERS.
perform read_text using 'F15' DTEXT-TDLINE.
if dtext-tdline is initial.
if ekko-ekgrp eq 'CP1' or ekko-ekgrp eq 'C03' or
ekko-ekgrp eq 'P01' or ekko-ekgrp eq 'P02' or
ekko-ekgrp eq 'P03' or ekko-ekgrp eq 'P04' or
ekko-ekgrp eq 'P08'.
move 'Requisitioner.' to DTEXT-TDLINE.
elseif ekko-ekgrp eq 'CP2' or ekko-ekgrp eq 'C01' or"B0691
ekko-ekgrp eq 'C04' or ekko-ekgrp eq 'P05' or
ekko-ekgrp eq 'P06' or ekko-ekgrp eq 'P07' or
ekko-ekgrp eq 'P09' or
ekko-ekgrp eq 'C05'. "B0691
move 'Accounts Payable.' to DTEXT-TDLINE.
else. "B0691
move 'Accounts Payable.' to DTEXT-TDLINE. "B0691
endif.
endif.
t9s02-text4 = DTEXT-TDLINE(17).
perform set_textsymbol using '&T9S02-TEXT4&' T9S02-TEXT4.
CLEAR GV_NO_CONTRACT.
perform read_text using 'F13' T9S02-TEXT7.
IF T9S02-TEXT7 IS INITIAL. "Buyer did not type anything
MOVE 'stipulated at the end of this PO.' TO T9S02-TEXT7.
MOVE 'X' TO GV_NO_CONTRACT.
ENDIF.
perform set_textsymbol using '&T9S02-TEXT7&' T9S02-TEXT7 .
SELECT SINGLE VERKF into LFM1-VERKF
FROM LFM1
WHERE LIFNR = EKKO-LIFNR
AND EKORG = EKKO-EKORG.
perform set_textsymbol using '&LFM1-VERKF&' LFM1-VERKF .
loop at l_doc-XEKPO into ekpo where zwert = 0.
if ekpo-peinh ne 0.
ekpo-zwert = ( EKPO-MENGE * EKPO-NETPR ) /
( EKPO-PEINH * 1000 ).
else.
ekpo-zwert = ( EKPO-MENGE * EKPO-NETPR ) / 1000 .
endif.
modify l_doc-XEKPO from ekpo.
endloop.
clear: gv_print, gv_terms, gv_tcode.
gv_print = tnapr-FUNCNAME.
gv_terms = tnapr-sform.
gv_tcode = tnapr-FONAM5.
call function 'Z_ME_PRINT_PO'
exporting
ix_nast = l_nast
ix_druvo = l_druvo
doc = l_doc
ix_screen = ent_screen
ix_from_memory = l_from_memory
ix_toa_dara = toa_dara
ix_arc_params = arc_params
ix_fonam = tnapr-fonam "HW 214570
gv_no_contract = gv_no_contract
gv_print = gv_print
gv_terms = gv_terms
gv_tcode = gv_tcode
end of additions
importing
ex_retco = ent_retco.
endform.
did i miss anything in the coding? pls advicehi,
There are two options.
1. Change the output medium of the output type to Print putput 1(No 1).
2. For the sender customer go to transaction XD02 and give your mail ID instead of the customers and check. You will get the output in PDF format.
Thanks,
Kasiraman R -
Converting Smartforms to PDF and displaying Smartforms on print preview
Hi,
How to convert smartforms to pdf?
How to attach this pdf to email?
How to attach this pdf to the email and at the same time can print preview the smartforms?
Thanks.Hi Navi,
Code Snippet for Simple Mail
*& Report ZZ_TEST *
REPORT zz_test .
INCLUDE zz_test_top.
INCLUDE zz_test01.
FORM entry *
--> RETURN_CODE *
--> US_SCREEN *
FORM entry USING return_code us_screen.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
CASE retcode.
WHEN 0.
return_code = 0.
WHEN 3.
return_code = 3.
WHEN OTHERS.
return_code = 1.
ENDCASE.
ENDFORM. "entry
*& Include ZZ_TEST_TOP *
TABLES : nast,
tnapr.
TYPES : BEGIN OF t_SOUDNAMEI1.
INCLUDE STRUCTURE SOUDNAMEI1.
TYPES : END OF t_SOUDNAMEI1.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
*Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
i_lips LIKE lips OCCURS 0 WITH HEADER LINE,
i_SOUDNAMEI1 TYPE STANDARD TABLE OF t_SOUDNAMEI1.
Work Area declarations
DATA:w_objhead TYPE soli_tab,
wa_control_parameters TYPE ssfctrlop,
wa_output_options TYPE ssfcompop,
w_return TYPE ssfcrescl,
w_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
w_buffer TYPE string,"To convert from 132 to 255
wa_SOUDNAMEI1 TYPE t_SOUDNAMEI1,
Variables declarations
w_form_name TYPE rs38l_fnam,
w_len_in LIKE sood-objlen,
w_len_out LIKE sood-objlen,
w_len_outn TYPE i,
w_lines_txt TYPE i,
w_lines_bin TYPE i,
retcode TYPE sy-subrc,
xscreen TYPE c,
w_spld TYPE usr01-spld,
w_receiver TYPE SOXNA-FULLNAME,
w_OBJ_RECORD TYPE OBJ_RECORD,
w_user type sy-uname,
w_email TYPE ad_smtpadr.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X',
c_atrate(1) TYPE c VALUE '@'.
*& Include ZZ_TEST01 *
FORM PROCESSING *
FORM processing USING proc_screen.
SELECT * FROM lips
INTO TABLE i_lips
WHERE vbeln = nast-objky.
Call Function module to Getfunction Module name Generated by Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = tnapr-sform
IMPORTING
fm_name = w_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
retcode = sy-subrc.
ENDIF.
CLEAR : wa_control_parameters,
wa_output_options.
CASE nast-nacha.
WHEN '1'.
wa_control_parameters-device = 'PRINTER'.
WHEN '7'.
DATA: l_email TYPE ad_smtpadr.
wa_output_options-tdnoprev = c_x.
wa_control_parameters-getotf = c_x.
To get the default output device maintained in the
User profile
SELECT SINGLE spld FROM usr01
INTO w_spld
WHERE bname EQ nast-usnam.
IF sy-subrc EQ 0.
MOVE w_spld TO wa_output_options-tddest .
ENDIF.
wa_output_options-tdnoprev = c_x.
wa_control_parameters-getotf = c_x.
To get the email address maintained for the particular output
CALL FUNCTION 'NAST_GET_MESSAGE_OBJECT_RECV'
EXPORTING
pi_objkey = nast-tdname
IMPORTING
pe_addr = w_receiver
CHANGING
pc_objhandle = w_obj_record
EXCEPTIONS
maildata_not_readable = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF w_receiver NA c_atrate.
To retrieve the E-Mail Id in case we get the User name from NAST
CLEAR wa_soudnamei1.
REFRESH i_soudnamei1.
MOVE w_receiver TO wa_soudnamei1-fullname.
To get the user name
CALL FUNCTION 'SO_NAME_CONVERT_API1'
EXPORTING
name = wa_soudnamei1
TABLES
names = i_soudnamei1
EXCEPTIONS
user_not_exist = 1
parameter_error = 2
x_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.
CLEAR wa_soudnamei1.
READ TABLE i_soudnamei1 INTO wa_soudnamei1 INDEX 1.
MOVE wa_soudnamei1-sapname TO w_user.
To get the e-mail Id maintained in the user profile
CALL FUNCTION 'FTR_CORR_CHECK_EMAIL_SAP_USER'
EXPORTING
i_user = w_user
IMPORTING
e_email_address = l_email
EXCEPTIONS
mail_address = 1
determination_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
MOVE l_email TO w_receiver.
ENDIF.
MOVE w_receiver TO w_email.
ENDCASE.
wa_control_parameters-no_dialog = c_x.
wa_control_parameters-langu = nast-spras .
wa_output_options-tdteleland = nast-tland.
wa_output_options-tdtelenum = nast-telfx .
wa_output_options-tdsenddate = nast-erdat .
wa_output_options-tdsendtime = nast-eruhr .
wa_output_options-tddataset = nast-dsnam .
wa_output_options-tdsuffix1 = nast-dsuf1 .
wa_output_options-tdsuffix2 = nast-dsuf2 .
wa_output_options-tdimmed = nast-dimme .
wa_output_options-tddelete = nast-delet .
wa_output_options-tdautority = nast-tdautority.
wa_output_options-tdcovtitle = nast-tdcovtitle .
wa_output_options-tdcover = nast-tdocover .
wa_output_options-tdreceiver = nast-tdreceiver.
wa_output_options-tddivision = nast-tddivision.
wa_output_options-tdcopies = nast-anzal .
wa_output_options-tdnewid = c_x.
wa_output_options-tdarmod = nast-tdarmod.
wa_output_options-tdnoarmch = c_x.
CALL FUNCTION w_form_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = wa_control_parameters
output_options = wa_output_options
user_settings = ' '
IMPORTING
job_output_info = w_return
TABLES
it_lips = i_lips
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF nast-nacha EQ 7 AND sy-subrc EQ 0.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = w_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
Convert PDF from 132 to 255.
LOOP AT i_tline.
Replacing space by ~
TRANSLATE i_tline USING ' ~'.
CONCATENATE w_buffer i_tline INTO w_buffer.
ENDLOOP.
Replacing ~ by space
TRANSLATE w_buffer USING '~ '.
DO.
i_record = w_buffer.
Appending 255 characters as a record
APPEND i_record.
SHIFT w_buffer LEFT BY 255 PLACES.
IF w_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR w_objhead.
Object with PDF.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objbin LINES w_lines_bin.
Document information.
w_doc_chng-obj_name = 'Smartform'.
w_doc_chng-expiry_dat = sy-datum + 10.
CONCATENATE 'Delivery' 'Note'
INTO w_doc_chng-obj_descr.
*w_doc_chng-obj_descr = 'Smart form output'.
w_doc_chng-sensitivty = 'F'. "Functional object
w_doc_chng-doc_size = w_lines_txt * 255.
Pack to main body as RAW.
Obj. to be transported not in binary form
CLEAR i_objpack-transf_bin.
Start line of object header in transport packet
i_objpack-head_start = 1.
Number of lines of an object header in object packet
i_objpack-head_num = 0.
Start line of object contents in an object packet
i_objpack-body_start = 1.
Number of lines of the object contents in an object packet
i_objpack-body_num = w_lines_txt.
Code for document class
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 1.
i_objpack-body_num = w_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'Smartform'.
CONCATENATE 'Delivery' 'Note' '.pdf'
INTO i_objpack-obj_descr.
i_objpack-doc_size = w_lines_bin * 255.
APPEND i_objpack.
Document information.
CLEAR i_reclist.
e-mail receivers.
i_reclist-receiver = w_email.
i_reclist-express = 'X'.
i_reclist-rec_type = 'U'. "Internet address
APPEND i_reclist.
sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = w_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. "processing
OTF to PDF
========================================================================
Program1
*& REPORT zpmm_print1
REPORT zpmm_print1.
DATA : gw_ssfcrescl TYPE ssfcrescl.
DATA: gt_otf TYPE STANDARD TABLE OF itcoo ,
gt_tline TYPE STANDARD TABLE OF tline,
gv_len LIKE sood-objlen,
gw_ssfctrlop TYPE ssfctrlop, "for CONTROL_PARAMETERS
gw_ssfcompop TYPE ssfcompop. "for OUTPUT_OPTIONS
DATA fm_name TYPE rs38l_fnam.
gw_ssfctrlop-getotf = 'X'.
gw_ssfctrlop-no_dialog = 'X'.
gw_ssfcompop-tdnoprev = 'X'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPMM_1'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
<error handling>
ENDIF.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = gw_ssfctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = gw_ssfcompop
user_settings = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = gw_ssfcrescl
JOB_OUTPUT_OPTIONS =
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.
gt_otf[] = gw_ssfcrescl-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_len
TABLES
otf = gt_otf
lines = gt_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = gv_len
filename = gv_filename
filetype = 'BIN'
filetype_no_show = 'X'
IMPORTING
act_filename = gv_filename
filesize = gv_len
cancel = ''
TABLES
data_tab = gt_tline.
Program 2
*& REPORT zpmm_print2
REPORT zpmm_print2.
DATA : gw_ssfcrescl TYPE ssfcrescl.
DATA: gt_otf TYPE STANDARD TABLE OF itcoo ,
gt_tline TYPE STANDARD TABLE OF tline,
gv_len LIKE sood-objlen,
gw_ssfctrlop TYPE ssfctrlop, "for CONTROL_PARAMETERS
gw_ssfcompop TYPE ssfcompop. "for OUTPUT_OPTIONS
DATA fm_name TYPE rs38l_fnam.
gw_ssfctrlop-getotf = 'X'.
gw_ssfctrlop-no_dialog = 'X'.
gw_ssfcompop-tdnoprev = 'X'.
CALL FUNCTION '/1BCDWB/SF00000041'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = gw_ssfctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = gw_ssfcompop
user_settings = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
job_output_info = gw_ssfcrescl
JOB_OUTPUT_OPTIONS =
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.
gt_otf[] = gw_ssfcrescl-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_len
TABLES
otf = gt_otf
lines = gt_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 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.
DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
bin_filesize = gv_len
filename = gv_filename
filetype = 'BIN'
filetype_no_show = 'X'
IMPORTING
act_filename = gv_filename
filesize = gv_len
cancel = ''
TABLES
data_tab = gt_tline.
=========================================================================
Cheers
Mohinder Singh Chauhan -
When I print a Word for Mac document to a shared printer (that is connected to my iMac) from my Macbook Pro, print preview looks fine but the printed page has too much blank space at the top and doesn't print the bottom few lines. I have tried to adjust the margins and the page setup settings but to no avail. It used to print fine until recently. Is there a way to fix it so that the printer prints what print preview shows?
I should add that when I e-mail this document to myself and print it directky from the iMac, it prints fine.
-
Problem with smartform print preview.
Hi Experts,
i have an rare problem i have requirement of sending PO smartform mail as pdf ,and the smartform is configued to nace, and the tcode is me23n.
we checked it in development server everything went on well,and mail was sent without any error, after moving object to quality,
we tested in the same process as in development, instead of mail 'Print preview' button was popped up.
is it something to do with NACE config or to do with my code ?Hi Prakash,
As Mohit said default printer is not yet set for your user in QAL and on print preview screen output device field is mandatory that is why the pop up for print preview is coming.
follow path given by Mohit and I think the pop up will not come again.
Regards,
Siddhesh Satghare. -
Problem with Print Preview and Print events
Hello Experts,
We have developed a program, in which, I m trying to display the % values in the Sub Totals and Grand Total lines, The logic and program functionality is performing very well. The report is displaying the output the way end user is willing to see.
The main problem is, the entire % values are going to a toss when we click the Print Preview or trying to print the report, which is not supposed to go that way. I have even tried to debug the program where the problem is evolving in the code, but it is not raised from the code.
Please refer to the screen shots.Before clicking the Print Preview and after clicking the print preview.
Do anybody face the same kind of problem ever?
If so please let me know what could be the best possible solution.
Thanks & Regards
Harish Kumar MKHi Harish,
I have use the below code but not for percentage... I think for percentage you just have to calculate the normal percentage and replace it with a subtotal value.
This is not your complete code it will be better if you mail your complete code so that i can debug and check.
TABLES: vbak.
TYPE-POOLS: slis. " ALV Global types
SELECT-OPTIONS :
s_vkorg FOR vbak-vkorg, " Sales organization
s_kunnr FOR vbak-kunnr, " Sold-to party
s_vbeln FOR vbak-vbeln. " Sales document
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
DATA:
BEGIN OF gt_vbak OCCURS 0,
vkorg LIKE vbak-vkorg, " Sales organization
kunnr LIKE vbak-kunnr, " Sold-to party
vbeln LIKE vbak-vbeln, " Sales document
netwr LIKE vbak-netwr, " Net Value of the Sales Order
waerk LIKE vbak-waerk, " Document currency
END OF gt_vbak.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
* Form f_read_data
FORM f_read_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
FROM vbak
UP TO p_max ROWS
WHERE kunnr IN s_kunnr
AND vbeln IN s_vbeln
AND vkorg IN s_vkorg.
ENDFORM. " F_READ_DATA
* Form f_display_data
FORM f_display_data.
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = 'VBAK'.
ls_fieldcat-do_sum = &2.
ls_fieldcat-cfieldname = &3.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-subtot = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
ls_layout TYPE slis_layout_alv.
m_fieldcat 'VKORG' '' ''.
m_fieldcat 'KUNNR' '' ''.
m_fieldcat 'VBELN' '' ''.
m_fieldcat 'NETWR' 'X' 'WAERK'.
m_fieldcat 'WAERK' '' ''.
m_sort 'VKORG' 'X'. " Sort by vkorg and subtotal
m_sort 'KUNNR' 'X'. " Sort by kunnr and subtotal
m_sort 'VBELN' ''. " Sort by vbeln
ls_layout-cell_merge = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
TABLES
t_outtab = gt_vbak.
ENDFORM. " F_DISPLAY_DATA
BR
Sumeet -
Convert OTF along with Print preview in SAP Script
Hello All,
I was getting a print Preview for the sap script, now with the new requirement, I had to capture otf data too in OPEN_FORM. so I have added "TDGETOTF = X", and that gives me otf data which I am converting it to PDF. now the problem is I am not getting preview anymore. my requirement is to have both, Preview and otf data. I have tired serching in forums and also used a function module SSFCOMP_PDF_PREVIEW, but no luck. what am I missing here. Please suggest.
Thanks-
TDPAGESLCT
TDCOPIES 1
TDDEST LOCL
TDPRINTER
TDPREVIEW X
TDNOPREV
TDNOPRINT
TDNEWID X
TDDATASET SAP11
TDSUFFIX1 LOCL
TDSUFFIX2 1000
TDIMMED
TDDELETE
TDLIFETIME 7
TDSCHEDULE
TDSENDDATE 00000000
TDSENDTIME 000000
TDTELELAND
TDTELENUM
TDTITLE
TDTEST
TDPROGRAM
TDSCRNPOS 000000000000000
TDCOVER D
TDCOVTITLE
TDRECEIVER ABCDEFGH
TDDIVISION
TDAUTORITY
TDARMOD
TDIEXIT
TDGETOTF X
TDFAXUSER
TDRDIDEV
TDNOARMCH
TDFINAL
RQPOSNAME
BCS_REQST
BCS_STATUSMaybe you can call the form twice - once with tdgetotf = 'X', the second time with it blank.
Maybe you are looking for
-
App File Server connection error when trying to run a BI Publisher report..
hello Gurus... As above - App File Server connection error when trying to run a BI Publisher report.. FOR THE FIRST TIME. What does our DBA need to do..? error message reads.. Template code: SUARXASR Template app: AR Language: en Territory:
-
Aperture 3 library from pre Maverick to Maverick
I made a backup from all my files including my Aperture library. After moving to Mavericks (clean install), there is a new Aperture version and I am not able to import my old library getting the message: Library was made with older version of Apertur
-
IBAN,Bank type" feild in Paymnt trancs of Gener data in Custo Master
need of payment transactions tab in customer master can anyone of SAP GURUS guide me in this area purpose of this feild and in what sense we can use the feild with 1 real time example regds
-
Excel charset issue. Scrambled output.
I faced this issue many times, but whenever the issue recurs, I end up with no clue of what's going wrong. Trying to dump data to an excel file: iResponse.setHeader("application/vnd.ms-excel; charset=UTF-8", "content-type");
-
NetBeans 6.1: Build project but always report Tomcat failed
I recently try to use NetBeans and do a simple app following tutorial. When I build, it warns Tomcat unable to open due to port 8080 has been used by others. I actually have Tomcat running on my computer, I wonder if NetBeans can skip the startup of