cancel
Showing results for 
Search instead for 
Did you mean: 

Can't i use OLE in webdynpro?

former_member202077
Participant
0 Kudos

Hello

Pls. let me know is the OLE will not work in a custome WebDynPro application? Because, in debugging it went well, but no MS Word document has been created on my local desktop!!

When i run it as test STAND ALONE report program, it worked well.

When i copied & pasted the same code into my web dynpro appluication, its not creating any MS Word documents on my desktop!!

Actually, i can create the MS Word by using CLASSES also, but, i need the below piece

 
  CALL METHOD OF zword 'EDITREPLACE'
    EXPORTING
    #01 = 'FIND_TEXT'
    #02 = ls_partner1-name_org1
    #03 = 0
    #04 = 0
    #05 = 0
    #06 = 0
    #07 = 0
    #08 = 0
    #09 = 0
    #10 = 1
    #11 = 0
    #12 = 1.

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No you can not use OLE from Web Dynpro. OLE is based upon close desktop integration and this isn't allowed within the Web Browser. The Web Browser is always sandboxed from the rest of the desktop. The only reason it worked while debugging is becuase the code attached to the SAPGUI session of the debugger itself and was able to communicate with your desktop. During normal execution there is no such connection to the SAPGUI.

former_member202077
Participant
0 Kudos

Thank you. got it.

As i mentioned i can create the MS Word on my desktop from webdynpro by using the below code,


  WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
    I_FILENAME   = 'WDP.doc'
    I_CONTENT     =  ls_upload-doc_content
    I_MIME_TYPE = 'WORD' ).

But, my main requirement is to FIND & REPLACE some of the text on this MS Word doc., i am achieving this requirtement with the below code, pls. let me know How can achive the same in webdynpro?


  CALL METHOD OF zword 'EDITREPLACE'
    EXPORTING
    #01 = 'FIND_TEXT'
    #02 = ls_partner1-name_org1
    #03 = 0
    #04 = 0
    #05 = 0
    #06 = 0
    #07 = 0
    #08 = 0
    #09 = 0
    #10 = 1
    #11 = 0
    #12 = 1.

Thank you

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Well you can't use OLE, so you can't really interact much with the document on the client side once it is downloaded. Have you looked at the OfficeControl UI element? Depending upon your requirements, that might be a good option.

http://help.sap.com/saphelp_nw70ehp2/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm

The other option is try and edit the document on the server side before it is downloaded. I see it is type DOC and not DOCX. This could really complicate things since DOC is the older, microsoft propriatery format. Not much you can do to edit that in ABAP. DOCX would at least give you the XML format which would be editable from ABAP.

former_member202077
Participant
0 Kudos

Thank you.

Yes, next month (from Monday) our company decided to swictch on to DOCX (MS Office 2010), all basic prerequirements are done.

But, unfortunately, when i tried this OfficeControl UI element, on execution am getting the below error "An add-on for this website failed to run"m, when i google, i found some setting sin IE, fine.

But, how can change the (FIND & REPLACE the) text on these MS-Word docs? I have XSTRING in my local variable, how can play around with it?

Thank you

former_member202077
Participant
0 Kudos

Any help pls.

Thank you