SAP OLE
Hi,
While maintaining Standard text in MS-WORD it giving a error 'Internal error in SAP OLE Container Control'.
According to my knowlegde its giving error because some file missed in msofficeintegration in OLE.
But i am unable to sort out this problem.
If any one have idea in this pls reply me.
Hello,
Try this for Landscape (all ole objects are of type OLE2_OBJECT)
CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
IF SY-SUBRC NE 0.
WRITE: / 'No EXCEL creation possible'.
STOP.
ENDIF.
SET PROPERTY OF EXCEL 'DisplayAlerts' = 0.
CALL METHOD OF EXCEL 'WORKBOOKS' = WORKBOOK .
SET PROPERTY OF EXCEL 'VISIBLE' = 1.
* creating workbook
SET PROPERTY OF EXCEL 'SheetsInNewWorkbook' = 1.
CALL METHOD OF WORKBOOK 'ADD'.
CALL METHOD OF EXCEL 'WORKSHEETS' = SHEET.
CALL METHOD OF SHEET 'ADD'.
FREE OBJECT SHEET.
CALL METHOD OF EXCEL 'WORKSHEETS' = SHEET
EXPORTING
#1 = 1.
GET PROPERTY OF sheet 'PageSetup' = h_pagesetup.
set PROPERTY OF h_pagesetup 'Orientation' = 2.
Similar Messages
-
INTERNAL ERROR IN SAP OLE DOCUMENT CONTAINER CONTROL. in transaction PBWW
Well while running a transaction PBWW when we click on create button it opens the word document with the
text in it but suddenly the text is gone and it is showing a error which is INTERNAL ERROR IN SAP OLE DOCUMENT CONTAINER CONTROL.
how can it be resolved????
Thanks And regards
AmitFriend,
See this line from OSS#427615:
Note:
This note is a continuation of the correction from Note 402195 (Stabilization of the Word interface). Thus, the correction from Note 402195 is an absolutely necessary prerequisite for this note.
i'm about to sure that if you implement first 402195 than 427615 problem would be solved.
Both OSS are made in continuation. -
I have used this coding for sap OLE to Ms word... but if i run this program... MS Word just opens but i am not able to view any of the statements... that is new documents are not openings and the statements are not reflecting...
Any one give me a tips what to change in this following code...
Include for OLE-enabling definitions
INCLUDE ole2incl .
*Global variables *Variables to hold OLE object and entity handles
DATA: gs_word TYPE ole2_object ,
*"OLE object handle
gs_documents TYPE ole2_object ,
*"Documents
gs_actdoc TYPE ole2_object , "Active document
gs_application TYPE ole2_object , "Application
gs_options TYPE ole2_object , "Application options
gs_actwin TYPE ole2_object , "Active window
gs_actpan TYPE ole2_object , "Active pane
gs_view TYPE ole2_object , "View
gs_selection TYPE ole2_object , "Selection
gs_font TYPE ole2_object , "Font
gs_parformat TYPE ole2_object , "Paragraph format
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 a table
gs_paragraph TYPE ole2_object , "Paragraph
gv_pos(5) TYPE n . "Position information for table
START-OF-SELECTION .
*--Creating OLE object handle variable
CREATE OBJECT gs_word 'WORD.APPLICATION' .
IF sy-subrc NE 0 .
MESSAGE s000(su) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF gs_word 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF gs_word 'Documents' = gs_documents .
**--Setting the measurement unit
GET PROPERTY OF gs_application 'Options' = gs_options .
SET PROPERTY OF gs_options 'MeasurementUnit' = '1' . "CM
*Getting handle for the selection which is here the character at the *cursor position
GET PROPERTY OF gs_application 'Selection' = gs_selection .
GET PROPERTY OF gs_selection 'Font' = gs_font .
GET PROPERTY OF gs_selection 'ParagraphFormat' = gs_parformat .
*--Setting font attributes
SET PROPERTY OF gs_font 'Name' = 'Arial' .
SET PROPERTY OF gs_font 'Size' = '10' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '1' . "Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '2' . "Right-justified
CALL METHOD OF gs_selection 'TypeText'
EXPORTING #1 = 'This is an OLE example!'.
*--Setting the view to the main document again
SET PROPERTY OF gs_view 'SeekView' = '0' . "Main document view
*--Reseting font attributes for the title
SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
SET PROPERTY OF gs_font 'Size' = '16' .
SET PROPERTY OF gs_font 'Bold' = '1' . "Bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '1' . "Centered
CALL METHOD OF gs_selection 'TypeText'
EXPORTING #1 = text-001.
*--Advancing cursor to the new line
CALL METHOD OF gs_selection 'TypeParagraph' .
*--Reseting font attributes for ordinary text
SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
SET PROPERTY OF gs_font 'Size' = '12' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '3' . "Justified
CALL METHOD OF gs_selection 'TypeText'
EXPORTING #1 = text-001.
*--skip some lines
DO 4 TIMES .
CALL METHOD OF gs_selection 'TypeParagraph' .
ENDDO .
*--Getting entity handles for the entities on the way
GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
GET PROPERTY OF gs_selection 'Range' = gs_range .
*--Adding a table with 3 rows and 2 columns
CALL METHOD OF gs_tables 'Add' = gs_table
EXPORTING #1 = gs_range " Handle for range entity
#2 = '3' "Number of rows
#3 = '2'. "Number of columns
*--Setting border attribute for the table
GET PROPERTY OF gs_table 'Borders' = gs_table_border .
SET PROPERTY OF gs_table_border 'Enable' = '1' . "With border
*Filling the table with dummy data *Reseting font attributes for table content
SET PROPERTY OF gs_font 'Name' = 'Garamond' .
SET PROPERTY OF gs_font 'Size' = '11' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Getting cell coordinates
CALL METHOD OF gs_table 'Cell' = gs_cell
EXPORTING #1 = '1' "first row
#2 = '1'. "first column
*--Getting the range handle to write the text
GET PROPERTY OF gs_cell 'Range' = gs_range .
*--Filling the cell
SET PROPERTY OF gs_range 'Text' = 'OLE' .
*--Getting cell coordinates
CALL METHOD OF gs_table 'Cell' = gs_cell
EXPORTING
#1 = '3' "third row
#2 = '2'. "second column
*--Reseting font attributes for ordinary text
SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
SET PROPERTY OF gs_font 'Size' = '12' .
SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
*--Setting paragraph format attribute
SET PROPERTY OF gs_parformat 'Alignment' = '3' . "Justified *--Indent the paragraph once
GET PROPERTY OF gs_selection 'Paragraphs' = gs_paragraph .
CALL METHOD OF gs_paragraph 'Indent' .
CALL METHOD OF gs_selection 'TypeText'
EXPORTING
#1 = text-001.
FREE OBJECT gs_word .
Thanks @ Regards,
HemaHI Hema,
To open new document add this line.
*--Opening a new document
get property of gs_word 'Documents' = gs_documents.
call method of gs_documents 'ADD' ."= gs_document.
Regards,
Sravanthi -
RE: Internal error in SAP OLE document container control
Hi,
When i execute the transaction for assigning standard document to an applicant activity, PBWW, i get an error message stating 'Internal error in SAP OLE document container control'. Please help me out of this problem.
We are using SAP version ECC 6
Thanks and Regards,
sowmyaHi,
Sorry for replying so late.
Follow these steps
Create a report ZPAPUT04 in your system.
Using ZPAPUT04, upload all the templates in TEMPLATES.zip one by one. Please make sure that only the option 'Upload' in the selection screen is chosen. You have to pass the other inputs as given below
If you have extracted the templates in the 'C: \ folder of your system
then
For R3_TP97_E.dot template
FILENAME = C:\R3_TP97_E.DOT
DOTNAME = R3_TP97_E
For TEMPLATE_E.DOT template
FILENAME = C:\TEMPLATE_E.DOT
DOTNAME = TEMPLATE_E
Execute the upload program ZPAPUT04
For R3_TP97A_E.dot template
FILENAME = C:\R3_TP97A_E.DOT
DOTNAME = R3_TP97A_E
Execute the upload program ZPAPUT04
<b>Report to be executed</b>
REPORT ZPAPUT04 .
types: begin of data_type,
line(132) type x,
end of data_type.
DATA langu type thead-tdspras VALUE 'D'.
DATA data_x type table of data_type.
DATA wa_data_x type data_type.
DATA text type table of tline.
DATA wa_text type tline.
DATA header type thead.
DATA header_x type xstring.
field-symbols: <data_x> type x,
<text> type x.
DATA filename type string.
parameters: file_c(128) default 'C:\R3_TP97_D.DOT',
dotname type TDOBNAME default 'R3_TP97_D',
download as checkbox default 'X',
upload as checkbox default 'X'.
DATA bytes_up type i.
DATA bytes_down type i.
DATA result1 type string.
DATA result2 type string.
data charsize type i.
class CL_ABAP_CHAR_UTILITIES definition load.
charsize = CL_ABAP_CHAR_UTILITIES=>charsize.
filename = file_c.
if upload = 'X'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = filename
FILETYPE = 'BIN'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH = bytes_up
HEADER =
TABLES
DATA_TAB = data_x
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF bytes_up <= 0.
result1 = 'UPLOAD ERROR ?:o('.
ELSE.
result1 = 'UPLOAD OK :o)'.
ENDIF.
LOOP AT data_x INTO wa_data_x.
assign wa_data_x-line to <data_x> casting.
assign wa_text-tdline to <text> casting.
<text> = <data_x>.
append wa_text TO text.
ENDLOOP.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
ID = 'TAPP'
LANGUAGE = langu
NAME = dotname
OBJECT = 'APP-DOT'
IMPORTING
HEADER = header
TABLES
LINES = text
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT data_x INTO wa_data_x.
assign wa_data_x-line to <data_x> casting.
assign wa_text-tdline to <text> casting.
<text> = <data_x>.
append wa_text TO text.
ENDLOOP.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = '000'
HEADER = header
INSERT = ' '
SAVEMODE_DIRECT = ' '
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = text
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
if download = 'X'.
refresh data_x.
refresh text.
clear wa_data_x.
clear wa_text.
unassign <data_x>.
unassign <text>.
DOWNLOAD
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = '000'
ID = 'TAPP'
LANGUAGE = langu
NAME = dotname
OBJECT = 'APP-DOT'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = text
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT text INTO wa_text.
assign wa_data_x-line to <data_x> casting.
assign wa_text-tdline to <text> casting.
<data_x> = <text>.
append wa_data_x TO data_x.
ENDLOOP.
*DATA fn_length type i.
*DATA offset type i.
*fn_length = strlen( file_c ).
*offset = fn_length - 4.
*concatenate filename(offset) '_DOWN' filename+offset(4) INTO filename.
IF upload <> 'X'.
DATA dx_ln type i.
describe table data_x lines dx_ln.
bytes_up = dx_ln * sy-tleng.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = bytes_up
FILENAME = filename
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
IMPORTING
FILELENGTH = bytes_down
TABLES
DATA_TAB = data_x
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF bytes_down <> bytes_up and upload = 'X'.
result2 = 'DOWNLOAD ERROR ?:o('.
ELSEIF bytes_down > 0.
result2 = 'DOWNLOAD OK :o)'.
ELSE.
result2 = 'DOWNLOAD ERROR ?:o('.
ENDIF.
endif.
write: result1, / result2, / 'Bytes per Character: ', charsize.
Download the template attached to note 558548
Regards,
Sowmya -
Internal error in SAP OLE document container control
While opening WW-Invitation in so10 with standard text - WW-INVITATION where Text ID - Palt the doc is not opening and the following error as coming :
Internal error in SAP OLE document container control
Message no. SOFFICEINTEGRATION019
Can any body suggest the solution on this.....
We have SAP HR patch level 72 .
I checked in the scn they are saying about some note but those note are not applicable in my system
ThanksSame thing over here.
ECC5.0, SAP GUI 7.1 Comp 3 (win).
Whenever I try to open any Document (Transaction PBWW) I get the same error: Word 2007 opens and as soon as the document itself is loaded, it vanishes. All that is left, is the GUI showing the "Internal Error in SAP OLE Document Container Control" (SOFFICEINTEGRATION019).
What's wrong with that. GUI 6.4 and 7.1 Comp. 2 did their job...
Even GUI 7.1 Comp. 3 and Word 2003 do as they're supposed to and open the documents nicely.
What I've found out is that the Word template R3_TP97_D.dot which is created in the temporary folder in Windows needs to be deleted before using PBWW. Once the file is gone, opening any document via PBWW succeeds. SAP Note 558548 does not resolve the issue.
Regards, Oliver
Edited by: Oliver Günther on Sep 15, 2009 1:34 PM
Edited by: Oliver Günther on Sep 15, 2009 1:37 PM -
hi i worked on sap ole 2 to word and excel.. but i do not know how to proceed with visio.can anyone give me a sample code to work on visio
It s too complicated i went through structural graphics and solved
-
SAP OLE to Word Usage of Text Boxes & Arrow Diagrams
hi this my Macro recording in MS word How to use this as sap Code using SAP OLE
' Macro recorded 3/30/2009 by Nirmala
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 216#, _
72#, 108#, 54#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.TypeText Text:="Hma"
Selection.ShapeRange.Select
ActiveDocument.Shapes.AddLine(207#, 135#, 261#, 207#).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
Selection.ShapeRange.Flip msoFlipHorizontal
ActiveDocument.Shapes.AddLine(261#, 135#, 306#, 198#).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Selection.ShapeRange.Line.EndArrowheadLength = msoArrowheadLengthMedium
Selection.ShapeRange.Line.EndArrowheadWidth = msoArrowheadWidthMedium
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 153#, _
216#, 90#, 54#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.TypeText Text:="xys"
Selection.ShapeRange.Select
ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 297#, _
207#, 81#, 63#).Select
Selection.ShapeRange.TextFrame.TextRange.Select
Selection.Collapse
Selection.TypeText Text:="lop"hi
Hthis is my sap program.. where to use this coding concept what are the data s to be declared
*DATA declarations
*--Include for OLE-enabling definitions
INCLUDE ole2incl .
*--Global variables *--Variables to hold OLE object and entity handles
DATA: word TYPE ole2_object , "OLE object handle
documents TYPE ole2_object , "Documents
doc TYPE ole2_object , "Documents
actdoc TYPE ole2_object , "Active document
application TYPE ole2_object , "Application D
options TYPE ole2_object , "Application options
actwin TYPE ole2_object , "Active window
actpan TYPE ole2_object , "Active pane
view TYPE ole2_object , "View
selection TYPE ole2_object , "Selection
font TYPE ole2_object , "Font
parformat TYPE ole2_object , "Paragraph format
tables TYPE ole2_object , "Tables
range TYPE ole2_object , "Range handle for various ranges
table TYPE ole2_object , "One table
table_border TYPE ole2_object , "Table border
cell TYPE ole2_object , "One cell of a table
paragraph TYPE ole2_object , "Paragraph
shapes TYPE ole2_object ,
logo TYPE ole2_object ,
textbox TYPE ole2_object,
find TYPE ole2_object,
picture(128) ,
gv_pos(5) TYPE n . "Position information for table
START-OF-SELECTION .
picture = 'D:\BMP\test.bmp'.
*-Creating OLE object handle variable
CREATE OBJECT word 'WORD.APPLICATION' .
IF sy-subrc NE 0 .
MESSAGE s000(su) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*-Setting object's visibility property
SET PROPERTY OF word 'Visible' = '1' .
* Adding documents
CALL METHOD OF word 'DOCUMENTS' = documents.
* Adding New page
CALL METHOD OF documents 'Add' = doc.
* Retrieving thre Property of Word for Alignment Changes
GET PROPERTY OF word 'Selection' = selection.
GET PROPERTY OF selection 'Font' = font .
GET PROPERTY OF selection 'ParagraphFormat' = parformat.
* Changes in Our Requirement
SET PROPERTY OF font 'Name' = 'Arial' .
SET PROPERTY OF font 'Size' = '20' .
SET PROPERTY OF font 'Bold' = '1' . "Not bold
SET PROPERTY OF font 'Italic' = '1' . "Italic
SET PROPERTY OF font 'Underline' = '1' . "Not underlined
* Paragraph Format 1 - Center 2 - Right 3 - Left
SET PROPERTY OF parformat 'Alignment' = '1'.
* Text to be displayed
CALL METHOD OF selection 'TypeText'
EXPORTING
#1 = 'Organisational Structure'.
*--Getting active document handle
GET PROPERTY OF word 'activedocument' = actdoc .
* To Save the document
CALL METHOD OF doc 'SaveAs'
EXPORTING
#1 = 'D:\TEMP\WordFormatOLE.doc'.
** To Quit the Document
CALL METHOD OF word 'Quit' . -
Errors in excel using SAP OLE DB connection
I'm trying to use the OLE DB connector in excel and keep getting the following error when I try to connect to our BW system:
u201CCannot process Unicode RFC in non-Unicode systemu201D
Has anyone else encountered this problem, and gotten around it? We are not unicode yet, is this a requirement for using this connector and if so is there a non-unicode equivalent? Appreciate any help. Thank you.
Ivano
PS- Here's a couple of the articles I've been trying to follow:
http://www.bi-expertonline.com/article.cfm?id=5048&s=4717b805-004b-4f5d-b703-3b414486e53f
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1031a475-a633-2a10-f4b4-ccfe615c0517bumpity bump bump
-
SAP OLE - Create Hyperling on a Word Document
Hi,
My next step of creating a word document using OLE is to define some hyperlinks on a document. I have ran a macro in word to 'see what it does' when manually creating a hyperlink. Below is the macro: -
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:="", _
SubAddress:="_Program_Z_OPEN_HRS_UPD_WRF1", ScreenTip:="", TextToDisplay _
:="This is the program"
I have tried to implement this using ABAP with no success. Maybe because I still dont fully understand how to interprete these marcos as ABAP.
Has anybody created a hyperlink on a word document before, if so, seeing the code would be a great help.
Thanks
Martin
Edited by: Martin Shinks on Dec 21, 2011 9:52 AMNever mind, with a bit of jiggery pokery, I fixed it myself.
-
Error : Internal Error in SAP OLE document container control
Hi ,
In recruitment module, when i try to display letter in applicant activity above error occurs. i need to set SAP Script in standard text , Please let me know how to make SAP Script settings.
Regards,
RahulHi rahul
Here also i am geting same problem.
how could u overcome that one.
Plz tell me -
hi all ,
I am working with organisation chart. i want to insert the org chart in excel. this is my recording in excel
ActiveSheet.OLEObjects.Add(ClassType:="OrgChart", Link:=False, _
DisplayAsIcon:=False).Activate
For this i have used this following code But it is not working what i have to change in this coding
CALL METHOD OF excel 'WORKBOOKS' = workbooks.
CALL METHOD OF workbooks 'ADD' = workbook.
*CALL METHOD OF excel 'ACTIVESHEET' = activesheet.
GET PROPERTY OF excel 'ACTIVESHEET' = activesheet.
GET PROPERTY OF activesheet 'OLEObjects' = oleobjects.
GET PROPERTY OF oleobjects 'Add' = add.
CALL METHOD OF oleobjects 'Add'
EXPORTING
#1 = 'OrgChart'
#2 = '2'
#3 = '2' .
CALL METHOD OF oleobjects 'Activate'.
Plz anyone give ur idea to correct ithi sravanthi,
I am not able to get the answer now also.. i went throgh the document but i am not able to locate my error.. -
Dump while running a program with OLE Excel download facility in ITS
Hi,
Because of some complex requirment, I had created a report program which will download the data to an Excel sheet using SAP OLE Automation Controller. For this report i had created a tcode too.
The report which i developed is perfectly working fine in SAPGUI. But if i access the same report throught SAP ITS serice. I am getting a dump. Please find below the dump details. I am not able to figure it out why the dump is not coming in SAPGUI.
Runtime Errors MESSAGE_TYPE_X
Date and Time 09.03.2010 05:35:41
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
|
Error analysis
Short text of error message:
Control Framework : Error processing control
Long text of error message:
Diagnosis
An error occurred when the system tried to process the commands
from the Automation Queue on the presentation server.
There are several possible reasons for this:
- The installation of the SAP GUI on the presentation server is
faulty or obsolete.
- There is an error in the application program
- There is an error in the SAPGUI or an integrated control
Procedure
1. Make sure that you have imported the appropriate Support
Package, the current kernel, and GUI patch for the release of your
system
2. Check whether the error occurs locally on one or a few PCs, or
generally on all PCs. Note whether the error only occurs for some
users, for example because of a specific Customizing setting.
If it only occurs locally, this suggests an installation problem
with the PC. Check the installation; if necessary, reinstall the
software. In the dump, search for the SY-MSGLI field, since it may
point to the cause of the error.
3. Activate the Automation Trace (in accordance with SAP Note
158985).
4.Start the transaction and continue until the screen immediately
before the dump.
5. From the System -> Utilities menu, choose Autom. Queue,
Synchronous Processing.
The status bar of the GUI displays the text:
"Automation synchron flush mode on"
6. If you now proceed with the application, the short dump will
display the ABAP call that caused the error; the Automation Trace
will contain the error on the presentation server.
7. If necessary, load the short dump and trace files on to
sapservX, so that SAP can analyze them.
Technical information about the message:
Message class....... "CNDP"
Number.............. 006
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLOLEA" or "LOLEAU02"
"AC_SYSTEM_FLUSH"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
User and Transaction
Client.............. 120
User................ "XXXXXX"
Language Key........ "E"
Transaction......... "ZGA_BEACON_SOX_RPT "
Transactions ID..... "4B95E2560EB62F9AE10000000A241C33"
Program............. "SAPLOLEA"
Screen.............. "ZGA_REP_BEACON_SOX_REPORT 9000"
Screen Line......... 0
Information on Caller ofr "HTTP" Connection:
Plug-in Type.......... "HTTP"
Caller IP............. "10.36.28.52"
Caller Port........... 8000
Universal Resource Id. "/sap/bc/gui/sap/its/webgui/~flNUQVRFPTIzNzIxLjAxNC4wNC4
wNA=="Hi All,
FYI.....
As I said because of my complex requirement, i am using OLE excel download facilities to download the data. ITS wont support this OLE download facility. This can be done only through local SAP GUI.
The reason for this is that, when i am using this download facility through SAP GUI, OLE object thats used in my report program will directly talk to the Local OLE excel objects (i.e. the local installed Excell application) and download the data. But if it's through ITS, my program wont be able to communicate with the local excel OLE objects because of this i am getting a DUMP.
Thank You all for the support. All the best in future.
Regards
Maneesh Chandran -
Dump while executing a OLE Excel download report feature in ITS
Hi,
Because of some complex requirment, I had created a report program which will download the data to an Excel sheet using SAP OLE Automation Controller. For this report i had created a tcode too.
The report which i developed is perfectly working fine in SAPGUI. But if i access the same report throught SAP ITS serice. I am getting a dump. Please find below the dump details. I am not able to figure it out why the dump is not coming in SAPGUI.
Runtime Errors MESSAGE_TYPE_X
Date and Time 09.03.2010 05:35:41
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
|
Error analysis
Short text of error message:
Control Framework : Error processing control
Long text of error message:
Diagnosis
An error occurred when the system tried to process the commands
from the Automation Queue on the presentation server.
There are several possible reasons for this:
- The installation of the SAP GUI on the presentation server is
faulty or obsolete.
- There is an error in the application program
- There is an error in the SAPGUI or an integrated control
Procedure
1. Make sure that you have imported the appropriate Support
Package, the current kernel, and GUI patch for the release of your
system
2. Check whether the error occurs locally on one or a few PCs, or
generally on all PCs. Note whether the error only occurs for some
users, for example because of a specific Customizing setting.
If it only occurs locally, this suggests an installation problem
with the PC. Check the installation; if necessary, reinstall the
software. In the dump, search for the SY-MSGLI field, since it may
point to the cause of the error.
3. Activate the Automation Trace (in accordance with SAP Note
158985).
4.Start the transaction and continue until the screen immediately
before the dump.
5. From the System -> Utilities menu, choose Autom. Queue,
Synchronous Processing.
The status bar of the GUI displays the text:
"Automation synchron flush mode on"
6. If you now proceed with the application, the short dump will
display the ABAP call that caused the error; the Automation Trace
will contain the error on the presentation server.
7. If necessary, load the short dump and trace files on to
sapservX, so that SAP can analyze them.
Technical information about the message:
Message class....... "CNDP"
Number.............. 006
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLOLEA" or "LOLEAU02"
"AC_SYSTEM_FLUSH"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
User and Transaction
Client.............. 120
User................ "XXXXXX"
Language Key........ "E"
Transaction......... "ZGA_BEACON_SOX_RPT "
Transactions ID..... "4B95E2560EB62F9AE10000000A241C33"
Program............. "SAPLOLEA"
Screen.............. "ZGA_REP_BEACON_SOX_REPORT 9000"
Screen Line......... 0
Information on Caller ofr "HTTP" Connection:
Plug-in Type.......... "HTTP"
Caller IP............. "10.36.28.52"
Caller Port........... 8000
Universal Resource Id. "/sap/bc/gui/sap/its/webgui/~flNUQVRFPTIzNzIxLjAxNC4wNC4
wNA=="Check the following example to download in excel
INCLUDE ole2incl.
*& TYPES *
TYPES: BEGIN OF ty_spfli,
kunnr TYPE kna1-kunnr,
land1 TYPE kna1-land1,
NAME1 TYPE KNA1-NAME1,
ORT01 TYPE KNA1-ORT01,
REGIO TYPE KNA1-REGIO,
ADRNR TYPE KNA1-ADRNR,
END OF ty_spfli.
TYPES: BEGIN OF ty_titles,
title(20) TYPE c,
field(20) TYPE c,
END OF ty_titles.
*& INTERNAL TABLES *
DATA: t_spfli TYPE STANDARD TABLE OF ty_spfli,
t_titles TYPE STANDARD TABLE OF ty_titles.
*& FIELD-SYMBOLS *
FIELD-SYMBOLS: <fs_spfli> LIKE LINE OF t_spfli,
<fs_titles> LIKE LINE OF t_titles,
<fs> TYPE ANY.
*& VARIABLES *
DATA: w_tabix TYPE sy-tabix,
w_titles TYPE sy-tabix,
w_line TYPE sy-tabix,
w_field TYPE string,
filename TYPE string,
path TYPE string,
fullpath TYPE string.
DATA: data_titles TYPE REF TO data.
DATA: e_sheet TYPE ole2_object,
e_activesheet TYPE ole2_object,
e_newsheet TYPE ole2_object,
e_appl TYPE ole2_object,
e_work TYPE ole2_object,
e_cell TYPE ole2_object,
e_color TYPE ole2_object,
e_bold TYPE ole2_object.
*& SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS: p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b1.
*& START-OF-SELECTION *
START-OF-SELECTION.
PERFORM get_titles.
PERFORM get_data.
PERFORM create_excel. -
Crystal Developer XI without Sap integration kits cant see released Queries
Hi All!
When I'm used MS Excel, I can see released SAP BW Queries via SAP OLE DB access. But when I'm used Crystal Developer XI (without Sap integration kits), I cant see released SAP BW Queries via SAP OLE DB access.
What's a problem here?
WBR ArtemHi,
you missing the SAP integration Kit. To conenct to SAP BW you need the SAP Integration Kit installed.
ingo -
Updating or Modifying using OLE
Hi experts,
I have a requirement where i need to modify the existing word/excel template with some values. I know this can be done by uploading, modifying and then downloading the document. But i want to know how to achieve this using OLE concepts ?
Regards,
VijayalakshmiHI,
another question,
will the template be available from SAP DMS, or will it be on presentation/application server?
If it is in SAP DMS, then using CVAPI_DOC_VIEW you can create a replica of it in the SAP working directory, use OLE objects to read/update values in the cell and SAVE it as a new copy ata given location.
If the file is on the presentation server then you can make a copy of it in SAp working directory, again make use of SAP OLE objects to read/update values in the cell and SAVE it as a new copy ata given location.
Sample code
* START THE EXCEL APPLICATION
CREATE OBJECT excel 'EXCEL.APPLICATION'.
CALL METHOD OF excel 'WORKBOOKS' = workbooks.
SET PROPERTY OF excel 'VISIBLE' = 0.
CALL METHOD OF workbooks 'OPEN' EXPORTING
#1 = filep.
CALL METHOD OF excel 'Worksheets' = sheet
EXPORTING #1 = 1.
CALL METHOD OF sheet 'Activate'.
* FREE OBJECT sheet.
* Fill the requried cells
CALL METHOD OF excel 'CELLS' = cells EXPORTING #1 = 1 #2 = 31.
SET PROPERTY OF cells 'VALUE' = l_sign_path.
FREE OBJECT cells.
GET PROPERTY OF excel 'ACTIVESHEET' = sheet.
CALL METHOD OF sheet 'SAVEAS' EXPORTING
#1 = g_file_dest
#2 = 1.
CALL METHOD OF workbooks 'CLOSE'.
CALL METHOD OF excel 'QUIT'.
FREE OBJECT excel.
Hope this helps.
Maybe you are looking for
-
Fields update on Table maintenance generator screen
HI All.. I have a custom table with five fields. I did table maintenance generator on it. It has Screen 1 as overview screen and scree 2 as single screen. Now of the five fields two fields are user name and date. When i enter data on the other three
-
Return 2D array from web service
Hi All, I am new to web services development and start developing web service using net bean 6.9. I want to create the web service which needs to return the 2-d array. So i created it like this public Object[][] getData(@WebParam(name = "startDate")
-
Easy Transfer not transferred to Windows 10?
Loved Windows Easy Transfer. For non-domain user accounts it was a great little tool. Will miss that feature. Wonder if MS will bring in anything similar in future upgrades? This topic first appeared in the Spiceworks Community
-
I have adobe premiere elements 12 can not open wmv file made in windows 8 ?
wmv file not recognized
-
Error 1418 after ipod 60GB vid skipped then froze competely.
My ipod 60GB video started to skip tracks, then froze completely. I tried the resetting and this helped to get normal screen back but minus all my music. Next I tried restoring but it came up with above error message. I seem now to have tried everyth