Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Download Attached file from DMS Server(cv03n) to local system in R/3

Former Member
0 Kudos

Hello,

Please give me some suggestion for Downloading Attached file from DMS Server(cv03n) to local system in R/3.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Code Snippet:



CALL FUNCTION 'CVAPI_DOC_VIEW'

   EXPORTING

     pf_dokar      =

     pf_doknr      =

     pf_dokvr      =

     pf_doktl      =

     pf_appl_start = ' '

   IMPORTING

     pfx_file      = lv_filename

   EXCEPTIONS

     error         = 1

     not_found     = 2

     no_auth       = 3

     no_original   = 4

     OTHERS        = 5.

lv_workdir = lv_filename.

IF lv_workdir is NOT INITIAL.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

   EXPORTING

     default_extension       = 'DOC'

     initial_directory       = 'C:\'

   CHANGING

     file_table              = it_file

     rc                      = v_rc

   EXCEPTIONS

     file_open_dialog_failed = 1

     cntl_error              = 2

     error_no_gui            = 3

     not_supported_by_gui    = 4

     OTHERS                  = 5.

IF sy-subrc EQ 0.

   READ TABLE it_file INTO wa_file INDEX 1.

   IF sy-subrc = 0.

     p_lfile = wa_file-filename.

   ENDIF.

ENDIF.

ENDIF.

IF p_lfile is NOT INITIAL.

CALL METHOD cl_gui_frontend_services=>file_copy

     EXPORTING

       source               = lv_workdir

       destination          = p_lfile

*     overwrite            = SPACE

*   EXCEPTIONS

*     cntl_error           = 1

*     error_no_gui         = 2

*     wrong_parameter      = 3

*     disk_full            = 4

*     access_denied        = 5

*     file_not_found       = 6

*     destination_exists   = 7

*     unknown_error        = 8

*     path_not_found       = 9

*     disk_write_protect   = 10

*     drive_not_ready      = 11

*     not_supported_by_gui = 12

*     others               = 13

           .

9 REPLIES 9

Former Member
0 Kudos

Hello Sachin,

We have our attached files in a Content Server. In CV03N, when you display the file you have the possibility to save the file.

If you have access to R/3, you can save your file there.

Teresa

0 Kudos

Hello Teresa,

I want to download files through ABAP Program.

Thanks

Sachin

0 Kudos

We are using FM CV120_KPRO_CHECKOUT in a loop for all the files.

Teresa

Former Member
0 Kudos

Hello,

Got Solution..

Thank You.

0 Kudos

Hi Sachin,

I am facing the same issue ,Can u suggest the logic you used..?

0 Kudos

Hi Manjunatha,

Check Code Snippet.

Thanks

Sachin

0 Kudos

Thank You Sachin Hulmani.

My requirement  is to change the existing Word document data in DMS ,But I got initial thing of how to Download that for my local System.from you.

Thanks Again.
Manju



.

0 Kudos

Hi,

To Chage Document try  BAPI_DOCUMENT_CHANGE2.

Thanks

Former Member
0 Kudos

Code Snippet:



CALL FUNCTION 'CVAPI_DOC_VIEW'

   EXPORTING

     pf_dokar      =

     pf_doknr      =

     pf_dokvr      =

     pf_doktl      =

     pf_appl_start = ' '

   IMPORTING

     pfx_file      = lv_filename

   EXCEPTIONS

     error         = 1

     not_found     = 2

     no_auth       = 3

     no_original   = 4

     OTHERS        = 5.

lv_workdir = lv_filename.

IF lv_workdir is NOT INITIAL.

CALL METHOD cl_gui_frontend_services=>file_open_dialog

   EXPORTING

     default_extension       = 'DOC'

     initial_directory       = 'C:\'

   CHANGING

     file_table              = it_file

     rc                      = v_rc

   EXCEPTIONS

     file_open_dialog_failed = 1

     cntl_error              = 2

     error_no_gui            = 3

     not_supported_by_gui    = 4

     OTHERS                  = 5.

IF sy-subrc EQ 0.

   READ TABLE it_file INTO wa_file INDEX 1.

   IF sy-subrc = 0.

     p_lfile = wa_file-filename.

   ENDIF.

ENDIF.

ENDIF.

IF p_lfile is NOT INITIAL.

CALL METHOD cl_gui_frontend_services=>file_copy

     EXPORTING

       source               = lv_workdir

       destination          = p_lfile

*     overwrite            = SPACE

*   EXCEPTIONS

*     cntl_error           = 1

*     error_no_gui         = 2

*     wrong_parameter      = 3

*     disk_full            = 4

*     access_denied        = 5

*     file_not_found       = 6

*     destination_exists   = 7

*     unknown_error        = 8

*     path_not_found       = 9

*     disk_write_protect   = 10

*     drive_not_ready      = 11

*     not_supported_by_gui = 12

*     others               = 13

           .