on 2004 Sep 16 10:12 AM
Hello,
I want to send word documents to printer. I found a FM CV150_PRINT_DOC but I could not find out how to run it.
Thanks,
Didem GUNDOGDU
Hi Didem.
To open a document you can use the following method:
CALL METHOD document->open_document
EXPORTING document_url = p_fname
IMPORTING retcode = retcode.
Where p_fname stands for the filename on your fileserver (use 'FILE://' + <directory name> + '/' + <name of the file> for local files).
Regards,
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Didem
Here is an example code utilizing OLE2.
REPORT print_via_ole_example .
INCLUDE ole2incl .
DATA: gs_word TYPE ole2_object ,
gs_documents TYPE ole2_object ,
gs_newdoc TYPE ole2_object ,
gs_actdoc TYPE ole2_object .
START-OF-SELECTION .
CREATE OBJECT gs_word 'WORD.APPLICATION'.
SET PROPERTY OF gs_word 'Visible' = '0' .
CALL METHOD OF gs_word 'Documents' = gs_documents.
CALL METHOD OF gs_documents 'Open' = gs_newdoc
EXPORTING #1 = 'D:\my_doc.doc' .
CALL METHOD OF gs_word 'ActiveDocument' = gs_actdoc .
CALL METHOD OF gs_actdoc 'PrintOut' .
CALL METHOD OF gs_word 'Quit' .
END-OF-SELECTION.
FREE: gs_word, gs_actdoc, gs_documents, gs_newdoc .
Hope this helps...
*--Serdar
HI All,
I have a requirement to print a MS Word document linked to Material Master through the SAP DMS.
I have tried using the FM CV150_print_doc, but I m not clear with the value passed to the mandatory import parameter "URL". Kindly throw some light on the value to be passed for this parameter.
I have also tried using OLE2 objects but call to the method "OPEN" ends with an error (SY-SUBRC 2).
Kindly let me know how to go about it.
Thanks in advance.
Regards,
Niharika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Perhaps you can help me.
I have a document stored in SAP DMS, typically this would not be a MS document, but a PDF or a TIFF.
What I want to do is print the document but have some sort of identification on it to say that it is a draft.
I have read a lot about the watermark options, but this seems to be viable for sapscripts and smartforms and not for DMS Documents.
Essentially, I would want to intercept the spool, add the image or text to it that identifies is as being a draft, and then print that.
Any suggestions?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Didem,
First of all, the requirement is not clear. What exactly do you want? Do you want to print a word document, which is stored in SAP Document Management System or you just want to print a document using ABAP code, which is stored on your local machine ?
CV150_PRINT_DOC can only be used when the word document is stored in SAP DMS. You must have a Document Info Record created in SAP for it.
If you want to print a word document from your PC, you may think of using office integration. You may open the document as an OLE object and print using method PRINT_DOCUMENT of I_OI_DOCUMENT_PROXY.
Regards,
Pranav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have been successful in achieving this using OLE. Program will open the document, print it, then close the document automatically. If you are interested, I can write a sample for you.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rich,
Could you plz send me the sample code ? (at vinod.doshi@watsonpharm.co.in )
my requirement is as below.
There are some analytical tests carried out at the time of Good Receipt.
Depending upon the mateiral, different tests are carried out.
I want to pass the GR no, Inspection Lot no and some other info to predetermined MS word documents. I need to pass this info on every page.
So my printed document will be a combination of this info (GR no , inspection lot no, batch no etc) & predefined ms word format of around 30-40 pages.
This information will be unique for material.
Many thanks for your kind help in advance.
null
Hello Didem,
You can find some examples using transaction SE83 (Reuse Library): SAP Basis -> Controls -> Desktop Office Integration.
Hope this helps,
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have another question. I could not get the idea of addressing the documents. I mean, when I debug the examples, I found out that the content of the documents are carried out to the internal tables. But where do we define the directory and the name of the files?
Best Regards,
Didem
ps: I think the best way is to use ws_execute, but unfortunately printers we use are not MS DOS compatible. I could not print anything from the command prompt.
Hi,
If your functionality allows you to open the doc first and then print it from there, then you can use the FM 'WS_EXECUTE'/ 'GUI_EXEC' to open the file (you should pass the full path of the winword.exe file/WORD prg name and your file path to this FM), and then print it from there
Deepak Charanyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Didem,
Take a look at the SAP Help for Desktop Integration (BC-CI) working with documents. It's quiet easy to open a document (e.q. Word document) and to print the document.
Regards,
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.