Smartforms - Convert to PDF always displying bold, ignoring styles and font
Hi out there,
I'm not new to smartforms. But after creating a new form within a new style I'm not able to design it.
But mayby it's designed correctly and only pdf conversion failed?
The courios thing is, that sometimes (hleve font is replayced with standard courier) and all the fonts are displayed in BOLD.
I also tried with standard sap styles, like hrforms etc...but the text is always displayed in BOLD.
I just wanna use helve 10,12 px bold and non bold. I'm sure, that the fonts are setr up with se73, cause i have used them in an other form and they never did any problems.
Regards,
T
i did a stupid misstake in getting the device.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = v_language
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = v_e_devtype.
tdprinter was not set properly!
Similar Messages
-
Separate program to send a smartform converted into pdf, thru mail
Hi Folks,
I had created a smartform and converted it into a PDF format.
Now I want a separate program where in if i submit this program it should sent it throuogh mail.
Note:-<b>I want a separate program not the one where in you design a smartform,convert into pdf and then send thru mail all in one program</b>
Points will be given.
K.Kiran.hi kiran
the program is as follows
The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = 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 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
navjot
reward if helpfull -
All my excel files were converted to pdf. Why would this happen and how do i stop it from doing so?
shloimypt wrote:
All my excel files were converted to pdf. Why would this happen and how do i stop it from doing so?
Relax, they weren't converted to PDF.
You can tell by right clicking ANY of them and choosing "Properties". You'll see there that they're STILL .xls or .xlsx files. The "association" has changed and Windows now indicates that they open with Reader, which isn't right.
Where it says "Open With" under the General tab, you can click "Change" and re-select Excel as the default app to open thim.
See: http://helpx.adobe.com/acrobat/kb/application-file-icons-change-acrobat.html -
Pls tell me how I can convert a PDF form to a Word doc, and have radio buttons etc work?
Pls tell me how I can convert a PDF form to a Word doc, and have radio buttons etc work? My PDF form did convert using Adobe PDF Export.... but the formatting is a schamozzle if I try to do anything with it. Most importantly, I need the check boxes and radio buttons to work in Word!
Checkboxes and radio buttons are form objects from Acrobat. There is no equivalent for these objects, with the way they were constructed, within Word.
I'm sorry for the inconvenience.
David -
friends, how to convert file written in Gothic letters to normal letters in Word pdf?
and also, how to convert an image of text to Word?Hi bulos solon,
I see that you have an ExportPDF subscription. Have you tried converting your PDF files, and found that the results aren't what you expect?
When you convert a PDF file to Word, the ExportPDF service does its best to match the font used in the PDF with one available in its font library. But, you don't get to choose a font for conversion. So, you could simply reformat the text in Word once the file has been converted.
As for converting a image of text (say, from a scanned document) from PDF to Word, that process actually happens with the ExportPDF service. It performs OCR (optical character recognition) by default. (You can disable OCR if you convert via Word, but not if you convert via the website).
I hope this has helped answer your questions. If not, please let us know!
Best,
Sara -
Problem in Smartform convert to PDF with special character
Hi ABAP Guru,
While convert smartforms to pdf.Some special character like ( - ) convert to ( # ).In development server there is no problem but the problem arise in quality.Please helpHi Palash,
Please use PDF! in print preview command field.. it will convert pdf file.
regards,
Thangam.P -
Uploading smartforms converted file (pdf) to BDS
Hi Experts,
I have the following requirements:
1. Convert the smartforms to pdf data.
2. Upload the file to (pdf data) to BDS.
I have no problem in step 1 but my concern is uploading the file to BDS directly after converting the otf data of the form to pdf. How can I upload the pdf data to BDS directly?
Points will be awarded. Thanks!
LeoHI
<u><i><b>1. Convert the smartforms to pdf data.</b></i></u>
Please check this code and replace the variables as per ur reqt.
This is the code which is working perfectly .
event handler for checking and processing user input and
for defining navigation
DATA: cached_response TYPE REF TO if_http_response.
DATA: response TYPE REF TO if_http_response.
DATA: guid TYPE guid_32.
generated result: PDF format
DATA: l_pdf_xstring TYPE xstring,
lt_lines TYPE TABLE OF tline,
ls_line TYPE tline,
l_pdf_len TYPE i.
DATA: lf_fm_name TYPE rs38l_fnam ,
e_ssfcrescl TYPE ssfcrescl,
lv_spool TYPE tsfspoolid,
e_ssfctrlop TYPE ssfctrlop,
e_ssfcompop TYPE ssfcompop.
DATA w_printer TYPE rspopname."user01-spld.
DATA:l_doc_output_info TYPE ssfcrespd, "#EC NEEDED
l_job_output_info TYPE ssfcrescl, "#EC NEEDED
l_job_output_options TYPE ssfcresop. "#EC NEEDED
DATA :l_devtype TYPE rspoptype.
Get the function module name of Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = '/BSHP/FW_SF_LIST_DEL'
variant = ' '
direct_call = ' '
IMPORTING
fm_name = lf_fm_name "/1BCDWB/SF00000084
EXCEPTIONS
no_form = 1
no_function_module = 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.
Set print parameters
e_ssfctrlop-no_dialog = 'X' .
Setting of output options
language
language = sy-langu.
TRANSLATE language TO UPPER CASE.
e_ssfctrlop-langu = language.
set control parameters to get the output format (OTF) from Smart Forms
e_ssfctrlop-no_dialog = 'X'.
e_ssfctrlop-getotf = 'X'.
get device type from language
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = language
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = l_devtype
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
error handling
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
set device type in output options
e_ssfcompop-tdprinter = l_devtype.
Call the func module of the Smartform
CALL FUNCTION lf_fm_name " '/1BCDWB/SF00000084'
EXPORTING
control_parameters = e_ssfctrlop
output_options = e_ssfcompop
user_settings = space
sf_werks = p_werks
sf_lifnr = p_lifnr
sf_matnr_low = s_matnr_low
sf_matnr_high = s_matnr_high
sf_vbeln_low = s_vbeln_low
sf_vbeln_high = s_vbeln_high
sf_lfdat_low = s_lfdat_low
sf_lfdat_high = s_lfdat_high
sf_vgbel_low = s_vgbel_low
sf_vgbel_high = s_vgbel_high
IMPORTING
document_output_info = l_doc_output_info
job_output_info = l_job_output_info
job_output_options = l_job_output_options
TABLES
gt_final_fi = gt_final
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.
Conversion of output format OTF into PDF format
now convert the final document (OTF format) into PDF format
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
IMPORTING
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring " binary file
TABLES
otf = l_job_output_info-otfdata
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.
CREATE OBJECT cached_response TYPE cl_http_response EXPORTING add_c_msg = 1.
l_pdf_len = XSTRLEN( l_pdf_xstring ).
cached_response->set_data( data = l_pdf_xstring
length = l_pdf_len ).
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = 'application/pdf' ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 180 ).
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url.
cl_http_server=>server_cache_upload( url = display_url
response = cached_response ).
ENDIF.
REGARDS
NAVJOT
REWARD IF HELPFULL -
Can you help me? a question of smartform convert to PDF file
when I do a smartform in Polish ,preview and print is ok.but when covert to pdf use report RSTXPDFT4,some words is wrong code(#).
Can you help me?hi,
if the data which is printing in # might be a included text or Text module if the text contains any " in the text delete that and again insert that with " i.e if we copy the text from word and paste them in the text editor in the print preview it shows correctly but in print it gets converted into #. I also faced this problem so that i came to know this. If it is not the case leave it.
Thanks,
Nethaji. -
Smartform convert to PDF dump - divide by zero
SAP Version 4.7 Enterprise
hello all,
i am trying to do somethign rather basic that is discussed in these forums many times: convert Samrtforms output to PDF. i used the suggested forms but came across a unique (i think) error. my problem is that when i run the CONVERT_OTF_2_PDF function i get a core dump with the error "divide by zero". reading the core dump i see that there appears to be a font issue in the form:
Code: Select all
055610 * non-proportional font
055620 * if charwidth is not equal the default PostScript charwidth,
055630 * print string with individual character positioning
055640 * WARNING: The unit used with PDFs (..) xx TJ command for individual
055650 * char positioning is 1 EM = 1/1000 fontsize!!!
055660 * ofs_em = 1000 * (charwidth / fontsize_twip)
055670 * WARNING: ...TJ moves current point to the LEFT of character
055680
055690 * set word spacing = 0
055700 PERFORM PDF_APPEND_STREAM USING '0 Tw'. "#EC NOTEXT
055710 IF CHARWIDTH < FONTINFO-DEF_SPACEWIDTH.
055780 * a positive value moves charpos to the LEFT!
055790 ELSE.
055800 * OTF character spacing is wider than PostScript default
> OFFSET_EM = 1000 * ( CHARWIDTH - FONTINFO-DEF_SPACEWIDTH )
055820 / FONTINFO-FONTSIZE_TW.
055830 PERFORM PDF_REM_LEAD_ZEROES_I USING 5 OFFSET_EM COORD.
055840 * a negative value moves charpos to the RIGHT!
needless to say this works perfectly when printing to paper. i am not using any non-stnadard fonts. the fonts are Arial with sizes of 6, 8, 10 and 12. any ideas? FYI, the code to call the functions is below. cheers,
james
Code: Select all
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = dev_typ
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
ctrl_params-no_dialog = 'X'.
ctrl_params-getotf = 'X'.
out_opt-tdnewid = 'X'.
out_opt-xsfcmode = 'X'.
out_opt-xsf = ' '.
out_opt-xdfcmode = 'X'.
out_opt-xdf = ' '.
out_opt-tdprinter = dev_typ.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ctrl_params
IMPORTING
job_output_info = job_info
TABLES
i_outtab = i_output
i_header = i_header
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.
p_otf[] = job_info-otfdata.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = l_bin_filesize
TABLES
otf = p_otf[]
doctab_archive = p_doctab[]
lines = p_lines[]
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 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.SAP Version 4.7 Enterprise
hello all,
i am trying to do somethign rather basic that is discussed in these forums many times: convert Samrtforms output to PDF. i used the suggested forms but came across a unique (i think) error. my problem is that when i run the CONVERT_OTF_2_PDF function i get a core dump with the error "divide by zero". reading the core dump i see that there appears to be a font issue in the form:
Code: Select all
055610 * non-proportional font
055620 * if charwidth is not equal the default PostScript charwidth,
055630 * print string with individual character positioning
055640 * WARNING: The unit used with PDFs (..) xx TJ command for individual
055650 * char positioning is 1 EM = 1/1000 fontsize!!!
055660 * ofs_em = 1000 * (charwidth / fontsize_twip)
055670 * WARNING: ...TJ moves current point to the LEFT of character
055680
055690 * set word spacing = 0
055700 PERFORM PDF_APPEND_STREAM USING '0 Tw'. "#EC NOTEXT
055710 IF CHARWIDTH < FONTINFO-DEF_SPACEWIDTH.
055780 * a positive value moves charpos to the LEFT!
055790 ELSE.
055800 * OTF character spacing is wider than PostScript default
> OFFSET_EM = 1000 * ( CHARWIDTH - FONTINFO-DEF_SPACEWIDTH )
055820 / FONTINFO-FONTSIZE_TW.
055830 PERFORM PDF_REM_LEAD_ZEROES_I USING 5 OFFSET_EM COORD.
055840 * a negative value moves charpos to the RIGHT!
needless to say this works perfectly when printing to paper. i am not using any non-stnadard fonts. the fonts are Arial with sizes of 6, 8, 10 and 12. any ideas? FYI, the code to call the functions is below. cheers,
james
Code: Select all
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = sy-langu
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = dev_typ
EXCEPTIONS
no_language = 1
language_not_installed = 2
no_devtype_found = 3
system_error = 4
OTHERS = 5.
ctrl_params-no_dialog = 'X'.
ctrl_params-getotf = 'X'.
out_opt-tdnewid = 'X'.
out_opt-xsfcmode = 'X'.
out_opt-xsf = ' '.
out_opt-xdfcmode = 'X'.
out_opt-xdf = ' '.
out_opt-tdprinter = dev_typ.
CALL FUNCTION fm_name
EXPORTING
control_parameters = ctrl_params
IMPORTING
job_output_info = job_info
TABLES
i_outtab = i_output
i_header = i_header
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.
p_otf[] = job_info-otfdata.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = l_bin_filesize
TABLES
otf = p_otf[]
doctab_archive = p_doctab[]
lines = p_lines[]
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 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. -
The file is damaged and could not be repaired when smartforms convert to pdf
i m using your code but error is occur
please help me
when i goto sost and open my pdf file at that time give error message
my whole program is below
report ypayment_advice2.
tables : bsak,skat.
types : begin of t_bsak,
belnr type bsak-belnr,
gjahr type bsak-gjahr,
augbl type bsak-augbl,
augdt type bsak-augdt,
xblnr type bsak-xblnr,
bldat type bsak-bldat,
* DMBTR TYPE BSAK-DMBTR,
* WAERS TYPE BSAK-WAERS,
lifnr type bsak-lifnr,
saknr type bsak-saknr,
budat type bsak-budat,
* EBELN TYPE BSAK-EBELN,
* EBELP TYPE BSAK-EBELP,
bukrs type bsak-bukrs,
buzei type bsak-buzei,
ebeln type bseg-ebeln,
ebelp type bseg-ebelp,
hkont type bseg-hkont,
shkzg type bseg-shkzg,
werks type bseg-werks,
dmbtr type bseg-dmbtr,
bldat1 type bsak-bldat,
xblnr1 type bsak-xblnr,
end of t_bsak.
types : begin of t_bseg,
belnr type bseg-belnr,
gjahr type bseg-gjahr,
ebeln type bseg-ebeln,
ebelp type bseg-ebelp,
hkont type bseg-hkont,
shkzg type bseg-shkzg,
werks type bseg-werks,
dmbtr type bseg-dmbtr,
end of t_bseg.
types : begin of t_bseg2,
belnr type bseg-belnr,
gjahr type bseg-gjahr,
ebeln type bseg-ebeln,
ebelp type bseg-ebelp,
werks type bseg-werks,
end of t_bseg2.
types : begin of t_bseg1,
augbl type bseg-augbl,
gjahr type bseg-gjahr,
hkont type bseg-hkont,
end of t_bseg1.
types : begin of t_bkpf,
bukrs type bkpf-bukrs,
cpudt type bkpf-cpudt,
blart type bkpf-blart,
usnam type bkpf-usnam,
budat type bkpf-budat,
end of t_bkpf.
types : begin of t_bsak1,
lifnr type bsak-lifnr,
end of t_bsak1.
*DATA : IT_FINAL TYPE STANDARD TABLE OF T_FINAL WITH HEADER LINE.
*DATA : WA_FINAL TYPE T_FINAL.
data : wrk_answer type c.
data : it_bsak type standard table of t_bsak.
data : wa_bsak type t_bsak.
data : it_bsak_temp type standard table of t_bsak1 with header line,
wa_bsak_temp type t_bsak1.
data : it_bsak_temp1 type standard table of t_bsak1 with header line,
wa_bsak_temp1 type t_bsak1.
data : it_bsak1 type standard table of t_bsak.
data : wa_bsak1 type t_bsak.
data : it_bseg type standard table of t_bseg.
data : wa_bseg type t_bseg.
data : it_bseg1 type standard table of t_bseg1.
data : wa_bseg1 type t_bseg1.
data : it_bseg2 type standard table of t_bseg2.
data : wa_bseg2 type t_bseg2.
data : it_bkpf type standard table of t_bkpf.
data : wa_bkpf type t_bkpf.
data : l_cntr type i value 1.
data : op type ssfcompop.
data : control type ssfctrlop.
data: formname1 type tdsfname," value 'YPAYMENT_ADVICE',
fm_name type rs38l_fnam.
data : i_smtp_addr type adr6-smtp_addr,
i_adrnr type lfa1-adrnr.
data: gd_recsize type i.
data : it_tsp01 type standard table of tsp01 with header line .
data : it_pdf like tline occurs 0 with header line .
data : gd_buffer type string.
data: gd_spool_nr like tsp01-rqident,
gd_destination like rlgrap-filename,
gd_bytecount like tst01-dsize.
data: gd_subject like sodocchgi1-obj_descr,
it_mess_bod like solisti1 occurs 0 with header line,
it_mess_att like solisti1 occurs 0 with header line,
gd_sender_type like soextreci1-adr_typ,
gd_attachment_desc type so_obj_nam,
gd_attachment_name type so_obj_des.
data : w_emailid type adr6-smtp_addr.
* JOB RUNTIME PARAMETERS
data: gd_eventid like tbtcm-eventid,
gd_eventparm like tbtcm-eventparm,
gd_external_program_active like tbtcm-xpgactive,
gd_jobcount like tbtcm-jobcount,
gd_jobname like tbtcm-jobname,
gd_stepcount like tbtcm-stepcount,
gd_error type sy-subrc,
gd_reciever type sy-subrc.
data: t_otfdata type soli_tab,
t_otfdata_item type soli_tab,
t_objhex type solix_tab,
t_objhead type soli_tab,
w_transfer type sx_boolean,
w_length type sood-objlen,
w_length_item type sood-objlen,
w_lines_txt type i,
w_lines_bin type i,
wa_soli type soli,
wa_solix type solix,
w_doc_chng type sodocchgi1,
t_objcont type standard table of soli with header line,
t_objcont_item type standard table of soli with header line,
t_objpack like sopcklsti1 occurs 0 with header line,
t_reclist like somlreci1 occurs 0 with header line,
t_objtxt like solisti1 occurs 0 with header line.
data : ls_control type ssfctrlop,
ls_output type ssfcrescl,
ls_output_opt type ssfcompop,
lt_lines type table of tline,
lt_linesx type table of tdline.
data : lv_pdf type xstring,
lv_filelen type i,
lv_file type string.
selection-screen begin of block b1 with frame title text-001.
select-options : p_lifnr for bsak-lifnr.
select-options : p_augbl for bsak-augbl obligatory,
p_year for bsak-gjahr obligatory.
* P_BUDAT FOR BSAK-BUDAT.
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform process_data .
perform call_smartforms.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
form get_data .
select augbl gjahr budat xblnr
from bsak
into corresponding fields of table it_bsak1
where augbl in p_augbl
and gjahr in p_year
and blart = 'KZ'
and lifnr in p_lifnr.
if sy-subrc <> 0.
message 'No Record Found ' type 'E'.
endif.
select augbl augdt belnr gjahr xblnr
dmbtr lifnr saknr budat bukrs buzei
from bsak
into corresponding fields of table it_bsak
for all entries in it_bsak1
where augbl = it_bsak1-augbl
and augdt = it_bsak1-budat
and blart = 'RE'.
* FOR ALL ENTRIES IN IT_BSAK
* WHERE AUGBL = '1500000011' "IT_BSAK-AUGBL
* AND GJAHR = '2013' "IT_BSAK-GJAHR
* AND BLART = 'RE'.
select belnr gjahr shkzg dmbtr koart
from bseg
into corresponding fields of table it_bseg
for all entries in it_bsak
where belnr = it_bsak-belnr
and gjahr = it_bsak-gjahr
and koart = 'K'.
* AND BUKRS = IT_BSAK-BUKRS.
* AND BUZEI = IT_BSAK-BUZEI.
select belnr gjahr hkont
from bseg
into corresponding fields of table it_bseg1
for all entries in it_bsak1
where belnr = it_bsak1-augbl
and gjahr = it_bsak1-gjahr
and koart = 'S'.
select belnr gjahr ebeln ebelp werks
from bseg
into corresponding fields of table it_bseg2
for all entries in it_bseg
where belnr = it_bseg-belnr
and gjahr = it_bseg-gjahr
and buzid = 'W'.
* BREAK ABAP.
select bukrs cpudt blart usnam budat
from bkpf
into corresponding fields of table it_bkpf
for all entries in it_bsak
where belnr = it_bsak-belnr
and gjahr = it_bsak-gjahr.
* AND BUKRS = IT_BSAK-BUKRS
loop at it_bsak into wa_bsak.
read table it_bseg into wa_bseg with key belnr = wa_bsak-belnr
gjahr = wa_bsak-gjahr.
if sy-subrc = 0.
move wa_bseg-shkzg to wa_bsak-shkzg.
move wa_bseg-dmbtr to wa_bsak-dmbtr.
modify it_bsak from wa_bsak transporting shkzg dmbtr.
endif.
read table it_bseg2 into wa_bseg2 with key belnr = wa_bsak-belnr
gjahr = wa_bsak-gjahr.
if sy-subrc = 0.
move wa_bseg2-ebeln to wa_bsak-ebeln.
move wa_bseg2-ebelp to wa_bsak-ebelp.
move wa_bseg2-werks to wa_bsak-werks.
modify it_bsak from wa_bsak transporting ebeln ebelp werks .
endif.
read table it_bseg1 into wa_bseg1 with key gjahr = wa_bsak-gjahr.
if sy-subrc = 0.
move wa_bseg1-hkont to wa_bsak-hkont.
modify it_bsak from wa_bsak transporting hkont where gjahr = wa_bsak-gjahr.
endif.
read table it_bsak1 into wa_bsak1 with key augbl = wa_bsak-augbl
gjahr = wa_bsak-gjahr.
if sy-subrc = 0.
move wa_bsak1-bldat to wa_bsak-bldat1.
move wa_bsak1-xblnr to wa_bsak-xblnr1.
modify it_bsak from wa_bsak transporting bldat1 xblnr1 where augbl = wa_bsak-augbl
and gjahr = wa_bsak-gjahr.
endif.
endloop.
loop at it_bsak into wa_bsak.
move wa_bsak-lifnr to wa_bsak_temp-lifnr.
append wa_bsak_temp to it_bsak_temp .
endloop.
loop at it_bsak_temp into wa_bsak_temp.
collect wa_bsak_temp into it_bsak_temp1.
endloop.
endform. " GET_DATA
*& Form PROCESS_DATA
* text
* --> p1 text
* <-- p2 text
form process_data .
export it_bsak to memory id 'IT_BSAK'.
export it_bseg to memory id 'IT_BSEG'.
export it_bkpf to memory id 'IT_BKPF'.
* BREAK ABAP.
endform. " PROCESS_DATA
*& Form CALL_SMARTFORMS
* text
* --> p1 text
* <-- p2 text
form call_smartforms .
* LOOP AT IT_BSAK_TEMP.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'YPAYMENT_ADVICE1'
importing
fm_name = fm_name.
* CALL FUNCTION FM_NAME"'/1BCDWB/SF00000442'
* EXPORTING
* P_LIFNR = IT_BSAK_TEMP-LIFNR.
call function fm_name"'/1BCDWB/SF00000442'
exporting
it_bsak = it_bsak
it_bseg = it_bseg
it_bkpf = it_bkpf.
clear wrk_answer.
* BREAK ABAP.
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = 'LOGOFF'
* DIAGNOSE_OBJECT = ' '
text_question = 'Do You Want Send Mail?'
text_button_1 = 'YES'
* ICON_BUTTON_1 = ' '
text_button_2 = 'NO'
display_cancel_button = space
start_column = 25
start_row = 6
importing
answer = wrk_answer
* TABLES
* PARAMETER =
exceptions
text_not_found = 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.
*Mail send coding
check wrk_answer = '1'.
loop at it_bsak_temp1 into wa_bsak_temp1.
break abap.
select single adrnr from lfa1
into i_adrnr where lifnr = wa_bsak_temp1-lifnr.
select single smtp_addr from adr6
into w_emailid
where addrnumber = i_adrnr.
if w_emailid is not initial.
perform mail.
else.
message 'E-Mail Address is not maintained for Vendor' type 'S'.
endif.
endloop.
endform. " CALL_SMARTFORMS
*& Form SEND_EMAIL
* text
* -->P_P_EMAIL1 text
form send_email using p_email.
check not ( p_email is initial ).
refresh it_mess_bod.
*BREAK-POINT.
* DEFAULT SUBJECT MATTER
gd_subject = 'SUBJECT'.
gd_attachment_desc = 'Invoice '.
* CONCATENATE 'ATTACH_NAME' ' ' INTO GD_ATTACHMENT_NAME.
it_mess_bod = 'Hi,'.
append it_mess_bod.
it_mess_bod = 'Kindly Find an attached copy of Sale Invoice : '.
concatenate it_mess_bod p_lifnr into it_mess_bod separated by space.
append it_mess_bod.
it_mess_bod = 'This is system generated Mail,So do not reply.'
append it_mess_bod.
it_mess_bod = 'Thank you,'.
append it_mess_bod.
it_mess_bod = 'Gokul Refoils & Solvent Ltd.'.
append it_mess_bod.
data : p_sender type somlreci1-receiver.
p_sender = '[email protected]'
* IF NO SENDER SPECIFIED - DEFAULT BLANK
if p_sender eq space.
gd_sender_type = space.
else.
gd_sender_type = 'INT'.
endif.
* SEND FILE BY EMAIL AS .XLS SPEADSHEET
perform send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Narendra CHECK Invoice-Gokul Refoils & Solvent Ltd.'
*'Sale Invoice .pdf document attached'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
endform. " SEND_EMAIL
* & FORM SEND_FILE_AS_EMAIL_ATTACHMENT
* TEXT
* -->P_IT_MESS_BOD TEXT
* -->P_IT_MESS_ATT TEXT
* -->P_P_EMAIL TEXT
* -->P_1395 TEXT
* -->P_1396 TEXT
* -->P_GD_ATTACHMENT_NAME TEXT
* -->P_GD_ATTACHMENT_DESC TEXT
* -->P_P_SENDER TEXT
* -->P_GD_SENDER_TYPE TEXT
* <--P_GD_ERROR TEXT
* <--P_GD_RECIEVER TEXT
form send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing perror
p_reciever.
data:ld_error type sy-subrc,
ld_reciever type sy-subrc,
ld_mtitle like sodocchgi1-obj_descr,
ld_email like somlreci1-receiver,
ld_format type so_obj_tp ,
ld_attdescription type so_obj_nam ,
ld_attfilename type so_obj_des ,
ld_sender_address like soextreci1-receiver,
ld_sender_address_type like soextreci1-adr_typ,
ld_receiver like sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_receivers1 like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* FILL THE DOCUMENT DATA.
w_doc_data-doc_size = 1.
* POPULATE THE SUBJECT/GENERIC MESSAGE ATTRIBUTES
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* FILL THE DOCUMENT DATA AND GET SIZE OF ATTACHMENT
*BREAK-POINT.
clear w_doc_data.
read table it_attach index w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + strlen( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
clear t_attachment.
refresh t_attachment.
t_attachment[] = it_attach[].
* DESCRIBE THE BODY OF THE MESSAGE
clear t_packing_list.
refresh t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
describe table it_message lines t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
append t_packing_list.
* CREATE ATTACHMENT NOTIFICATION
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
describe table t_attachment lines t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
append t_packing_list.
* ADD THE RECIPIENTS EMAIL ADDRESS
clear t_receivers.
refresh t_receivers.
t_receivers-receiver = w_emailid.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
append t_receivers.
** CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
** EXPORTING
** DOCUMENT_DATA = W_DOC_DATA
** PUT_IN_OUTBOX = 'X'
** COMMIT_WORK = 'X'
** TABLES
** PACKING_LIST = T_PACKING_LIST
** CONTENTS_BIN = T_ATTACHMENT
** CONTENTS_TXT = IT_MESSAGE
** RECEIVERS = T_RECEIVERS
** 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.
** COMMIT WORK.
** LOOP AT T_RECEIVERS.
** LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
** ENDLOOP.
**ENDFORM. "SEND_FILE_AS_EMAIL_ATTACHMENT
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
importing
sent_to_all = w_sent_all
tables
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
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.
* POPULATE ZERROR RETURN CODE
ld_error = sy-subrc.
* POPULATE ZRECEIVER RETURN CODE
loop at t_receivers.
ld_receiver = t_receivers-retrn_codeNot sure if the flollowing will be of use, but worth a try?…
Try changing the .ai to .eps or .pdf to see if anything happens to see if it makes a difference to importing or exporting as a pdf?
If you have Indesign, try importing the file into Indesign then saving that file as a pdf or/and export as a Indesign eps file.
Sorry I cannot be of any more assistance.
Good luck! -
Converting from PDF directly to Java Objects/XML (and PDF format questions)
Hi,
I posted this originally in the Acrobat Windows forums but was told I might have more luck here, so here goes:
I am desperately trying to find a tool (preferably open source but commercial is fine also) that will sit on top of a PDF and allow me to query it's text for content and formatting (I don't care about images). I have found some tools that get me part of the way there, but nothing that seems to provide an end-to-end solution but is quite lightweight. My main question is WHY are there so many tools that go from PDF to RTF, and many tools that go from RTF to XML, but NONE that I can find that go PDF to XML.
To clarify, by formatting I simply mean whether a line/block of text is bold/italic, and its font size. I am not concerned with exact position on the page. The background is that I will be searching PDFs and assigning importance to whether text is a heading/bodytext etc. We already have a search tool in place so implementing a pure PDF search engine is not an option. I need a lightweight tool that simply allows me to either make calls directly to the PDF OR converts to XML which I can parse.
Some tools I have tried:
1) PDFBox (Java Library) - Allows the extraction of text content easily, but doesn't seem to have good support for formatting.
2) JPedal (Java Library) - Allows extraction of text content easily, and supports formatting IF XML structured data is in the PDF (not the case for my data).
3) Nitro PDF (Tool) + RTF to XML (script) - This works quite nicely and shows that PDF to XML is possible, but why do I have to use 2 tools? Also, these are not libraries I can integrate into my app.
4) iText (Java Library) - Seems great at creating PDFs but poor at extracting content.
I don't really expect someone to give me a perfect solution (although that would be nice!).
Instead, what I'd like to know is WHY tools support PDF to RTF/Word/whatever retaining formatting, and other tools support RTF to XML with the formatting information retained. What is it about PDF and RTF/Word that makes it feasible to convert that way, but not to XML. Also, as I found in 3) above, it is perfectly feasible to end up as XML from PDF, so why do no tools support this reliably!
Many thanks for any advice from PDF gurus.XML doesn't mean anything - it's just a generic concept for structuring
information. You need a specific GRAMMAR of XML to mean anything. So what
grammar would you use? Something standard? Make up your own?
However, there are a number of commercial and open source products that can
convert PDF to various XML grammars - SVG, ABW, and various custom grammars.
But the other thing you need to understand is that most PDF files do not
have any structure associated with them (as you saw when using JPEDAL). As
such, any concepts of paragraphs/sections/tables/etc. Are WILD GUESSES by
the software in question. -
I am trying to convert a pdf to word but it fails and asks me to purchase adobe export
The file you are trying to access could not be found. The file may have been deleted or moved in another session. I keep getting this error message although I can open the pdf file
Hi asjoseph,
It sounds like you're reporting two different problems--is that correct? One, that you're unable to convert using ExportPDF, and another that you're trying to open or convert PDF? Is that correct?
For the first issue, make sure that you're signed in to the ExportPDF service. You can log in directly at cloud.acrobat.com/exportpdf.
For the second part of your question, please tell me a bit more about where that error is occurring, and what steps you're taking before the error appears.
I look forward to hearing back from you.
Best,
Sara -
I just purchased the converter. Tried to convert PDF to word document. Did NOT work!!!!
Hi Philip,
The attachment didn't come through, but if the problem occurs with just one file, you can use the
File Conversion Issue form to send us your file and Adobe will take a closer look at it.
Best,
Sara -
Converting Smartform spool to PDF results in loss of formatting
A smart form contains texts which is printed in bold.
This is clearly visible in both the preveiw and the prionout.
When we convert the output of a smartform into a PDF form the bold text is converted into a normal text for that font.
We are using a custom ZARIAL font in the smartstyle, and cannot tell if it is this Z font which the PDF conversion cannot support or if there is some setting which needs to be tweaked.
Kindly advice.Hi
ZARIAL font which you have created in the smartstyle and used in the smartform is no supporting while converting from OTF TO PDF.
[Output in PDF Format|http://help.sap.com/saphelp_nw70/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm]
Regards,
Sravanthi -
Smartform convert to WORD - e-mail/fax
Hi All,
Quickly can we convert Smartform output to Word output. Currently I am doing Smartform converted to PDF and sending that as e-mail/fax. New requirement is to send in word format. Can we convert Samrtform to WORD and send as e-mal/fax?
Thanks in advance.
Regards,
TimCheck this code below ....
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSD_SFM_ATTACH'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
CALL FUNCTION FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_control
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = wa_prnctrl
USER_SETTINGS = 'X'
CUST_LINE = gl_cust_line
IMPORTING
DOCUMENT_OUTPUT_INFO = wa_doc_info
JOB_OUTPUT_INFO = wa_outinfo
JOB_OUTPUT_OPTIONS = wa_job_opt
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
t_otf[] = wa_outinfo-otfdata[].
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
USE_OTF_MC_CMD = 'X'
ARCHIVE_INDEX =
IMPORTING
BIN_FILESIZE = g_filesize
TABLES
OTF = t_otf
DOCTAB_ARCHIVE = t_docs
LINES = i_tline
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3
convert PDF 132 to 255
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
No translation
loop at i_tline.
i_objbin-line = i_tline-tdline.
append i_objbin.
endloop.
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[].
loop at i_record.
i_objbin-line = i_record-line.
append i_objbin.
endloop.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
glt_objpack-head_start = 1.
Number of lines of an object header in object packet
glt_objpack-head_num = 0.
Start line of object contents in an object packet
glt_objpack-body_start = 1.
Number of lines of the object contents in an object packet
glt_objpack-body_num = v_lines_txt.
Code for document class
glt_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
glt_objpack-transf_bin = 'X'.
glt_objpack-head_start = 1.
glt_objpack-head_num = 1.
glt_objpack-body_start = 1.
glt_objpack-body_num = v_lines_bin.
glt_objpack-doc_type = 'PDF'.
glt_objpack-obj_name = 'ReturnForm'.
CONCATENATE 'ReturnForm_output' '.pdf'
INTO glt_objpack-obj_descr.
glt_objpack-doc_size = v_lines_bin * 255.
APPEND glt_objpack.
glt_objhead = 'Return_form.PDF'. append glt_objhead.
Document information.
CLEAR i_reclist.
Fill the receiver list
clear gs_reclist.
condense gl_fax_num.
gs_reclist-receiver = P_Z_MFR_MAIL.
gs_reclist-rec_type = co_u.
append gs_reclist to i_reclist.
Sending mail.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gl_doc_chng
put_in_outbox = 'X'
COMMIT_WORK = 'X'
TABLES
packing_list = glt_objpack
object_header = glt_objhead
CONTENTS_BIN = i_objbin
contents_hex = i_objbin
contents_txt = gt_objcont
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.
Maybe you are looking for
-
Just bought iPhone5s how do i transfer my info from iphone4
just bought iphone5s how do i transfer my info from my iphone4 easily
-
Hi I'm trying to pull session details from our production server to a separate table. I need to gather in one query total count of sessions != to SYSTEM total count of inactive session != to SYSTEM average of last_call_et My table has 4 fields in it
-
Post iLife 08 install issue with iTunes, need details please for install
Like others in this discussion area after installing iLife '08 I received the following message after I then tried to open iTunes... "This copy of iTunes is corrupt or is not installed correctly. Please reinstall iTunes." This problem occurred on the
-
Could not contact the agent. check wheather the url connected to the agent.
i am having the problem with the error message " could not contact the agent. check wheather the url connected to the agent is null". This error occurs while login with credentials, and because of this i cant open the em page, please help me to solve
-
I recently plugged my iPod Mini into a hotel computer to recharge it during vacation. After unplugging it, the iPod distorts all but two songs in its music library and all playlists. I have reset the iPod and re-synched it, but to no avail. All songs