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: 

CVAPI_DOC_CHECKOUTVIEW - how to check out files to a SAP directory

Former Member
0 Kudos
2,389

Hello,

I have an issue with understanding and providing the FM CVAPI_DOC_CHECKOUTVIEW to check out files from KPRO to a SAP directory.

I use CV120_KPRO_CHECKOUT to checkout files to local PC and this runs fine, but not for checking out files to SAP directories. So I found the API.... FM.

But I am confused about the data required to run the FM CVAPI_DOC_CHECKOUTVIEW . I tried several times but it does not work either for check out to clnt nor to SAP server.

Parameters for DOKAR, DOKNR, DOKVR and DOKTL are clear to me. PF-CONTENT_PROVIDE is CLNT for PC check out and SRV for Server checkout. But what about the rest?

I am not sure how to provide the tables and the fields PF_FTP_DEST / PF_HTTP_DEST / PF_HOSTNAME and the PS_API_CONTROL.

Can anybody help me with the required import data.

Best regards

Dirk

1 ACCEPTED SOLUTION

Former Member
0 Kudos
447

Hi Dirk.

We are using bapi to get the document file (original)

Look our usage of pf_http_dest and pf_ftp_dest.


CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
  EXPORTING
    documenttype       = vl_dokar
    documentnumber     = vl_doknr
    documentpart       = vl_doktl
    documentversion    = vl_dokvr
    getactivefiles     = 'X'
    getdocdescriptions = 'X'
    getdocfiles        = 'X'
  TABLES
    documentfiles      = t_document.

READ TABLE t_document INTO wa_document INDEX 1.

CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'
  EXPORTING
    documenttype    = vl_dokar
    documentnumber  = vl_doknr
    documentpart    = vl_doktl
    documentversion = vl_dokvr
    documentfile    = wa_document
    originalpath    = 'your SAP directory'
    pf_http_dest    = 'SAPHTTPA'
    pf_ftp_dest     = 'SAPFTPA'
 IMPORTING
    return          = wa_return
 TABLES
    documentfiles   = tl_files.

Darley

6 REPLIES 6

Former Member
0 Kudos
448

Hi Dirk.

We are using bapi to get the document file (original)

Look our usage of pf_http_dest and pf_ftp_dest.


CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
  EXPORTING
    documenttype       = vl_dokar
    documentnumber     = vl_doknr
    documentpart       = vl_doktl
    documentversion    = vl_dokvr
    getactivefiles     = 'X'
    getdocdescriptions = 'X'
    getdocfiles        = 'X'
  TABLES
    documentfiles      = t_document.

READ TABLE t_document INTO wa_document INDEX 1.

CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'
  EXPORTING
    documenttype    = vl_dokar
    documentnumber  = vl_doknr
    documentpart    = vl_doktl
    documentversion = vl_dokvr
    documentfile    = wa_document
    originalpath    = 'your SAP directory'
    pf_http_dest    = 'SAPHTTPA'
    pf_ftp_dest     = 'SAPFTPA'
 IMPORTING
    return          = wa_return
 TABLES
    documentfiles   = tl_files.

Darley

0 Kudos
447

Hello Darley,

what is this?

You are providing parameters which are not offered by these BAPIs.

CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'

EXPORTING

??? getdocdescriptions = 'X'

??? getdocfiles = 'X'

CALL FUNCTION 'BAPI_DOCUMENT_CHECKOUTVIEW2'

EXPORTING

??? pf_http_dest = 'SAPHTTPA'

??? pf_ftp_dest = 'SAPFTPA'

I try to do my best with ABAP, but I didn´t know till now that there are some skills required in magic???

When I have alook at my BAPIs these parameters are missing!

Ok, the first one is no problem I use it and it works fine.

But the important one for me is the checkout-BAPI!

Can you give any advice on how you do this? Would be great!

Best regards

Dirk

0 Kudos
447

Hi Dirk

At ECC 600 my program is working fine.

Maybe in your version theses parameters does not exists.

Anyway, try to use SAPHTTPA and SAPFTPA in your functions.

In a oldest version of my program, i used the fm SDOK_PHIOS_GET_COPY.

But when running in background, in some cases doesn't work


wa_components-class = 'DMS_PCD1'.
wa_components-objid = wa_document-file_id. "from BAPI_DOCUMENT_GETDETAIL2
wa_components-alias_name = 'file name'.
wa_components-directory = 'dir path'.
APPEND wa_components TO t_components.

CALL FUNCTION 'SDOK_PHIOS_GET_COPY'
  TABLES
    components  = t_components
    bad_objects = t_objects. 

Darley

0 Kudos
447

Hi Darley,

thanx for the quick response!

Yes, we are working on 4.6, so that´s the reason for different parameters of the BAPI.

I will try with the named FM 'SDOK_PHIOS_GET_COPY'

and come back with the result.

Best regards

Dirk

Former Member
0 Kudos
447

Hi,

no positive results with all the named FMs.

I am using CV120_KPRO_CHECKOUT_TO_SERVER.

This one is really simple to use as it only requires the destination directory and name on the Server and Class and OBJID from table DMS_PH_CD1.

regards

Dirk

Former Member
0 Kudos
447

hi guys,

does anyone know how to do the inverse? (from SAP server to tcode CV02N by example)

I created a post for this issue here:

download file from SAP server to CV02N (= DMS archive)

it could be very helpful if you have the answer?!

Thanks!!