Chinese characters merging in Mail PDF attachment
Hi, I am coverting the ouput of transaction S_ALR_87012976 for a change number into PDF and sending through mail. This is OK for all languages but for Chinese I can see the characters properly but lower row characters are merging with upper row characters. Means I can see the chinese caracters but the missing the format or very few times I am gettin # as chinese characters. I am doing the below things to do this job, suggest me if I am wrong any where.
Creating the spool with the report output using SUBMIT program
SUBMIT rcc00130 WITH SELECTION-TABLE zscreen TO SAP-SPOOL
SPOOL PARAMETERS g_print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB g_name NUMBER g_number
AND RETURN.
I am converting the spool to PDF using FM 'CONVERT_ABAPSPOOLJOB_2_PDF' then for 255 character allignment I am using below FM
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = '134'
line_width_dst = '255'
TABLES
content_in = i_pdf[]
content_out = it_mess_att[]
Then using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' I am sending the mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = s_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
contents_txt = i_objtxt
contents_bin = it_mess_att
receivers = i_reclist
Hi Avinash,
Thanks for the reply. In my system (ECC 6.0) I am not seeing the devicetype as you mentioned but I passed one of chinese device type ZHANWIN in print parameters of SUBMIT for creating spool but issue not resolved. Is there any other way??
Similar Messages
-
Problem with chinese characters while sending mail with .CSV attachment
Hi,
i am sendin .CSV file as an attachment with mail using "SO_DOCUMENT_SEND_API1" FM,
whle opening the mail attachment the chinese characters are not displaying properly.
currently i am using ECC 5.0
can any body help in this regard.
Thanks,
RahimHi Kang Ring,
please convert the content of the attachement into the binary format and then add it as a mail attachment.
LOOP AT i_data ASSIGNING <wa_data>.
if s_output is INITIAL.
CONCATENATE <wa_data> cl_abap_char_utilities=>cr_lf into s_output.
else.
CONCATENATE s_output <wa_data> INTO s_output SEPARATED BY cl_abap_char_utilities=>cr_lf.
endif.
ENDLOOP.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = s_output
IMPORTING
buffer = x_output.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = x_output
TABLES
binary_tab = imail_att.
OR
please use ABAP-Object classes like CL_BCS , CL_document_BCS.....
please findthe below sample code.
cl_bcs_convert=>string_to_solix(
EXPORTING
iv_string = s_output
iv_codepage = '4103' "suitable for MS Excel, leave empty
iv_add_bom = 'X' "for other doc types
IMPORTING
et_solix = s_output_binary "(of type solix_tab)
ev_size = size ).
attachment->add_attachment( "attachment of type ref to cl_document_bcs
i_attachment_type = 'xls'
i_attachment_subject = l_subject
i_attachment_size = size
i_att_content_hex = s_output_binary ).
you need to write the code for adding the receipents, subject and adding this "attachment " as an attachment to the mail.
Hope this will helps to you....,
thanks,
Rahim. -
STO mail : pdf attachment has an error 'file damage' when try to open it
Dear expert,
I need to send an e-mail to the vendor with the sto list as attachment at the email.
I managed to send email to external addresee and made the pdf attachment, BUT somehow when I open the attachment it has an error says "Adobe Reader could not open xx.pdf because it is either not a supported file type or because the file has been damaged(for axample, it was sent as an email attachment and wasn't corectly decoded)."
Really need your experties to help me. Here is my abap coding to send email and do the pdf attachment at the new ouptput type to send email.
TYPES: BEGIN OF lty_drad,
doknr TYPE drad-doknr,
END OF lty_drad,
BEGIN OF lty_recpt,
smtp_addr TYPE ad_smtpadr,
END OF lty_recpt.
DATA: lt_doc TYPE STANDARD TABLE OF docs,
lt_recpt TYPE STANDARD TABLE OF lty_recpt,
lt_tline LIKE tline OCCURS 0 WITH HEADER LINE,
lt_data TYPE solix_tab,
lt_docu TYPE STANDARD TABLE OF lty_drad,
lt_docfiles TYPE STANDARD TABLE OF bapi_doc_files2,
lw_tline LIKE LINE OF lt_tline,
lw_docu LIKE LINE OF lt_docu,
lw_docfiles LIKE LINE OF lt_docfiles,
lw_objdes TYPE tnati-objdes,
lt_text TYPE bcsy_text,
lw_recpt TYPE adr6-smtp_addr,
lw_adrnr TYPE lfa1-adrnr,
lw_object TYPE drad-objky,
lw_doknr TYPE drad-doknr,
lw_return TYPE bapiret2,
lw_xcontent TYPE xstring,
client TYPE REF TO if_http_client,
url TYPE string,
lw_subrc TYPE sysubrc,
response TYPE REF TO if_http_response,
lw_message1 TYPE string,
sent_to_all TYPE os_boolean,
bin_filesize type i.
CONSTANTS: lc_dokar_srm TYPE drad-dokar VALUE 'SRM',
lc_type TYPE so_obj_tp VALUE 'RAW'.
CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: exception_info TYPE REF TO if_os_exception_info,
bcs_exception TYPE REF TO cx_bcs.
RANGES: lr_po_pr FOR drad-objky.
DATA: lw_banfn TYPE ekpo-banfn,
lw_bnfpo TYPE ekpo-bnfpo.
IF nast-nacha = '5'. "8
Create recipient and check if exist
Get email ID
start commented by sapnislina 21.12.06
SELECT SINGLE adrnr FROM lfa1 INTO lw_adrnr
WHERE lifnr = p_ekko-lifnr.
IF sy-subrc NE 0.
PERFORM protocol_update
USING '303' 'Address of Vendor:' ekko-lifnr 'not found' space
p_retco = sy-subrc.
EXIT.
ENDIF.
end commented by sapnislina 21.12.06
SELECT smtp_addr INTO CORRESPONDING FIELDS OF TABLE lt_recpt
FROM adr6
WHERE addrnumber = p_ekko-adrnr. "lw_adrnr.
IF lt_recpt[] IS INITIAL.
PERFORM protocol_update
USING '303' 'Email address(es) does not exist for vendor'
p_ekko-lifnr space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
use_otf_mc_cmd = 'X'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = otfdata[]
doctab_archive = lt_doc
lines = lt_tline
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
PERFORM protocol_update
USING '303' 'PO Convertion from OTF to PDF failed'
space space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
Get object description from mail title of output types
SELECT SINGLE objdes INTO lw_objdes
FROM tnati
WHERE spras = sy-langu
AND kappl = nast-kappl
AND kschl = nast-kschl.
CONCATENATE lw_objdes ekko-ebeln INTO lw_objdes SEPARATED BY
space
DATA L_TXT(255) TYPE C.
DATA L_TXT2(255) TYPE C.
CONCATENATE 'STO' EKPO-EBELN 'Created for' EKPO-WERKS '/'
EKPO-LGORT
'Supply Plant' EKKO-RESWK into l_txt separated by space.
lw_objdes = l_txt.
CONCATENATE 'STO' EKKO-EBELN INTO L_TXT2 SEPARATED BY SPACE.
APPEND L_TXT2 TO LT_TEXT.
APPEND lw_objdes TO lt_text.
Instantiate
CLASS cl_cam_address_bcs DEFINITION LOAD.
CLASS cl_abap_char_utilities DEFINITION LOAD.
insert by sapnislina 22.12.06
DATA : CONTENT_OUT TYPE SOLIX,
LINE_WIDTH_SRC TYPE I,
POS_OUT TYPE I,
POS_IN TYPE I,
LEN_OUT TYPE I.
DATA OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF CONTENT_IN,
LINE TYPE TLINE,
DUMMY TYPE TLINE,
END OF CONTENT_IN.
TYPES PDF_RAW TYPE X LENGTH 268.
FIELD-SYMBOLS <PDF_BIN> TYPE PDF_RAW.
DESCRIBE FIELD CONTENT_IN-LINE LENGTH LINE_WIDTH_SRC IN BYTE MODE.
REFRESH lt_data.
CLEAR CONTENT_OUT.
POS_OUT = 0.
LOOP AT OTFDATA INTO CONTENT_IN-LINE.
ASSIGN CONTENT_IN TO <PDF_BIN> CASTING.
MOVE <PDF_BIN> TO CONTENT_OUT-LINE+POS_OUT.
ADD LINE_WIDTH_SRC TO POS_OUT.
WHILE POS_OUT >= 255.
APPEND CONTENT_OUT TO lt_data.
CLEAR CONTENT_OUT.
SUBTRACT 255 FROM POS_OUT.
IF POS_OUT > 0.
POS_IN = LINE_WIDTH_SRC - POS_OUT.
MOVE <PDF_BIN>+POS_IN TO CONTENT_OUT-LINE.
ENDIF.
ENDWHILE.
ENDLOOP.
IF POS_OUT > 0.
APPEND CONTENT_OUT TO lt_data.
ENDIF.
end inserted by sapnislina 22.12.06
starting to create attachment to mail
TRY.
CLEAR send_request .
Create persistent send request
send_request = cl_bcs=>create_persistent( ).
Build the document
document = cl_document_bcs=>create_document(
i_type = lc_type "RAW
i_text = lt_text "def of output type
i_length = '12'
i_subject = lw_objdes ).
Attached the document object
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = lw_objdes "definition of output
type
i_attachment_size = '12'
i_att_content_hex = lt_data.
completed first part to attached PO (pdf format) as attachment
Now attach the PO related attachments to the mail..
.... need to read from table DRAD and get all the attachment per PO
at run time
REFRESH: lr_po_pr."lt_return.
CLEAR: lr_po_pr,lw_return.
MOVE 'ICP' TO lr_po_pr.
CLEAR: lw_object.
completed second part for PO related attachments
Now prepare to send mail
Add document to send request
CALL METHOD send_request->set_document( document ).
Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
LOOP AT lt_recpt INTO lw_recpt
WHERE NOT smtp_addr IS INITIAL.
recipient = cl_cam_address_bcs=>create_internet_address(
lw_recpt ).
Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
CLEAR recipient.
ENDLOOP.
Send the document
CALL METHOD send_request->send
RECEIVING
result = sent_to_all.
Catch any exception
CATCH cx_bcs INTO bcs_exception.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = bcs_exception->msgid
msg_nr = bcs_exception->msgno
msg_ty = bcs_exception->msgty
msg_v1 = bcs_exception->msgv1
msg_v2 = bcs_exception->msgv2
msg_v3 = bcs_exception->msgv3
msg_v4 = bcs_exception->msgv4
EXCEPTIONS
OTHERS = 1.
p_retco = sy-subrc.
ENDTRY.
ENDIF.
IF NOT result-tdfaxid IS INITIAL OR " 422131
NOT result-tdmailid IS INITIAL. " 422131
CLEAR syst-msgv1. " 422131
IF NOT result-tdfaxid IS INITIAL. " 422131
syst-msgv1 = result-tdfaxid. " 422131
ELSEIF result-tdmailid IS INITIAL. " 422131
syst-msgv1 = result-tdmailid. " 422131
ENDIF. " 422131
CALL FUNCTION 'NAST_PROTOCOL_UPDATE' " 422131
EXPORTING " 422131
msg_arbgb = 'VN' " 422131
msg_nr = '095' " 422131
msg_ty = 'I' " 422131
msg_v1 = syst-msgv1 " 422131
EXCEPTIONS " 422131
OTHERS = 1. " 422131
ENDIF. " 422131
IF result-userexit EQ 'C' OR
result-userexit EQ 'E'.
p_retco = '9'.
ENDIF.
ENDFORM. " ENDE
end inserted
Regards
NislinaHi Nislina,
Could you please let me know how do you solve this issue.
Code:
if lt_binary[] is not initial.
* add attachment to document
call method document->add_attachment
exporting
i_attachment_type = 'PDF'
i_attachment_subject = 'My Attachment'
i_att_content_hex = lt_binary.
endif.
Thanks & Regard's
Sateesh -
Chinese Characters not display when PDF for marketing doc
Hi All,
I have typed in some Chinese Characters into a Print Layout Document.
I am able to print these documents with the Chinese characters. But I am not able to display these Chinese Characters when I click on PDF.
Please advise.
Rdgs
JessieHi Gordon,
I have applied the various asian language service pack for the Adobe Reader.
However, i am still not able to see the Chinese Characters in the PDF document when click on the PDF at SAP B1's Toolbar.
Step 1 : Update a PLD with Chinese Characters (as text or from database field). Eg. AR Invoice.
Step 2 : Set the PLD as Default Layout.
Step 3 : At AR Invoice, call out an existing Invoice, click on Preview. Chinese Character is able to be previewed and printed.
Convert to PLD.
Step 4 : At AR Invoice, call out an existing Invoice, click on PDF button at the Toolbar. Preview the PDF document. No Chinese Characters are displayed.
Is it due to Localisation? Localisation = Singapore
Please advise.
Regards
Jessie -
Getting thai characters as junk in PDF attachment of smart form
Hi All,
I have to send a smartform as PDF attachment, I am getting a PDF but column heading is in Thai so when i open the PDF they occur as junk characters where as english charcters are coming fine.
Can anyone sugest me wht i hv to do to view thai charcters in PDFHi All,
I have to send a smartform as PDF attachment, I am getting a PDF but column heading is in Thai so when i open the PDF they occur as junk characters where as english charcters are coming fine.
Can anyone sugest me wht i hv to do to view thai charcters in PDF -
Mail PDF attachment is not visible
I have just owned a new iPad 4th generation and using it with full energy.
I have a query and if anyone can guide me.
I have configured Gmail in the Mail of my iPad. Now when I am getting an e-bill from Airtel India for payment, the attached PDF bill copy is not there in the mail.
Is it that I have to change any settings, please advice.
Thanks and Regards.
scy123.You should see a paper clip icon next to the senders name in the preview window if there is an attachment in the email. If you do see the icon but can't see the PDF, quit mail, reboot and look again.
From your home screen. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the mail app icon. Tap the home button or anywhere above the task bar.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up. -
File to mail .pdf attachment
I have a scenario file to Mail and in the file vendor no 1234 then 1234.pdf in the file net. so when vendor no 1234 appears then i have to pick the 1234.pdf from filenet and attached to the mail. How can we do this scenario. Could you please help me this one.
and one more how can i add the link in the mail body. i did one file to mail scenario. body is not showing . that one also showing as attachment. how can i do this.
Advanced Thanks
Regards
SundherHi Sundher,
Hey configure a scenario like this File -> XI -> Mail. In this, u pick up the fiile using file adapter and send it to XI. For sending the files as an attachment, provide the MessageTransformationBean in the receiver mail adapter and pass the parameter 'ContentDispostion' with its value set as attchment.
For more details u can check the following link
<a href="https://websmp209.sap-ag.de/form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202&_OBJECT=011000358700004556712005E">https://websmp209.sap-ag.de/form/sapnet?_SHORTKEY=01200252310000071155&_SCENARIO=01100035870000000202&_OBJECT=011000358700004556712005E</a>
Regards,
Akshay -
Retrieve mail pdf attachment in xstrinf or otf format.
Hi,
as in the Subjesct I must retrieve from mail the attachments that are in pdf format and convert then in xstring or otf format, then archive the documents in DMS server.
It's possible?
Thanks for answers.Hi,
In SAP we execute function SX_OBJECT_CONVERT_OTF_PDF which generates binary context for a PDF document.
Or check the below code
data: l_pdf_xstring type xstring,
lt_lines type table of tline,
ls_line type tline,
l_pdf_len type i,
itab type TSFOTF,
witab type ITCOO,
tmp_line type STRING,
tmp_header type STRING.
tmp_header = 'BSP to PDF'.
tmp_line = file_content.
CONCATENATE
tmp_header
tmp_line
INTO tmp_line IN CHARACTER MODE.
APPEND tmp_line TO itab.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring
tables
otf = itab
lines = lt_lines
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
others = 5
if sy-subrc EQ 0.
response->set_header_field( name = 'content-type'
value = 'application/pdf' ).
response->set_header_field(
name = 'cache-control'
value = 'max-age=0' ).
response->set_header_field(
name = 'content-disposition'
value = 'attachment; filename=test.pdf' ).
l_pdf_len = xstrlen( l_pdf_xstring ).
response->set_data( data = l_pdf_xstring
length = l_pdf_len ).
navigation->response_complete( ).
ENDIF.
Edited by: Raj on Jul 26, 2010 2:02 PM -
Touchpad mail pdf attachment won't open
regular pdf downloads open ok but when attached to an e-mail an error pops up "can't read mime types". Any idea how I can make this work?
Post relates to: HP TouchPad (WiFi)Right-click on your attached PDF. Select Quick Look Attachment. This opens the PDF with Quick Look in another window. You can scroll your PDF or jump to individual page icons.
Otherwise, the in-place, attachment scroll is history. -
Send sales order as mail - pdf attachement - print data
hi folk,
When receiving a Sales Order as PDF document, the name of the document is called "Print data.PDF".
Is it possible to change this name to e.g. sales order number or something else.
Best regards
Linghi,
when I'am receiving the sales order as PDF file the "Subject" of the mail is shown the e.g. sales order number retrieved from the output communication method --> Cover page text --> "Sales order &XNAST-KSCHL&.
But my question is, how I can change the name of the PDF file which is now called "Print data.PDF" .
Best regards.
Ling -
Mail pdf attachment is showing/printing in black and white only
PDF attachments with color in content are now only appearing and printing in black and white. Is this a setting somewhere?
I have the same problem here. A PDF file created in Illustrator and sent to my client via email. I can see the color on my iPhone and on an iPad but under Lion (10.8.3) it displays in black and white. I was going to look at prior versions of the OSX and see that you are running 10.6? and are getting the same thing. I have received other PDF files with color and no problem. I am wondering if it an Illustrator and OSX problem. More to come.
-
Chinese characters are displaying as squares in mail subject & content
Hi when I am sending or receiving mail which is having Chinese characters in either mail subject or contents then some Chinese characters are appearing as squares.
This issue is only coming on single system (Window XP, outlook 2007)Hello,
Come back and mark the replies as answers if they help and unmark them if they provide no help.
I'm marking the reply as answer as there has been no update for a couple of days.
If you come back to find it doesn't work for you, please reply to us and unmark the answer.
Cara Chen
TechNet Community Support -
Canu2019t view Chinese characters in a PDF email attachment sent via SAP.
Canu2019t view Chinese characters in a PDF email attachment sent via SAP.
When open the Chinese characters come out funny.
Note: The document looks okay when previewed in SAP.
Tried the following:
FM CONVERT_OTF_2_PDF
CNSONG is one of our u201CSystem fontsu201D
Attempted with both ZH(Chinese simplified) and ZF(Chinese traditional) languages
Tried using a printer that is set up as u201CDevice Typeu201D PDF1
Tried using a printer that is set up as u201CDevice Typeu201D ZHKPDF
Tried passing device type as u201CCNSAPWINu201D
The following ADODE software was loaded: Chinese simplified, Chinese traditional,
Korean and JapaneseHi,
As a try, can you check this.
SET COUNTRY 'CN'. China country code.
SET LOCALE LANGUAGE 'CN'.
Thanks,
Vinod. -
Hi all,
I am sending some data by creating spool and then mailing it as a PDF attachment. However, when i get the PDF file through mail, I cannot see the Chinese characters. The document contains the information in English as well as Chinese. However only Chinese is not visible. The Font Familty CNSONG is present in SAP system. Let me know if any one has idea about this.
Thanks.
Warm regards,
Harshad. MHi,
Please check these links
Chinese characters dont show up on the PDF file
PDF can not display Chinese
Pdf conversion--unknown characters
There are many more conversations on SDN on the same. Please go through them too, if the above doesn't resolve.
Thanks,
Kiran -
Arabic and Chinese characters are showing ??? in PDF
Hi
I hava an application which calls BI publisher API to generate PDF file from rtf temlate and xml input. It is fine for English contents. But the Arabic or Chinese characters are showing ??? in PDF. If I use BI publisher Desktop to load the xml and generate pdf file, it shows correct Arabic/Chinese Characters in PDF. I also copied ALBANWTJ.ttf file to my application JAVA_HOME/jre/lib/fonts/ folder. But it still doesn't work. Anyone can help me with this?
Thanks a lot!I created xdo.cfg and put it in my JAVA_HOME/jre/lib/ folder. the file is configured as below:
<?xml version="1.0" encoding="UTF-8"?>
<config version="1.0.0" xmlns="http://xmlns.oracle.com/oxp/config/">
<properties>
<property name="system-temp-dir">/tmp</property>
</properties>
<fonts>
<font family="Default" style="normal" weight="normal">
<truetype path="/fonts/ALBANWTJ.ttf"/>
</font>
</fonts>
</config>
But now I'm getting this error while generating pdf file:
Adobe Reader could not open 'xxx.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).
Is there anything wrong in my xdo.cfg?
Thanks!
Maybe you are looking for
-
hi, I have an issue with loading custom compont based on title window. Problem is creating component take too many large time. This component based on TitleWindow. And it included 1.HBox which contain 15 buttons(actually it is also an separate compon
-
Working with images – Resizing, Add arrow & text boxes etc
I am using RH HTML for updating our Web application Help from RoboHelp V3 to V6. It involves lot of images. I found the picture quality good only using Word in the combination of RoboScreenCapture. I need to confirm that the method and steps for capt
-
About stock initializing and PGI
thanks every body for giving suggestion and i rewarded 1. yes i closed 2007/8 and 2007/7 period using MMPV 2. system date is todays date. and i have created new comp code ABC in IDES. but for company code 0001 or 1000 there is no pr
-
Hi there, Since some weeks all Photoshop Touch files (psdx) synced and viewed on my CC web account don't show anymore the interactive layers panel, the Kuler palette and they show wrong metadata such as document dimensions set as 500x500 pixels (some
-
the last update on my apple tv has been going on for like a week and i can't stop it even if i unplug it. it shows a pic of the tv connecting to iTunes, what do i do?