cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DMS - BAPI - BAPI_DOCUMENT_CHECKIN2 - No upload to server

Former Member
0 Likes
3,995

Hi,

I am having a problem with BAPI_DOCUMENT_CHECKIN2. I use it to checkin a document into an existing Document info record.

Example of how I am using the BAPI:

REPORT ztestdms .

DATA: it_files  LIKE TABLE OF bapi_doc_files2 WITH HEADER LINE.
DATA: ln_return LIKE bapiret2.

it_files-docfile       = 'C:tempDMS_Test.txt'.
it_files-wsapplication = 'TXT'.
APPEND it_files.

CALL FUNCTION 'BAPI_DOCUMENT_SETCOMMITMODE'
     EXPORTING
          auto_commit = 'X'.

CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
  EXPORTING
    documenttype            = 'TEK'
    documentnumber          = '0000000000000010000000046'
    documentpart            = '000'
    documentversion         = '00'
*   HOSTNAME                = ' '
*   STATUSINTERN            = ' '
*   STATUSEXTERN            = ' '
    statuslog               = 'test mb'
*   REVLEVEL                = ' '
*   AENNR                   = ' '
*   PF_FTP_DEST             = ' '
*   PF_HTTP_DEST            = ' '
  IMPORTING
    return                  = ln_return
  TABLES
    documentfiles           = it_files
*   COMPONENTS              =
*   DOCUMENTSTRUCTURE       =
          .

WRITE ln_return.

The BAPI links the file to the DIR but does not upload it, the lock symbol in transaction CV02N is still open and the file is still available at the client. A manual checkin completes the process but this is not wanted.

What I would like to happen is the file to be uploaded (actually checked in) and removed from the client.

Any help is welcome and thanks in advance.

View Entire Topic
Former Member
0 Likes

Thanks Maurice,

Infact I am using CVAPI_DOC_CHECKIN.

CALL FUNCTION 'CVAPI_DOC_CHECKIN'

EXPORTING

PF_DOKAR = LV_DOKAR

PF_DOKNR = LV_DOC_NUMBER

PF_DOKVR = LV_DOC_VERSION

PF_DOKTL = LV_DOC_PART

PS_API_CONTROL = LIT_API_CONTROL

PF_FTP_DEST = 'SAPFTP'

PF_HTTP_DEST = 'SAPHTTP'

IMPORTING

PSX_MESSAGE = LIT_PSX_MESSAGE_1

TABLES

PT_FILES_X = LIT_PT_FILES.

I am also calling the

ReturnCode = RfcAllowStartProgram("sapftp;saphttp") in my VB code.

Now I have one question, If you see in the function module I am passing 2 parameters "SAPFTP" and "SAPHTTP".

Are we suppossed to do any configuration in SAP for this, I think these 2 are the Default RFC destination maintained in SM59 and When I do a test connection they connect successfully. But what will be the user id and password with which FTP will be accessed.