on 2020 Nov 12 6:14 AM
We are trying to upload multiple attachments (“test1.pdf”, “test2.pdf”) with a claim in ESS claims and declaration service (HRESS_CLMS_EE_IN) by implementing the BADI HRPBSIN_PROCESS_ATTACHMENTS . The document will be stored in DMS. Is sue we are facing is, while using CREATE_ATTACHMENT method, we are able to upload first file but unable to upload second attachment to same document number. We are getting following error (VIRUS SCAN PROFILE /SCMS/KPRO/CREATE IS NOT ACTIVE) (SHOWN IN IMAGE_1.PNG) upon uploading the second attachment. We are uploading first attachment using cvapi_doc_checkin AND FOR SECOND ATTACHMENT, WE ARE USING CVAPI_DOC_MAINTAIN. In CV03N, we are able to see the first attachment only “TEST1.PDF” AS SHOWN IN IMAGE_2.PNG.
Source code-
TYPES : BEGIN OF st_ts_raw_line,line TYPE sdokcntbin,END OF st_ts_raw_line.
*do.* enddo.
DATA : ls_draw TYPE draw,
ls_api_ctrl TYPE cvapi_api_control,
ls_message_new TYPE messages,
lv_documentnumber TYPE draw-doknr,
lv_storage_cat TYPE cv_storage_cat,
lv_size TYPE i,
lt_bindata TYPE STANDARD TABLE OF st_ts_raw_line,
ls_bindata TYPE sdokcntbin,
ls_drao TYPE drao,
lt_drao TYPE TABLE OF drao,
lt_files TYPE cvapi_tbl_doc_files,
ls_files TYPE cvapi_doc_file.DATA : objlink TYPE TABLE OF bapi_doc_drad,
ls_objlink TYPE bapi_doc_drad.
DATA : ls_data TYPE pin_file.
TYPES : BEGIN OF ls_xdata,line TYPE drao-orblk,END OF ls_xdata.DATA : lt_xdata TYPE TABLE OF ls_xdata,
ls_xdata TYPE ls_xdata.
DATA : lst_fdata TYPE LINE OF hressin_file_data.*
ls_draw-dokar = 'Z12'.
ls_draw-dokvr = '00'.
ls_draw-doktl = '000'.
ls_draw-dwnam = sy-uname.
ls_draw-dokst = 'IA'.
lv_storage_cat = 'DMS_C1_ST'.
ls_api_ctrl-tcode = 'CV01N'.
ls_draw-filep = 'test-HR'."lst_fdata-fname.
ls_draw-dappl = 'PDF'."lst_fdata-ftype+1(3).
DATA wa_drat TYPE dms_db_drat.DATA it_drat TYPE TABLE OF dms_db_drat.REFRESH it_drat.
wa_drat-dokar = 'Z12'.
wa_drat-dokvr = '00'.
wa_drat-doktl = '000'.
wa_drat-langu = sy-langu.
wa_drat-dktxt = 'TESTING'.
APPEND wa_drat TO it_drat.
CALL FUNCTION 'CVAPI_DOC_CREATE'EXPORTING
ps_draw = ls_draw
ps_api_control = ls_api_ctrlIMPORTING
psx_message = ls_message_new
pfx_doknr = lv_documentnumberTABLES
pt_drat_x = it_drat.
IF ls_message_new-msg_type CA 'EA'.ELSE.LOOP AT it_drat INTO wa_drat.
wa_drat-doknr = lv_documentnumber.MODIFY it_drat FROM wa_drat TRANSPORTING doknr.ENDLOOP.
ls_draw-doknr = lv_documentnumber.COMMIT WORK AND WAIT.WAIT UP TO 5 SECONDS.ENDIF.
DATA lv_index TYPE i VALUE 0.DATA l_counter TYPE obzae VALUE 0.LOOP AT itb_fdata INTO lst_fdata.
lv_index = lv_index + 1.CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'EXPORTINGbuffer = lst_fdata-fdataIMPORTING
output_length = lv_sizeTABLES
binary_tab = lt_xdata.
CLEAR l_counter.REFRESH: lt_drao , lt_files.CLEAR: ls_drao, ls_files.LOOP AT lt_xdata INTO ls_xdata.
l_counter = l_counter + 1.
ls_drao-orblk = ls_xdata-line.
ls_drao-orln = lv_size.
ls_drao-dokar = ls_draw-dokar.
ls_drao-doknr = lv_documentnumber.
ls_drao-dokvr = ls_draw-dokvr.
ls_drao-doktl = ls_draw-doktl.
ls_drao-appnr = '1'.
ls_drao-zaehl = l_counter.APPEND ls_drao TO lt_drao.ENDLOOP.
ls_files-appnr = '1'.
ls_files-filename = lst_fdata-fname.
ls_files-updateflag = 'I'.
ls_files-langu = sy-langu.
ls_files-storage_cat = 'DMS_C1_ST'.
ls_files-description = lst_fdata-fname.
ls_files-dappl = lst_fdata-ftype+1(3).APPEND ls_files TO lt_files.
IF lv_index <> 1.
ls_api_ctrl-tcode = 'CV02N'.CALL FUNCTION 'CVAPI_DOC_MAINTAIN'EXPORTING
ps_draw = ls_draw
ps_api_control = ls_api_ctrl
pf_content_provide = 'TBL'IMPORTING
psx_message = ls_message_newTABLES" pt_drat_x = it_drat
pt_files_x = lt_files
pt_content = lt_drao.COMMIT WORK.ELSE.
ls_api_ctrl-tcode = 'CV01N'.CALL FUNCTION 'CVAPI_DOC_CHECKIN'EXPORTING
pf_dokar = ls_draw-dokar
pf_doknr = lv_documentnumber
pf_dokvr = ls_draw-dokvr
pf_doktl = ls_draw-doktl
ps_api_control = ls_api_ctrl
pf_content_provide = 'TBL'IMPORTING
psx_message = ls_message_newTABLES
pt_files_x = lt_files
pt_content = lt_drao.COMMIT WORK.ENDIF.
DATA lst_attach TYPE t77www_clfdat.
lst_attach-mandt = sy-mandt.
lst_attach-pernr = ist_trans-pernr.
lst_attach-refnr = ifd_refnr.
lst_attach-retyp = ist_trans-retyp.
lst_attach-rqtyp = ist_trans-rqtyp.
lst_attach-linum = lst_fdata-linum.
lst_attach-doknr = ls_draw-doknr.
lst_attach-dokar = ls_draw-dokar.
lst_attach-dokvr = ls_draw-dokvr.
lst_attach-doktl = ls_draw-doktl.
lst_attach-fname = lst_fdata-fname.
lst_attach-ftype = lst_fdata-ftype.
lst_attach-fltxt = lst_fdata-fltxt.
lst_attach-fsize = lst_fdata-fsize.APPEND lst_attach TO etb_clfdat.
ENDLOOP.
Request clarification before answering.
"Virus scan profile not active" is not a error. This is filled as Information message. There would be another error.
Regards
SSB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
9 | |
9 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.