SmartForm & MS Word
Hello,
I need to download a smarform in msword format (.doc or .rtf).
I know functions to download to .pdf format that works ok.
Also functions to make several task with ms word files, but only works in a flat list. if the smatform contains windows or logos, the function catch the "NOT_ABAP_LIST" exception.
I hope you'll understand my english and gratefull any suggestion.
Thanks.
Hi Luis,
I m sure but just try what i m saying .... Actually I m on leave and dont have access to system henced can't check this and tell you .. try this and se whether its working or not..
1. From the smartform you have got the function module created by SAP right..
and you are calling this function module in you ABAP program..
2. Now one of the the output parameter of this function module will be output_info.
From this you will get the OTF data for your smartform..
3. Now pass this OTF data to function module <b>CONVERT_OTF</b> and in the
call of this func mod.pass format as 'DOC' (check if we can pass this ) this will
convert our OTF data to DOC format..
4. Now make use of <b>GUI_DOWNLOAD</b> func mod. to download the data to
presentation system...
I guess this should work ... let me know if you have any prob in this..
Enjoy SAP.
Pankaj Singh.
Similar Messages
-
Exporting smartform into word document
how to export smartform into word document . i tried converting into pdf and then download but it showing run time error that conversion is not possible and also it tells that otf command // missing. is it not possible to export directly to word document instead of pdf.plz give clear description of what to be done exactly with sample codes.
marks will be rewarded.Hi Lavanya,
Converting the output from Spool to Word is possible.
Here is the sample code.
I cut pasted a code from a link i got in the website, see if it helps.
ZSPOOL2WORD
Genera un fichero Word a partir de una orden de spool
MÓDULO : FI *
TIPO : Listado *
TITULO : Generación fichero Word
DESCRIPCION : Genera un fichero Word a partir de una orden de spool
AUTOR: Andres Picazo FECHA: 24/03/2003 *
MODIFICACIONES *
FECHA NOMBRE DESCRIPCION *
REPORT ZSPOOL2WORD
NO STANDARD PAGE HEADING
LINE-COUNT 065
LINE-SIZE 080.
INCLUDE OLE2INCL.
*----TABLAS/ESTRUCTURAS--
*----TABLAS INTERNAS--
DATA I_BUFFER(132) OCCURS 1000000 WITH HEADER LINE.
*----VARIABLES--
*----PARAMETER/SELECT-OPTIONS EN PANTALLA--
SELECTION-SCREEN BEGIN OF BLOCK BLK_PAR WITH FRAME TITLE TEXT-SEL. "Pará
PARAMETERS: P_SPOOL LIKE TSP01-RQIDENT OBLIGATORY.
SELECTION-SCREEN END OF BLOCK BLK_PAR.
SELECTION-SCREEN BEGIN OF BLOCK BLK_WOR WITH FRAME TITLE TEXT-WOR.
PARAMETERS: P_WORD AS CHECKBOX DEFAULT 'X'.
PARAMETERS: P_FWOR LIKE RLGRAP-FILENAME DEFAULT 'C:MAYOR.DOC'.
PARAMETERS: P_PLAN LIKE RLGRAP-FILENAME
DEFAULT 'D:DATOSAPISMAYORPLANTILLA LIBRO MAYOR.DOC'.
SELECTION-SCREEN END OF BLOCK BLK_WOR.
SELECTION-SCREEN BEGIN OF BLOCK BLK_FIC WITH FRAME TITLE TEXT-FIC.
PARAMETERS: P_CTXT AS CHECKBOX DEFAULT ''.
PARAMETERS: P_FTXT LIKE RLGRAP-FILENAME DEFAULT 'C:MAYOR.TXT'.
SELECTION-SCREEN END OF BLOCK BLK_FIC.
LOGICA DEL PROGRAMA
INITIALIZATION
INITIALIZATION.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM LEER_SPOOL.
IF NOT P_CTXT IS INITIAL.
PERFORM GRABA_FICHERO.
ENDIF.
IF NOT P_WORD IS INITIAL.
PERFORM LANZA_WORD.
ENDIF.
FORMS ADICIONALES
*& Form LEER_SPOOL
Lee la orden de spool en el buffer
FORM LEER_SPOOL.
CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
EXPORTING
RQIDENT = P_SPOOL
FIRST_LINE = 1
LAST_LINE = 9999999
TABLES
BUFFER = I_BUFFER
EXCEPTIONS
NO_SUCH_JOB = 1
NOT_ABAP_LIST = 2
JOB_CONTAINS_NO_DATA = 3
SELECTION_EMPTY = 4
NO_PERMISSION = 5
CAN_NOT_ACCESS = 6
READ_ERROR = 7
OTHERS = 8.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error' SY-SUBRC
'al leer la orden de spool' P_SPOOL.
ENDIF.
ENDFORM. " LEER_SPOOL
*& Form GRABA_FICHERO
Graba el contenido del spool a fichero de texto.
FORM GRABA_FICHERO.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = P_FTXT
FILETYPE = 'ASC'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = I_BUFFER
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error' SY-SUBRC
'al grabar el fichero' P_FTXT.
ENDIF.
ENDFORM. " GRABA_FICHERO
*& Form LANZA_WORD
Abre la plantilla de Word y pega el contenido del portapapeles.
FORM LANZA_WORD.
DATA: WORDAPP TYPE OLE2_OBJECT,
DOCUMENT TYPE OLE2_OBJECT,
SELECTION TYPE OLE2_OBJECT.
Copia el contenido del buffer en el portapeles
CALL FUNCTION 'CLPB_EXPORT'
TABLES
DATA_TAB = I_BUFFER
EXCEPTIONS
CLPB_ERROR = 1
OTHERS = 2.
Abre Word
CREATE OBJECT WORDAPP 'word.application'.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'No se ha podido abrir el Word'.
ENDIF.
Lo pone en visible
SET PROPERTY OF WORDAPP 'Visible' = 1.
Cogemes el objeto documento
CALL METHOD OF WORDAPP 'Documents' = DOCUMENT.
Abrimos el fichero plantilla
IF P_PLAN IS INITIAL.
CALL METHOD OF DOCUMENT 'Add'.
ELSE.
CALL METHOD OF DOCUMENT 'Open' EXPORTING #1 = P_PLAN.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al leer el fichero plantilla'.
ENDIF.
ENDIF.
Coge el objeto selección
CALL METHOD OF WORDAPP 'Selection' = SELECTION.
Pega el contenido del portapapeles
CALL METHOD OF SELECTION 'Paste'.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al pegar contenido del portapapeles'.
ENDIF.
Graba el fichero
CALL METHOD OF WORDAPP 'ActiveDocument' = DOCUMENT.
CALL METHOD OF DOCUMENT 'SaveAs' EXPORTING #1 = P_FWOR.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al grabar el nuevo documento'.
ENDIF.
Cierra Word
CALL METHOD OF WORDAPP 'Quit'.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'Error al cerrar Word'.
ENDIF.
ENDFORM. " LANZA_WORD
check this also.................
By using FM RSPO_RETURN_ABAP_SPOOLJOB you will be able to get the ASCII text of your Spool, which you can download to your local HD and open with M$ Word.
Check the function module
CALL FUNCTION 'RSPO_DOWNLOAD_SPOOLJOB'
EXPORTING
id = p_spool
fname = p_file.
Give the file extn as .DOC. it will downlaod it as a
Word doc.But I fear you wont get the table formats and
all.
~~Guduri -
Convert SmartForm to Word File or EXCEL,POSSIBLE?
Hi,
I have a requirement to convert a SmartForm to Word File or EXCEL because they need to do some changes in the form.I know how to convert it to PDF but I don't know how to convert it to WORD or EXCEL.I've searched the forum and know i have to use the FM:CONVERT_ITF_TO_RTF.I'm a newbie and can anyone tell me how to use this FM or give me a example.Will it loose all the formatting?Thanks.CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_formname
IMPORTING
fm_name = w_fmname.
CALL FUNCTION w_fmname
EXPORTING
control_parameters = cparam
output_options = outop
user_settings = space
IMPORTING
job_output_info = tab_otf_data
TABLES
IT_VBRP = IT_VBAP[].
if sy-subrc IS INITIAL.
ENDIF.
tab_otf_final[] = tab_otf_data-otfdata[] .
*--Start of PDF--
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'DOC''
MAX_LINEWIDTH = 255
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = BIN_FILESIZE
BIN_FILE =
TABLES
OTF = tab_otf_final
LINES = doc_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 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.
DATA : FNAME TYPE STRING .
FNAME = PATH.
concatenate FNAME VBELN '.doc' into FNAME .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = bin_filesize
FILENAME = fname
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH = file_size
TABLES
DATA_TAB = doc_tab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Smartforms to Word or Excel.
Hi, All.
How to convert Smartform to Word or/and Excel files.
SAP R/3 version 4.6c
Best regards
Dmitry V. Bolshakov.Hi,
I am facing the same problem in ECC 5.0.
I want to generate a word file from smartform at run time. Is it possible any way.
Thanks,
Ashok -
Download Smartform to word file
Hi ,
How to download a smartform to word file . Any help will be useful to me
Regards,
JeevaHi,
You can use the function module 'CONVERT_OTF', here the output will be downloaded as PDF with all background pictures and formats but if u download in DOC format all the formatting and background pictures will be lost.
But we can convert the pdf output to word by a third party solution. Use SolidConverter. Version 1 is free.
Otherwise:
In transaction SMARTFORMS, use in menu UTILITIES point DOWNLOAD FORM.
But the Download utility in Tx. SMARTFORM is NOT available in SAP 46C.
You can use program RSTXSCRP (SAPscript Export to Dataset / SAPscript Import from Dataset) to do this for SAPSCRIPTS.
Regards,
Anjali. -
Truble with smartforms with word
Hello All.
i have a trouble with smartforms when I creat text , the smartforms open word page and the paragraph i was created within style did'nt show.
Note.
I have Office 2007
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Sep 1, 2008 4:54 PMHi
If you dont want MS word in your smartform text deactivate it in tcode:i18N
i18n customizing -->click on MS word as editor uncheck the checkbox of sapscripts and smartforms.
Then come back to your smartforms and then include your smartstyles in smartforms.
or
Incase if you want to include smartstyle in the smartforms.
Then output options tab include your smartstyle.
Regards,
sravanthi -
Convert Smartform in WORD Document
Hi Gurus
How can i convert a smartform Output in a word document ??? and download into PC..
Regards
GregoryThere is no standard possibility to do Word outputs in SAP.
Anyway you can develop connection of Mail-merge technology of Microsoft and SAP ABAP class i_oi_document_proxy.
http://help.sap.com/saphelp_sm32/helpdata/EN/e9/0be980408e11d1893b0000e8323c4f/content.htm
with interface get_mail_merge_interface:
http://help.sap.com/saphelp_sm32/helpdata/en/6e/8fc2e3dd0d11d2bdba080009b4534c/content.htm
Simple example I found here:
http://www.sap2word.de/abap.html
Hope, it helps
Edited by: Dimy IT dev on Sep 7, 2009 2:58 PM -
Print preview of smartform in word format (editable)
Hi Everybody,
I have a smartform. I want, when i click on the print priview , it should display in Ms word format and that to editable.
Plz help.
Thanks,
Mohammadi.hi,
1.convert smartform output to a word document using the function module "'RSPO_DOWNLOAD_SPOOLJOB'.
2.Check the print options for smartform.
3.Refer This:Re: print priview in smartforms
Regards,
Shiva Kumar -
I have a requiremnt to convert a smartform output generated to Word format. Apart from the font sizes, i have a logo generated in smartform which also needs to be converted in that word. Can anyone know about this or have done this requirement then please reply back.
Thanks & Regards,
Pankaj DwivediHi,
<u>A example for you</u>
CALL FUNCTION fm_name " '/1BCDWB/SF00000031'
EXPORTING
control_parameters = control_parameters
output_options = output_options
s_header = st_header
IMPORTING
job_output_info = output_data
TABLES
it_overdue = ITAB[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
now convert the final document (OTF format) into PDF
format
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'DOC'
IMPORTING
bin_filesize = v_pdf_len
TABLES
otf = output_data-otfdata
lines = pdf_table
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
Downloading the PDF file to the local Server
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = L_FILENAME
FILETYPE = C_BIN_FILETYPE
TABLES
DATA_TAB = lt_pdf_nuc_data
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope this helps you
Regards
Sudheer -
Convert Smartform to WORD by OLE
I developed a quotation form with smartforms and now I'm working hard to convert this form to a WORD document by OLE
I'm in trouble because it works quite fine in WORD 2000 but it doesn't work with WORD 97. I implemented the method cl_gui_frontend_services=>registry_get_value to get the WORD version from frontend but I can't find out what the diefference is. Macros look similar in both versions.
Has anybody got an idea what the difference is ?
Thanks in advance, UlrikeHi Ulrike,
as an alternative way, you can try CONVERT_TEXT function.
http://help.sap.com/saphelp_erp2004/helpdata/en/d6/0dba8f494511d182b70000e829fbfe/frameset.htm
In DOI approach,
do you succeded in converting TABLES to word format?
As I know, unfortunately there are limited number of tools in abap for such conversion.
regards,
Ahmet Sahan -
Smartform output in word document
hi all,
how to download a smartform in word document so that the user can make changes in it. i tried converting the output into OTF format but formatting is not coming properly.how to overcome this?Hi,
Even i had the same requirement for a sales order form to download in word and then change it manually before sending to customer. I tried a lot of ways to do the same and finally raised a sap noted for the same.i got a reply from SAP that it is not possible to download forms in word with same allignments maintained with logo. SAP note 641560 says the same thing.
All you need to do is find a technical solution to fill the data which they want to fill maually or go for adobe form. Thats amazing technology to solve your issue. -
URGENT: Copying text from word doc to text module in smartforms
Hi ALl
I have a problem, when i copy texts from word documents to smartforms, some words getting clubbed together. there is no space. I tried justified and left aligned. In both i am getting problem like this. Is there any special way to copy and paste the text to text module from word.
Thanks
MuraliTry to copy to notepad first, then copy to the text module.
-
Download form in word document
Hi,
Can i download the smartform in word document. I know it is possible in PDF, but my requirement is they want that form in word document.Hi,
you can find usefull documents from the following link
http://help.sap.com/saphelp_nw2004s/helpdata/en/ed/62073c44564d59e10000000a114084/frameset.htm
Hope it helps.
Regards.
Sukanya -
Word Format of Smart Forms Output
Hi,
We want the Smart Form output in DOC format. If we are using the function module 'CONVERT_OTF', the output is perfect when downloaded as PDF with all background pictures and formats but when we are downloading in DOC format all the formatting and background pictures are absent.But we need all formatting options like boxes, fonts and background pictures in the downloaded DOC format.
If any of you have worked on the same please reply
Thanks in advance.As far as I know there is no way to convert the smartform into word, without loosing the format and pictures.
But you may convert the pdf output to word by a third party solution. Use SolidConverter. Version 1 is free and it is the best converter I have seen.
If it helps please give points. -
Smartforms : split lines
Hi Gurus,
Trying to find help on the forums, I didn't find solution to my problem.
The issue is the following : when editing PO in smartforms, last word of the header text is cut in the middle.
How can I avoid the last word of a line to be cut into 2 parts when passing to next line ?
Thanks much in advance.
Regards.Hi friend,
Try giving continuous text to format the text in text editor. If this solves your problem then you can use character formats from smartstyles to format the text inside the displaying portion. Otherwise try increasing the width, so then all text can be accompanied in that divided portion itself.
Cheers...
Maybe you are looking for
-
Spry menu bar driving me crazy!
hello, i decided to use some expandable horizontal menus on my site. everything worked great on my index page. then i copied the codes to my other pages and that is where it went wrong. my menu bar i not collapsing on the hover action (maybe it is b
-
Getting error in IC agent business role while loading components.
The user has been allowed and access to all business role.user are using all business roles but when user click on the IC agent business role the following error arise. Cannot display view CRMCMP_BPIDENT/BuPaMultipleLayoutVS of UI Component CRMCMP_BP
-
ITunes 8.02 cannot update iPod behind proxy
I tried to update my iPod Touch today. I was able to start the download at home, but was unable to finish it. Came to the office, where we are behind a proxy server and iTunes gives the error: iTunes could not contact the iPod software update server
-
Trouble with Paths using Gallery
I have a very large site with lots of images. I can put my images, thumbnails and photo.xml in the galleries folder of the demo and it works just fine. I use the recommended file structure. I can add as many galleries as I like and they all work. If
-
Exceptions in FM in update task
Hi, Do you know if it's possible to raise excptions in a Function Module called in Update Task mode ? Thanks