on 01-05-2019 6:54 PM
Hi experts,
I try to use CVAPI_DOC_CHECKIN to upload documents into my DMS. The problem is that frontend asks for the permission to load the file from my local pc. When I'm running the function module inside a SOAP or REST service the documents won't get checked in. I found a tutorial in the support area but this doesn't work. Is there any option that I could prevent the GUI popup I think it must work somehow. (This function module is also RFC ready by default).
Here you can see the example programs provided by SAP. From the application server and/or in the background.
I can't find any hint there which could prevent the GUI popup for CVAPI_DOC_CHECKIN.
I found out that I haven't configured any SAPFTP destination could this cause any problems? (I'm storing the documents into the Kpro)
***********************************************************************
* Checkin the first original of a document info record *
* from the application server and/or in the background *
***********************************************************************
REPORT ZZUZTEST_TEST_CHECKIN .
data: lf_line(255).
data: ls_draw like DRAW,
ls_message_cvapi like messages,
lt_files_cvapi type standard table of CVAPI_DOC_FILE,
lt_files_cvapi_header like CVAPI_DOC_FILE.
data: lt_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE,
vo_originals LIKE cvapi_doc_file OCCURS 0 WITH HEADER LINE.
*************** Start-of-selection *****************
start-of-selection.
ls_draw-dokar = 'DRW'.
ls_Draw-doknr = 'UZTEST30'.
ls_Draw-dokvr = '02'.
ls_Draw-doktl = '000'.
* Read Originals contained in the document info record
CALL FUNCTION 'CVAPI_DOC_GETDETAIL'
EXPORTING
pf_batchmode = 'X'
pf_hostname = ' '
pf_dokar = ls_draw-dokar
pf_doknr = ls_draw-doknr
pf_dokvr = ls_draw-dokvr
pf_doktl = ls_draw-doktl
pf_active_files = 'X'
IMPORTING
psx_draw = ls_draw
TABLES
pt_files = vo_originals
EXCEPTIONS
not_found = 1
no_auth = 2
error = 3
OTHERS = 4
.
IF sy-subrc <> 0.
WRITE 'Error returned by CVAPI_DOC_GETDETAIL'. "#EC NOTEXT
EXIT.
ENDIF.
* Check if we can really access the file from the application server
read table vo_originals index 1.
open dataset vo_originals-filename for input in text mode.
if not sy-subrc is initial.
message e500(26) with vo_originals-filename 'not found'.
endif.
read dataset vo_originals-filename into lf_line.
if not sy-subrc is initial.
message e500(26) with vo_originals-filename 'read error'.
endif.
lt_originals = vo_originals.
lt_originals-STORAGE_CAT = 'DMS_C1_ST'.
append lt_originals.
CALL FUNCTION 'CVAPI_DOC_CHECKIN'
EXPORTING
PF_DOKAR = ls_draw-dokar
PF_DOKNR = ls_draw-doknr
PF_DOKVR = ls_draw-dokvr
PF_DOKTL = ls_draw-doktl
* PS_DOC_STATUS =
PF_FTP_DEST = 'SAPFTPA'
PF_HTTP_DEST = 'SAPHTTPA'
* PF_HOSTNAME = ' '
* PS_API_CONTROL =
* PF_REPLACE = ' '
* PF_CONTENT_PROVIDE = 'SRV'
IMPORTING
PSX_MESSAGE = ls_message_cvapi
TABLES
PT_FILES_X = lt_originals
* PT_COMP_X =
* PT_CONTENT =
.
IF ls_message_cvapi-msg_type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_message_cvapi-msg_txt.
ELSE.
COMMIT WORK and wait.
ENDIF.
are you able to look at the GUI security settings and try to enter a custom rule for your file path to allow it? Fix the SAPGUI settings as opposed to handling programmatically?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.