Skip to Content
0

DMS Document Creation and Retrieval from File net server

Nov 23, 2017 at 09:18 PM

42

avatar image
Former Member

I have to create an attachment for the material master, where the document needs to gets stored in FileNet server of type DMS or GOS.The file net server is configured in OAC0 with a Z content repository.As the file net is secure it has security certificates.

Document (DOKNR) is getting created the corresponding records are getting created in DMS_DOC2LOIO, DMS_PH_CD1, DMS_PHIO2FILE - DMS except DMS_PHF_CD1 table.I believe that this table is the final link which creates the entry in the file net server and it gets attached to material master as required.

Your inputs are appreciated.

It's a ui5 application, so I wrote the code in create stream and testing in Tcode /n/iwfnd/gw_client with a jpg image.

slug as jpeg-home.JPG|MATERIAL|<material number>

Content-Type as image/png

Code:

io_message_container = /iwbep/if_mgw_conv_srv_runtime~get_message_container( ).
lv_error_category = /iwbep/if_message_container=>gcs_error_category-processing.

lv_entity_name = io_tech_request_context->get_entity_type_name( ).


SPLIT iv_slug AT '|' INTO lv_filename lv_typeid lv_instid.
UNPACK lv_instid TO lv_instid1.
SPLIT iv_slug AT '.' INTO lv_filename2 lv_ext.


*Bapi input
ls_bapiinput-user_guid = sy-uname.
*Document Data
ls_documentdata-documenttype = 'ZXX'.
* ls_documentdata-documentnumber = lv_instid.
ls_documentdata-documentversion = '00'.
ls_documentdata-documentpart = '000'.
ls_documentdata-docfile1 = lv_filename.
*Content Bin
ls_file_content_bin = is_media_resource-value.
*Document Descriptions
ls_documentdescriptions-language = sy-langu.
ls_documentdescriptions-description = lv_filename.
APPEND ls_documentdescriptions TO lt_documentdescriptions.
CLEAR ls_documentdescriptions.
*Links
ls_links-objecttype = 'MARA'.
ls_links-objectkey = lv_instid.
APPEND ls_links TO lt_links.
*Document Files
ls_documentfiles-documenttype = 'ZXX'.
* ls_document-storagecategory = 'ZXXX'.
ls_documentfiles-wsapplication = lv_ext.
ls_documentfiles-docpath = 'http://<link>:<port><physical path>'.
ls_documentfiles-docfile = lv_filename.
ls_documentfiles-description = lv_filename.
APPEND ls_documentfiles TO lt_documentfiles.

*Get User ID
CALL FUNCTION 'ZAGENTRYUSERGUID'
EXPORTING
iv_mobileapp = 'Z_SAP_WORK_MANAGER_64'
IMPORTING
ev_guid = ls_bapiinput-user_guid.
*Create the documents
CASE lv_entity_name.
WHEN 'EtDocument'.

CALL FUNCTION '/SMERP/CORE_DODMSDOCUMENT_CRT'
EXPORTING
is_bapi_input = ls_bapiinput
is_documentdata = ls_documentdata
* IV_HOSTNAME =
* IV_DOCBOMCHANGENUMBER =
* IV_DOCBOMVALIDFROM =
* IV_DOCBOMREVISIONLEVEL =
* IV_CAD_MODE = 'X'
* IV_PF_FTP_DEST = ' '
iv_pf_http_dest = 'SAPHTTP'
is_file_content_bin = ls_file_content_bin
IMPORTING
es_bapi_output = es_bapi_output
ev_documenttype = ev_documenttype
ev_documentnumber = ev_documentnumber
ev_documentpart = ev_documentpart
ev_documentversion = ev_documentversion
TABLES
et_return = lt_return
* IT_CHARACTERISTICVALUES =
* IT_CLASSALLOCATIONS =
it_documentdescriptions = lt_documentdescriptions
* IT_DOCUMENTSTRUCTURE = lt_document
it_objectlinks = lt_links
it_documentfiles = lt_documentfiles
* IT_LONGTEXTS =
* IT_COMPONENTS =
* IT_TRANSACTION_REQ_INFO =
* ET_TRANSACTION_REQ_STATUS =
.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers