Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

to attach document in table control.

shadab_maldar
Active Participant
0 Likes
1,020

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

5 REPLIES 5
Read only

Former Member
0 Likes
872

Hi Shadab,

Where do you plan to keep the attachments do you have a DMS database ???

Regards

Read only

0 Likes
872

Hi Yakub,

Yes, we have DMS database.Please let us know how we will attach document in each record of table control.

Thanks,

Shadab

Read only

0 Likes
872

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 ).

Read only

0 Likes
872

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

Read only

0 Likes
872

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