2011 Apr 27 1:09 PM
Hello Gurus,
We are creating a new MS word document via SAP and typing some datas and values in it, We could capture those datas into an internal table.But the challenge what we are facing is that, the data which we captured into the internal table is in RAW Format.
We even tried converting them into CHAR format.
In Both the cases(RAW and CHAR) the internal table data is like encryped data.
How can we capture the same data what we type?
Here we are referring SAPRDEMOOFFICEINTEGRATION standard program and using "i_oi_document_proxy" interface.
Waiting for your replies...
2011 Apr 27 3:06 PM
Hi jagan,
you will find the required information in the [documentation|http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCIOFFI.pdf]
If this does not help, you may post relevant parts of your code.
Regards,
Clemens
Hello Gurus,
We are creating a new MS word document via SAP and typing some datas and values in it, We could capture those datas into an internal table.But the challenge what we are facing is that, the data which we captured into the internal table is in RAW Format.
We even tried converting them into CHAR format.
In Both the cases(RAW and CHAR) the internal table data is like encryped data.
How can we capture the same data what we type?
Here we are referring SAPRDEMOOFFICEINTEGRATION standard program and using "i_oi_document_proxy" interface.
Waiting for your replies...
2011 Apr 27 3:06 PM
Hi jagan,
you will find the required information in the [documentation|http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCIOFFI.pdf]
If this does not help, you may post relevant parts of your code.
Regards,
Clemens
2011 Apr 28 4:46 AM
Hi Clemens,
Please let us know where we are going wrong.
The necessary coding part is pasted below.
Here the internal table DOC_TABLE contains RAW records of what we fetch from MS Word.
We tried using RRXWS_RAW_TO_CHAR function module to convert RAW format to CHAR format.
But the data is coming in encrypted format nothing understandable.
CLEAR: DOC_URL.
CALL FUNCTION 'SAP_OI_GET_UNIQUE_URL'
IMPORTING
UNIQUE_URL = DOC_URL
EXCEPTIONS
OTHERS = 0.
CALL METHOD DOCUMENT->SAVE_DOCUMENT_TO_URL
EXPORTING
URL = DOC_URL
IMPORTING
RETCODE = RETCODE.
CALL METHOD C_OI_ERRORS=>SHOW_MESSAGE
EXPORTING
TYPE = 'E'.
CALL FUNCTION 'DP_GET_STREAM_FROM_URL'
EXPORTING
URL = DOC_URL
IMPORTING
SIZE = DOC_SIZE
TABLES
DATA = DOC_TABLE.
CALL METHOD C_OI_ERRORS=>SHOW_MESSAGE
EXPORTING
TYPE = 'E'.
waiting for your replies.....
2011 Apr 28 12:42 PM
Hi jagannathan kri...
probably you try to do something impossible. You think you can read the text you have typed into the word document. This is not provided by The Word Processor Interface. Here we have only methods for search and replace.
You have lot more options with Excel using The Table Interface. I never tried reading the excel, only filling with data from ABAP, but GET methods should give you cell and sheet contents.
The way used in the future will be ADOBE interactive forms, there are some good blogs for that in SCN.
Regards,
Clemens
2011 Apr 28 3:59 PM
Hi Clemens,
Thanks for your guidance....Will lookout for Adobe interactive forms...
With Regards,
Jagan
2011 Apr 28 4:09 PM
Hi jagannathan kri... ,
sorry, now I got a solution for you:
After opening Word and typing something, you can
CALL METHOD document->select_all
CALL METHOD document->copy_selectionto copy everything to the clipboard
and then
call function 'CLPB_IMPORT'
importing
empty = l_empty
tables
data_tab = pt_clipl_empty is an initial CHAR01-variable, pt_clip is a text table, i.e. tape table of CHAR1024.
Sap says CLPB_IMPORT is obsolete, so you may use CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT.
Regards,
Clemens
2011 Apr 29 2:22 PM
Hi Clemens,
We are really thankful to you....
As you said we tried using the methods CALL METHOD document->select_all
CALL METHOD document->copy_selection after creating the word document.
But after creating a word document, the typed data can only be capture on the event ON_CLOSE_DOCUMENT
(please correct us if we are wrong)....
Kindly let us know how can we trigger event ON_CLOSE_DOCUMENT in I_OI_DOCUMENT_PROXY
(We tried a lot on this).....
right now we have referred the program SAPRDEMOOFFICEINTEGRATION and tried registering the events via SETHANDLER
before method CREATE_DOCUMENT.
Waiting for your reply......
2011 Apr 29 3:13 PM
Hi jagannathan krishnan,
I tried it using program SAPRDEMOOFFICEINTEGRATION: Use Create Button, Word opens. Type something into WORD. Use Select All button - all is selected in WORD, Use copy Button. Then, from another program I called the 'CLPB_IMPORT' function and captured the data. Nothing observed for ON_CLOSE_DOCUMENT.
But I don't know if different WORD versions show different behavior. I don't think so because select_all and copy_selection methods of i_oi_document_proxy interface. This should work for all kind of supported documents.
Regards,
Clemens
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |