Skip to Content
0

Print PDF attachments from DMS server

Dec 10, 2017 at 04:47 AM

233

avatar image
Former Member

Hi All,

Can anybody help me to resolve my issue?

I have a requirement to print PDF attachments from DMS server. In CV04N we have PDF attachments for every batch and material. My custom program is configured with output type. This output type will executed from VL02N. If medium type is 'print output' the PDF attachments should print from DMS server which are related delivery batch and material.

Can body give me the solution to resolve this issue.?

Thanks in advance ,

Regards,

Satish

10 |10000 characters needed characters left characters exceeded

This question has been recently asked exactly in the same way (Nov 29, Oct 9), and there was no answer. Don't you think you need to ask it differently?

I don't understand where your exact issue is. You have a custom program, you have a PDF already loaded via CV04N, and so, what then, where is the issue? Don't forget to tell about details: which print technology do you use, do you need to print immediately (local printer) or print in background (server printer)...

0
Former Member
Sandra Rossi

Hi Rossi,

Thanks for quick reply. The PDFs are uploaded into CV04N for every batch and material. The for this requirement we will have the output type which will trigger from VL02N/VT03N. Once output is triggered with medium type 'print output', all PDF attachments of delivery batch/shipment batch should be print. The printer name we will get in NAST. Based on the printer name PDFs should print. Here I need help to print the PDF from DMS server.

Do we have any function module/class-method to print PDF from DMS server?

Hope you understand my requirement.

Regards,

Satish

0

No, there's no function module/class method to print PDF from DMS server. You must first read the file from the "DMS server", this is easy as it has been answered many times in the forum. To print a PDF when you print immediately, the only simple solution is to execute the PDF print using cl_gui_frontend_services, and it has been answered on the forum too.

0
Former Member
Sandra Rossi

Hi Rossi,

Thanks for your quick reply. Could you provide the sequence of the methods execution of the class 'cl_gui_frontend_services' to print PDFs ?

If you have any sample code, kindly share the code to me.

Regards,

Satish

0

As I said, it has been already answered. When you find the answer, I can confirm your finding if you prefer.

0
Former Member
Sandra Rossi

Hi Rossi,

I've used class method cl_gui_frontend_services=>execute to print pdf from DMS server. initially I've downloaded the PDF attachment into my local drive and I've passed file path to parameter 'document' of cl_gui_frontend_services=>execute. But I'm not able to print attachment. Could you please give me any solution if you have?

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
  EXPORTING
    DOCUMENT                = lv_file_name    "File path in local drive to print
    OPERATION               = 'PRINT'
*  EXCEPTIONS
*    CNTL_ERROR             = 1
*    ERROR_NO_GUI           = 2
*    BAD_PARAMETER          = 3
*    FILE_NOT_FOUND         = 4
*    PATH_NOT_FOUND         = 5
*    FILE_EXTENSION_UNKNOWN = 6
*    ERROR_EXECUTE_FAILED   = 7
*    SYNCHRONOUS_FAILED     = 8
*    NOT_SUPPORTED_BY_GUI   = 9
*    others                 = 10
        .
IF SY-SUBRC EQ 0.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_DELETE
  EXPORTING
    FILENAME             = lv_file_name      "File path in local drive to delete the file
  CHANGING
    RC                   = rc              "Integer type
  EXCEPTIONS
    FILE_DELETE_FAILED   = 1
*    CNTL_ERROR           = 2
*    ERROR_NO_GUI         = 3
*    FILE_NOT_FOUND       = 4
*    ACCESS_DENIED        = 5
*    UNKNOWN_ERROR        = 6
*    NOT_SUPPORTED_BY_GUI = 7
*    WRONG_PARAMETER      = 8
    others               = 9
        .
IF SY-SUBRC <> 0.


* Implement suitable error handling here
ENDIF.


ENDIF.


<br>

Regards,

Satish

1
Show more comments

Try the following search:

sap Print PDF attachments from DMS server

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers