on 10-17-2013 7:48 AM
Hey everybody,
am searching for a BAPI or FM which gives me the content of a pdf wich is stored in archive on the server and is linked with materialnumber. I want to display the the pdf in Webdynpro in an interactive form.
Maybe someone knows a BAPI or FM?
Regards
Alexander
Hi,
Check the FM SCMS_AO_TABLE_GET . This may help u.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexander,
can you find your files with BAPI_DOCUMENT_GETOBJECTDOCS (objecttype = 'MARA') ?
In that case you can read the file details with BAPI_DOCUMENT_GETDETAIL2. CVAPI_DOC_CHECKOUTVIEW will help you to read the content.
Just search for the names here on SCD - there should be examples...
Binding the binary to a xstring-context-node for binding to an Interactive Form-UI-element could probably work...
hope that helps,
Stefan,
Hey Stefan,
thank you for your reply. Which values should return BAPI_DOCKUMENT_GETDETAIL2?
When i call this BAPI i can see some values in the tables DOCUMENTDESCRIPTION and DOCFILES and in de importing parameter DOCUMENTDATA the rest is empty. This you can see in the screenshots. In DOCUMENTFILES i hove no Storage-Category and no FILE-ID.
I don't understand which values i need. Are theses Values enough for CVAPI_DOC_CHECKOUTVIEW?
Regards
Alexander
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = ls_doc-documenttype
documentnumber = ls_doc-documentnumber
documentpart = ls_doc-documentpart
documentversion = ls_doc-documentversion
getactivefiles = 'X'
getdocdescriptions = 'X'
getdocfiles = 'X'
IMPORTING
documentdata = ls_doc_data
return = ls_return_detail
TABLES
documentdescriptions = lt_description
documentfiles = lt_doc_files.
LOOP AT lt_doc_files INTO ls_doc_file.
ls_files_api-appnr = ls_doc_file-originaltype.
ls_files_api-lo_objid = ls_doc_file-application_id.
ls_files_api-ph_objid = ls_doc_file-file_id.
REFRESH lt_files_api.
APPEND ls_files_api TO lt_files_api.
CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW'
EXPORTING
pf_dokar = ls_doc_data-documenttype
pf_doknr = ls_doc_data-documentnumber
pf_dokvr = ls_doc_data-documentversion
pf_doktl = ls_doc_data-documentpart
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
pf_content_provide = 'TBL'
pf_std_url = 'X'
IMPORTING
psx_message = ls_message
TABLES
pt_files = lt_files_api
ptx_content = lt_drao
.
hope that helps,
Stefan
Hey Stefan,
thank you for your replay.
I checked the variables in the loop but File_id and Application_Id are emty. Whats wrong?
After calling CVAPI_DOC_CHECKOUTVIEW the lt_drao table is emtpy. Have you an idea? I think our Customizing in DMS is not optimal because there is no file_id.
My Code:
METHOD onactionopen_pdf .
DATA lr_el_context TYPE REF TO if_wd_context_element.
DATA materialnummer TYPE mara-matnr VALUE '000000000000602205'.
DATA lt_draw TYPE draw.
DATA lt_drad TYPE drad.
DATA lv_xurl TYPE xstring.
DATA lv_url TYPE string.
*Variables for BAPI_DOCUMENT_GETDETAIL2
DATA ls_return TYPE bapiret2.
DATA ls_documentdata TYPE bapi_doc_draw2.
DATA lt_objectlinks TYPE TABLE OF bapi_doc_drad.
DATA lt_docdescript TYPE TABLE OF bapi_doc_drat.
DATA lt_longtext TYPE TABLE OF bapi_doc_text.
DATA lt_statuslog TYPE TABLE OF bapi_doc_drap.
DATA lt_docfiles TYPE TABLE OF bapi_doc_files2.
DATA lt_components TYPE TABLE OF bapi_doc_comp.
DATA lt_charivalue TYPE TABLE OF bapi_characteristic_values.
DATA lt_classallo TYPE TABLE OF bapi_class_allocation.
DATA lt_docstruct TYPE TABLE OF bapi_doc_structure.
DATA lt_whereused TYPE TABLE OF bapi_doc_structure.
DATA ls_docfile TYPE bapi_doc_files2.
*Variables for CVAPI_DOC_CHECKOUTVIEW
DATA lt_files_api TYPE TABLE OF cvapi_doc_file.
DATA ls_files_api TYPE cvapi_doc_file.
DATA lt_drao TYPE TABLE OF drao.
DATA ls_message TYPE messages.
SELECT * FROM drad INTO lt_drad WHERE objky = materialnummer AND dokar = 'ZBA'.
ENDSELECT.
SELECT * FROM draw INTO lt_draw WHERE doknr = lt_drad-doknr.
ENDSELECT.
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = lt_draw-dokar
documentnumber = lt_draw-doknr
documentpart = lt_draw-doktl
documentversion = lt_draw-dokvr
getobjectlinks = 'X'
getcomponents = 'X'
getstatuslog = 'X'
getlongtexts = 'X'
getactivefiles = 'X'
getdocdescriptions = 'X'
getdocfiles = 'X'
getclassification = 'X'
getstructure = 'X'
getwhereused = 'X'
hostname = 'X'
inherited = 'X'
IMPORTING
documentdata = ls_documentdata
return = ls_return
TABLES
objectlinks = lt_objectlinks
documentdescriptions = lt_docdescript
longtexts = lt_longtext
documentfiles = lt_docfiles
components = lt_components
characteristicvalues = lt_charivalue
classallocations = lt_classallo
documentstructure = lt_docstruct
whereusedlist = lt_whereused.
LOOP AT lt_docfiles INTO ls_docfile.
ls_files_api-appnr = ls_docfile-originaltype.
ls_files_api-lo_objid = ls_docfile-application_id.
ls_files_api-ph_objid = ls_docfile-file_id.
REFRESH lt_files_api.
APEND ls_files_api TO lt_files_api.
ENDLOOP.
CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW'
EXPORTING
pf_dokar = ls_documentdata-documenttype
pf_doknr = ls_documentdata-documentnumber
pf_dokvr = ls_documentdata-documentversion
pf_doktl = ls_documentdata-documentpart
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
pf_content_provide = 'TBL'
pf_std_url = 'X'
IMPORTING
psx_message = ls_message
TABLES
pt_files = lt_files_api
ptx_content = lt_drao
.
Regards
Alexander
hmm, just some more questions:
Did you upload the file to the DMS by yourself?
The file has to be saved on the server - not locally on your client.
I am not a specialst at DMS, but i think there has the Field "Ablagekategorie" (see your screenshot) should be filled and the lock-icon next to it should be "locked". In the Tab "Document data" you have a button "Check in Orig." ("Original ablegen") - to save the file in the DMS...I am not sure if this works for archive...
Stefan
Hi Stefan thank you for your reply.
Okay cannot access file, the file must be stored on application server but the file is stored on fileserver (DFS). I have another idea maybe it is possible to open the File with AcfExecute.
I also tried to open the file with a new window and for the url i set the file path, but i always get error message that the file has a malicious script. Maybe you have an idea? I think this is just a security option but i cannot find a posibility to deactivate this option.
Regards
Alexander
Hi Alexander,
it is a big difference if you access a file from your client or if the application server access a file and you "download" it from there to your client.
If you open the file by URL in your browser thats one thing - using the Interactive Form UI element is the other thing.
Without knowing your specific requirements i basically would recommend to have the application server provide the file.
Problably you should talk to your basis adminstration in order to access the file by open datatset successfully.
I hope my answers were helpful anyway.
Stefan.
Hi Stefan,
thank your for your reply. I solved the problem.
I have the path to the file. So i replaced the network drive character with the fqdn of the DFS-System. After that i can read the file in binary mode and display it in an interactive form.
So thank you for your help. It was very helpful. The next questions will follow !
Regards
Alexander
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.