cancel
Showing results for 
Search instead for 
Did you mean: 

how to add power presntation to anap webdynpro ?

Former Member
0 Kudos

Hi

I have an abap webdynpro and i want to add a button to the screen that when a user will press it an microsoft power-point will execute/

Is there a way to do that ?

Thank

Ami

Accepted Solutions (0)

Answers (4)

Answers (4)

Abhijeet-K
Active Participant
0 Kudos

Hi Ami,

While the solutions above might work, there is always a compatibility issue with multiple host configurations. Meaning, if a person wants to see this web dynpro on a net book, a Linux machine, an iPad, etc. the render would be troublesome, or at worst might cause the application to crash.

A better way would be to request the content provider to supply the document in PDF format, if at all possible. Not only it is supported across the board, it is a tamper proof document. Further, it's easy to convert a presentation to PDF.

Whether you convert it to PDF or retain as is, you may opt for simply attaching the document content to the HTTP response. If there is an appropriate browser plugin or an associated application at the client end, it will open the document. If there isn't, it will simply download the file, which can be open with appropriate application.

The code to attach a document to HTTP response is:

  cl_wd_runtime_services=>attach_file_to_response(

       i_filename  = v_file_name         "Provide appropriate extension

       i_content   = v_file_content       "In XSTRING

       i_mime_type = 'application/pdf'      "If the content is in PDF. Choose appropriate MIME type

       i_in_new_window = abap_true

       i_inplace   = abap_true ).

0 Kudos

Hi Ami,

Below is the sample code for accessing BDS documents(Any kind of documents present in business document navigator) via WDA.

You can use BDS functionality to store your content and open it directly from there. below is the sample code for getting the documents and displaying them.


  DATA: all_connections_wd TYPE TABLE OF bdn_con.
  DATA: lw_all_connections_wd TYPE bdn_con.
  CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'
    EXPORTING
*   LOGICAL_SYSTEM         =
      classname              = 'Z_CONTENT'
      classtype              = 'OT'
*   OBJKEY                 =
*   CLIENT                 = SY-MANDT
*   ALL                    = 'X'
*   NO_AL_DOCS             = ' '
*   NO_GOS_DOCS            = 'X'
*   CHECK_STATE            = ' '
* IMPORTING
*   COUNT                  =
    TABLES
*   SIGNATURE              =
      all_connections        = all_connections_wd
*   FRAMEWORK              =
* EXCEPTIONS
*   NO_OBJECTS_FOUND       = 1
*   ERROR_KPRO             = 2
*   INTERNAL_ERROR         = 3
*   NOT_AUTHORIZED         = 4
*   OTHERS                 = 5
            .

DATA: ob_wd_document_ui TYPE REF TO cl_hap_wd_document_ui.

        CREATE OBJECT ob_wd_document_ui.
        lv_aid = lw_all_connections_wd-loio_id.

        DATA: lv_hap_attachment_type TYPE hap_attachment_type.
        lv_hap_attachment_type = lw_all_connections_wd-docuclass.

        CALL METHOD ob_wd_document_ui->attachment_get_detail
          EXPORTING
            attachment_id      = lv_aid
            attachment_type    = lv_hap_attachment_type
            attachment_storage = 'BDS'
          IMPORTING
            file_content       = lv_fcon
            file_content_hex   = lv_fchex
            mime_file_type     = lv_mftyp
            s_return           = lv_ret.


        DATA:
        l_file    TYPE string,
        l_mime    TYPE string,
        pdf_data  TYPE xstring.

        CONCATENATE 'application/' lw_all_connections_wd-docuclass INTO l_mime.

        l_file = lw_all_connections_wd-comp_id .

        CALL METHOD cl_wd_runtime_services=>attach_file_to_response
          EXPORTING
            i_filename  = l_file
            i_content   = lv_fchex
            i_mime_type = l_mime.

amy_king
Active Contributor
0 Kudos

Hi Ami,

There is an OfficeControl UI element but I don't believe it handles powerpoint presentations.

You might want to read the document by and also take a look at demo component WD_TEST_APPL_ACFEXECUTE in your system to see how you might leverage the Active Component Framework to open a powerpoint file.

In the call to CL_WDR_ACFEXECUTE_HNDL->IF_WD_ACFEXECUTE~EXECUTE, you would pass the path to the file you want to open in the argumentlist parameter.

Cheers,

Amy

0 Kudos

Do you want to display any ppt using WDA? if yes then you can explore the area of combining business document navigator with WDA.