Code: Alles auswählen.
CALL FUNCTION 'SCMS_DOC_READ_FILE'
EXPORTING
* MANDT = SY-MANDT
stor_cat = <p>-stor_cat
* CREP_ID = ' '
doc_id = <p>-phio_id
* PHIO_ID =
comp_id = <p>-file_name
path = l_path
* FRONTEND = 'X'
* SIGNATURE = 'X'
security = ' '
* NO_CACHE = ' '
* P_TRANSFER_PHIO =
* IMPORTING
* SIZE =
* MIMETYPE =
EXCEPTIONS
bad_storage_type = 1
bad_request = 2
unauthorized = 3
not_found = 4
conflict = 5
internal_server_error = 6
error_http = 7
error_signature = 8
error_config = 9
error_hierarchy = 10
error_format = 11
error_open = 12
error_download = 13
error_parameter = 14
error = 15
OTHERS = 16.
Ich nehme an, das gelesene Dokument oder die drin enthaltene Infos wären als Email/Emailanhang zu versenden.
Genau!sap_enthusiast hat geschrieben: ↑14.06.2022 17:25Ich nehme an, das gelesene Dokument oder die drin enthaltene Infos wären als Email/Emailanhang zu versenden.
Code: Alles auswählen.
DATA: x TYPE XSTRING.
TRY.
CALL METHOD cl_bcs_convert=>xtab_to_xstring
EXPORTING
it_xtab = file_content_binary
RECEIVING
rv_xstring = x.
CATCH cx_bcs .
ENDTRY.
TRY.
CALL METHOD cl_bcs_convert=>xstring_to_xtab
EXPORTING
iv_xstring = x
IMPORTING
et_xtab = object_hex.
CATCH cx_bcs .
ENDTRY.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report Z_ARCHI_READ *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT z_archi_read .
DATA:
l_docid TYPE toa01-arc_doc_id VALUE '028139FB9113FE42B7915E7D9D43BA25'.
DATA:
t_access_info TYPE TABLE OF scms_acinf,
t_content_txt TYPE TABLE OF sdokcntasc,
t_content_bin TYPE TABLE OF sdokcntbin.
CALL FUNCTION 'SCMS_DOC_READ'
EXPORTING
* MANDT = SY-MANDT
stor_cat = ' '
crep_id = 'VX'
doc_id = l_docid
* PHIO_ID =
* SIGNATURE = 'X'
security = 'r'
* NO_CACHE = ' '
* RAW_MODE = ' '
* IMPORTING
* FROM_CACHE =
* CREA_TIME =
* CREA_DATE =
* CHNG_TIME =
* CHNG_DATE =
* STATUS =
* DOC_PROT =
TABLES
access_info = t_access_info
content_txt = t_content_txt
content_bin = t_content_bin
EXCEPTIONS
bad_storage_type = 1
bad_request = 2
unauthorized = 3
comp_not_found = 4
not_found = 5
forbidden = 6
conflict = 7
internal_server_error = 8
error_http = 9
error_signature = 10
error_config = 11
error_format = 12
error_parameter = 13
error = 14
OTHERS = 15
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
DATA s_access_info TYPE scms_acinf.
DATA lbuffer TYPE xstring.
DATA contents_hex TYPE solix_tab.
DATA l_len TYPE i.
READ TABLE t_access_info INTO s_access_info INDEX 1.
l_len = s_access_info-comp_size.
* I_tab nach Xstring
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = l_len
IMPORTING
buffer = lbuffer
TABLES
binary_tab = t_content_bin
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
* Xstring nach Itab
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lbuffer
TABLES
binary_tab = contents_hex[].
BREAK-POINT.