cancel
Showing results for 
Search instead for 
Did you mean: 

Read data from Microsoft Powerpoint through Webdynpro- ABAP

I066686
Participant
0 Kudos

HI Experts,

I have got one requirement to read the data from Microsoft PowerPoint slides.

I am trying in this way,

 
wd_context->get_attribute( 
        EXPORTING 
           name =  `DATASOURCE ` 
           IMPORTING 
             value = l_xstring ). 


   CALL FUNCTION 'HR_KR_XSTRING_TO_STRING' 
    EXPORTING 
      in_xstring = l_xstring 
    IMPORTING 
      out_string = l_string. 

But it doesn't works. When i use the following code it is working for uploading and downloading the same document.

But i need to read the content from Slides.

 
CALL METHOD cl_wd_runtime_services=>attach_file_to_response 
    EXPORTING 
           i_filename = 'DATASOURCE ' 
           i_content = l_xstring 
           i_mime_type = 'ppt'. 
i_in_new_window = ABAP_FALSE 
i_inplace = ABAP_FALSE 

If you have any point on this, please provide me.

with thanks in advance,

Kiruba

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,

check this thread

for thomas' reply

If you are going to want to read a file from the client machine, you need the fileUpload UI element. Once uploaded you will have a binary string with the raw contents of the document. Technically this is all you need to read a file from the frontend. But now comes the hard part. I don't think the PPT files are very easy to read. They use a propriatery, Microsoft created binary format. They aren't text based or XML based or anything else that would be easier to read in ABAP.

Microsoft does publish the specifications for the binary format:

http://www.microsoft.com/interop/docs/OfficeBinaryFormats.mspx#EOB

From the looks of the format, you will have to use Bit level processing in ABAP to read the file contents (possible, but a pain in the butt).

regards,

amit

I066686
Participant
0 Kudos

Hi Amit,

Thanks for your reply ...

I have already seen all threads regarding this.

But nowhere they mentioned it is possible or not.

i have already used the FM: HR_KR_XSTRING_TO_STRING

It is not working...

As it is of different format, it will be tuff i think.

Is there any other way of doing this?

with thanks ,

Kiruba.

Former Member
0 Kudos

hi ,

have u tried with FMs SCMS_XSTRING_TO_BINARY and SCMS_BINARY_TO_STRING

isnt working ?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Amit,

>

> Thanks for your reply ...

> I have already seen all threads regarding this.

>

> But nowhere they mentioned it is possible or not.

> with thanks ,

> Kiruba.

Actually I said exactly that it is possible, but very complicated. You aren't going to find a magic function module that extract the data. As stated already, PPT is a propriatery Microsoft binary format. You would have to follow Microsoft's specification to process and extract data from this format.

I066686
Participant
0 Kudos

Hi Amit,

I used both of the FM's which you have given , it is giving same result as the FM HR_KR_XSTRING_TO_STRING which i had used before.

As Thomas said , i have to read the internal format Microsoft binary format and have to try that.

with thanks,

Kiruba.

Former Member
0 Kudos

hi ,

as ur getting the data in Xsting , so use the FMs SCMS_XSTRING_TO_BINARY and SCMS_BINARY_TO_STRING

First convert the xstring to binary. SCMS_XSTRING_TO_BINARY

Then binary to string.

SCMS_BINARY_TO_STRING

It shud help

regards,

amit