‎2013 Jul 13 8:16 AM
Hi,
My client's requirement is to attach documents in each record of table control.
Please let me know how can i achieve this.
Thanks,
Shadab
‎2013 Jul 15 9:25 AM
Hi Shadab,
Where do you plan to keep the attachments do you have a DMS database ???
Regards
‎2013 Jul 16 6:35 AM
Hi Yakub,
Yes, we have DMS database.Please let us know how we will attach document in each record of table control.
Thanks,
Shadab
‎2013 Jul 17 3:10 AM
Yes Shadab,
You can use BAPI_DOCUMENT_CREATE2 to upload the document it will give you a document number in return store this document no in table.
Sample code : http://scn.sap.com/message/7404250
Create a button on screen to display the document.
When the user clicks the button.
Check my blog for it.
http://scn.sap.com/community/abap/blog/2013/06/11/displaying-a-dms-pdf-document-in-web-dynpro
the above is for WD for normal you can use Docking container
DATA: dockingleft TYPE REF TO cl_gui_docking_container,
html TYPE REF TO cl_gui_html_viewer,
repid TYPE syrepid.
DATA: lt_html TYPE TABLE OF char255,
ls_html TYPE char255.
DATA: lv_url TYPE char255.
PARAMETERS: p_check. " used for docking container
repid = sy-repid.
CREATE OBJECT dockingleft
EXPORTING
repid = repid
dynnr = sy-dynnr
side = dockingleft->dock_at_left
extension = 1070.
* Create HTML control
CREATE OBJECT html
EXPORTING
parent = dockingleft.
* insert HTML
ls_html = '<p>For more details, follow the link ' &
'<a href="http://help.sap.com/" ' &
'target="_blank">http://help.sap.com</a></p>'.
APPEND ls_html TO lt_html.
* Load the HTML
CALL METHOD html->load_data
IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_html
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
OTHERS = 4.
* Show it
html->show_url( lv_url ).
‎2013 Jul 18 11:35 AM
Hi Yakub,
Thanks for your suggestion.
I am able to store files in DMS through my table control by using BAPI_DOCUMENT_CREATE2.
Now I require the reverse process i.e document from DMS to my local system.
For this I am using BAPI_DOCUMENT_CHECKOUTVIEW2 and then FM ' SCMS_DOC_READ ' and then 'SCMS_DOC_READ '.
But I am getting exception 5 (not found) in FM ' SCMS_DOC_READ '.
Please suggest exact process to download DMS document to local system.
Thanks,
Barada
‎2013 Jul 19 3:30 AM
Hi,
Check in CV02N if the document is created , Sure you have used commit after bapi call.
You can get help here http://scn.sap.com/message/1802505#1802505
If you still are not able to solve it let me know.
Regards