Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

Convert Word doc to PDF in Odata

$
0
0

Hi Team,

 

I need to convert the Word document(.doc) to pdf to PHP System .

 

Scenario : When PHP guy gives the delivery in tool, label details attached to it should open in PDF format .

 

Can anyone suggest an idea to achieve it .

 

Steps tried :

 

1. Used the below code to get the entries from table DRAO .

 

CALL FUNCTION 'CVAPI_DOC_CHECKOUTVIEW_DIALOG'

             EXPORTING

               pf_dokar                 = wa_dms_key-dmskey+00(03) "ls_input-dokar

               pf_doknr                 = wa_dms_key-dmskey+03(25) "ls_input-doknr

               pf_dokvr                 = wa_dms_key-dmskey+28(02) "ls_input-dokvr

               pf_doktl                 = wa_dms_key-dmskey+30(03) "doktl EQ t_dms_key-dmskey+30(03) "ls_input-doktl

      pf_ftp_dest              = 'SAPFTPA'

      pf_http_dest             = 'SAPHTTPA'

              pf_hostname              = 'DEFAULT'

              pf_content_provide       = 'TBL'

*     PS_API_CONTROL           =

*   IMPORTING

*     PSX_MESSAGE              =

*     PSX_FILE                 =

*     PSX_DRAW                 =

            TABLES

              ptx_content              = t_drao.

 

2. Used the below code to convert, but its not opening in PDF format .Is there an idea to achieve it .

 

LOOP AT t_drao INTO wa_drao.

           wa_bin = wa_drao-orblk.

           APPEND wa_bin TO lt_bin.

         ENDLOOP.

 

         DESCRIBE TABLE t_drao LINES v_line.

         size = 2550 * v_line.

 

         CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

           EXPORTING

             input_length       = size

*     FIRST_LINE         = 0

*     LAST_LINE          = 0

          IMPORTING

            buffer             = file_data

           TABLES

             binary_tab         = lt_bin

*   EXCEPTIONS

*     FAILED             = 1

*     OTHERS             = 2

                   .

         IF sy-subrc <> 0.

* Implement suitable error handling here

         ENDIF.

 

Regards,

Karthik S


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>