on 03-23-2010 6:43 AM
Hi All,
I am trying to upload a new document using the below code, but no is generated, but file is missing
REPORT ZSBN_DMS_T1
DATA: LS_DOC LIKE BAPI_DOC_DRAW2,
LS_RETURN LIKE BAPIRET2.
DATA: LF_DOCTYPE LIKE BAPI_DOC_DRAW2-DOCUMENTTYPE,
LF_DOCNUMBER LIKE BAPI_DOC_DRAW2-DOCUMENTNUMBER,
LF_DOCPART LIKE BAPI_DOC_DRAW2-DOCUMENTTYPE,
LF_DOCVERSION LIKE BAPI_DOC_AUX-DOCVERSION.
DATA: LT_FILES LIKE BAPI_DOC_FILES2 OCCURS 0 WITH HEADER LINE,
LT_DRAT LIKE BAPI_DOC_DRAT OCCURS 0 WITH HEADER LINE,
LT_DRAD LIKE BAPI_DOC_DRAD OCCURS 0 WITH HEADER LINE.
LS_DOC-DOCUMENTTYPE = 'CPE'.
LS_DOC-DOCUMENTVERSION = '01'.
LS_DOC-DOCUMENTPART = '001'.
LS_DOC-STATUSEXTERN = 'CO'.
LS_DOC-LABORATORY = '001'.
REFRESH LT_FILES.
CLEAR LT_FILES.
LT_FILES-DOCFILE = 'E:\NewFolder\Book1.xls'.
LT_FILES-WSAPPLICATION = 'XLS'.
APPEND LT_FILES.
CLEAR LT_DRAT.
REFRESH LT_DRAT.
LT_DRAT-LANGUAGE = 'EN'.
LT_DRAT-DESCRIPTION = 'BHARANI DOC'.
APPEND LT_DRAT.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING: DOCUMENTDATA = LS_DOC
IMPORTING: DOCUMENTTYPE = LF_DOCTYPE
DOCUMENTNUMBER = LF_DOCNUMBER
DOCUMENTPART = LF_DOCPART
DOCUMENTVERSION = LF_DOCVERSION
RETURN = LS_RETURN
TABLES: DOCUMENTDESCRIPTIONS = LT_DRAT
OBJECTLINKS = LT_DRAD
DOCUMENTFILES = LT_FILES.
IF LS_RETURN-TYPE CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH LS_RETURN-MESSAGE.
ELSE.
DATA : WAIT TYPE BAPITA-WAIT VALUE '5',
RET TYPE BAPIRET2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = WAIT
IMPORTING
RETURN = RET
.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH LF_DOCNUMBER.
ENDIF.
pls help.
with rgds,
Bharani
Edited by: S BHARANIDARAN on Mar 23, 2010 12:14 PM
Hello Bharanidharan,
We have tried similar code, the problem could be that you are trying to read the file from your local PC. But the standard BAPI's available do not support this functionality. Please refer to the note: 504692, use CVAPI_DOC_CHECKIN and refer the following threads too:
Hope this helps, these have resolved same problem, try this else we can look in to other possibilities that I have tried.
regards
C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.