Skip to Content
author's profile photo Former Member
Former Member

gs_documents using OLE not getting populated in ECC6


We are doing upgrade from 4.7 to ECC6. While testing one of the program which uses OLE and downloads few details to MSWORD, we noticed that few of the variables of type OBJ_RECORD are not getting populated in the program. So few of the details are missing in MSWORD. We compared the program in old and new version and found that there are no differences in the code.

Pasted below is one piece of code in which the variable is not getting populated.




DATA: gs_word TYPE ole2_object, "OLE object handle

gs_documents TYPE ole2_object, "Documents

gs_tables TYPE ole2_object, "Tables

gs_range TYPE ole2_object, "Range handle for various ranges

gs_table TYPE ole2_object, "One table

gs_table_border TYPE ole2_object, "Table border

gs_cell TYPE ole2_object, "One cell of the table

CREATE OBJECT gs_word 'WORD.APPLICATION' . " We get the values in the structure gs_word after the execution of this statement.

*--Setting object's visibility property

SET PROPERTY OF gs_word 'Visible' = '1' .

*--Opening a new document

GET PROPERTY OF gs_word 'Documents' = gs_documents . " Though sy-subrc returns 0, gs_documents will not get populated.

CALL METHOD OF gs_documents 'Add' .

GET PROPERTY OF gs_table 'Borders' = gs_table_border .

SET PROPERTY OF gs_table_border 'Enable' = '1' . "With border " Returns sy-subrc Eq 3 and gs_table_border will be empty

CALL METHOD OF gs_table 'Cell' = gs_cell " gs_table will be blank so is gs_cell.


#1 = '1' "first row

#2 = ld_counter. "column

*--Getting the range handle to write the text

GET PROPERTY OF gs_cell 'Range' = gs_range . "returns sy-subrc eq 2.

As i m new to ABAP OLE, i m not able to figure out the error. Can sombody help me solve this.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2011 at 01:23 AM


    Did you solved the problem,Our problem same you,If you solved it,can you tell me how to do it? Thank you!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.