cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying DMS document in .DOC using abap webdynpro

Former Member
0 Kudos

Dear Experts,

        TO dispay the DMS stored document Iam using below code,It is successfully displaying the stored Document

in .doc but here the problem is the same code is not working in when we execute the application EP(portal).

     Anyone could you please give the suitable solution for this is grately appreciated..thanx in advance     

                      ls_input-DOKAR = 'TST'.

                       ls_input-dokvr = '00'.

                       ls_input-doktl = '000'.

                       ls_input-doknr =  LS_docnum .

*

             CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW_DIALOG'

               EXPORTING

                 PF_DOKAR                 = ls_input-dokar

                 PF_DOKNR                 = ls_input-doknr

                 PF_DOKVR                 = ls_input-dokvr

                 PF_DOKTL                  = ls_input-doktl

                PF_FTP_DEST             =  'SAPFTPA'

                PF_HOSTNAME              = 'DEFAULT '

                PF_CONTENT_PROVIDE       = 'TBL'

              IMPORTING

                PSX_MESSAGE              =  ls_message

              TABLES

                PTX_CONTENT              =  LT_DRAO .

             LOOP AT lt_drao INTO wa_drao.

               wa_bin = wa_drao-orblk.

               APPEND wa_bin TO lt_bin.

             ENDLOOP.

            DESCRIBE TABLE lt_drao LINES v_line.

            size = 2550 * v_line.

            CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

            EXPORTING

               input_length       = size

            IMPORTING

               buffer             = file_data

            TABLES

               binary_tab         = lt_bin .

           CONCATENATE lv_lettername '.DOC' INTO LV_FILENAME .

           CALL METHOD cl_wd_runtime_services=>attach_file_to_response

           EXPORTING

               i_filename      = LV_FILENAME

               i_content       = file_data

               i_mime_type     = 'application/doc'.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Could you please add a screen shot or details what issue you are having exactly when doing it from Portal.

Former Member
0 Kudos

Dear Phani,

        Whenever the document is generated Iam storing the document no.n date,etec...in some customizing table and all other static text I stored in so10 as standard text like below.

*****************************************************************************************************

<html>
<body>
<font face="Times New Roman" font size="3">
<br><br>
<p><CENTER><p style="text-align:justify">
&nbsp&nbsp&nbsp&nbsp&nbsp
<u>D.O.LETTER NO. &CURRENT&  /DCM III/2013 ,Dated: &SYDATUM&
</u></P></CENTER>
Dear
<p>    
&nbsp &nbsp
Sub:- Market Borrowings &#8722 consent under Article 293(3) of the
Constitution of India<br>&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp for availing loans  during financial year  &YEAR& &#8722 Reg.
<br><br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
Ref:  From  Ministry of Finance, Department of Expenditure,
<br>&nbsp &nbsp&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp
Plan Finance &#8722 I, New Delhi &LETTERNO&
<BR> <CENTER>&#x2a&#x2a&#x2a&#x2a</CENTER></p>

    ************************************************************************************************************

         I stored this Document details along with standard text in DMS server(Note:for better alginment purpose for paragraphs I used HTML tags).Now whenever the user wanted to see the document I need to provide download option to user.To Download the document i created one webdynpro application,In this wd appl.i coded the below

**************************************************************************************************

                       ls_input-DOKAR = 'TST'.

                       ls_input-dokvr = '00'.

                       ls_input-doktl = '000'.

                       ls_input-doknr =  LS_docnum .

*

             CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW_DIALOG'

               EXPORTING

                 PF_DOKAR                 = ls_input-dokar

                 PF_DOKNR                 = ls_input-doknr

                 PF_DOKVR                 = ls_input-dokvr

                 PF_DOKTL                  = ls_input-doktl

                PF_FTP_DEST             =  'SAPFTPA'

                PF_HOSTNAME              = 'DEFAULT '

                PF_CONTENT_PROVIDE       = 'TBL'

              IMPORTING

                PSX_MESSAGE              =  ls_message

              TABLES

                PTX_CONTENT              =  LT_DRAO .

             LOOP AT lt_drao INTO wa_drao.

               wa_bin = wa_drao-orblk.

               APPEND wa_bin TO lt_bin.

             ENDLOOP.

            DESCRIBE TABLE lt_drao LINES v_line.

            size = 2550 * v_line.

            CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

            EXPORTING

               input_length       = size

            IMPORTING

               buffer             = file_data

            TABLES

               binary_tab         = lt_bin .

           CONCATENATE lv_lettername '.DOC' INTO LV_FILENAME .

           CALL METHOD cl_wd_runtime_services=>attach_file_to_response

           EXPORTING

               i_filename      = LV_FILENAME

               i_content       = file_data

               i_mime_type     = 'application/doc'.

*********************************************************************************

          This aplication is working fine in ECC but when we execute this application from portal The downloaded document is showing HTML tags which I used for alignments.Have a look on below.

 

<html>
<body>
<font face="Times New Roman" font size="3">
<br><br>
<p><CENTER><p style="text-align:justify">
&nbsp&nbsp&nbsp&nbsp&nbsp
<u>D.O.LETTER NO. &CURRENT&  /DCM III/2013 ,Dated: &SYDATUM&
</u></P></CENTER>
Dear
<p>    
&nbsp &nbsp
Sub:- Market Borrowings &#8722 consent under Article 293(3) of the
Constitution of India<br>&nb