2006 Aug 11 7:32 AM
Hi all,
Here is my problem : I want to create a form under Word, and fill the fields with SAP.
So I created my form under Word, adding a field name. Then I inserted it in the BDN through transaction OAOR.
In my Abap program, I open this BDS doc using method OPEN_DOCUMENT of a I_OI_DOCUMENT_PROXY instance.
This works fine.
But I instance a I_OI_FORM object using method GET_FORM_INTERFACE of my I_OI_DOCUMENT_PROXY instance, and I want to retrieve the fields of my form using method GET_DATA of the I_OI_FORM instance.
But this results in an empty table, and my field "name" is not found.
Could anyone help find what I missed there ?
Thanx for ur help.
Olivier
CALL METHOD i_control->get_document_proxy
EXPORTING
document_type = 'Word.Document'
register_container = 'X'
IMPORTING
document_proxy = i_document.
*item_url contains the document's URL, so call open_document to open it
CALL METHOD i_document->open_document
EXPORTING
open_inplace = w_inplace
document_url = w_url.
*check if desktop application supports mail merge, and if yes get an
*instance of the interface
CALL METHOD i_document->has_mail_merge_interface
IMPORTING
is_available = has.
IF NOT has IS INITIAL.
CALL METHOD i_document->get_form_interface
IMPORTING
f_interface = handle.
IF NOT handle IS INITIAL.
CALL METHOD handle->protect
EXPORTING
protect = ' '.
CALL METHOD handle->get_data
EXPORTING
all = 'X'
IMPORTING
fields = tabel.
Hi all,
Here is my problem : I want to create a form under Word, and fill the fields with SAP.
So I created my form under Word, adding a field name. Then I inserted it in the BDN through transaction OAOR.
In my Abap program, I open this BDS doc using method OPEN_DOCUMENT of a I_OI_DOCUMENT_PROXY instance.
This works fine.
But I instance a I_OI_FORM object using method GET_FORM_INTERFACE of my I_OI_DOCUMENT_PROXY instance, and I want to retrieve the fields of my form using method GET_DATA of the I_OI_FORM instance.
But this results in an empty table, and my field "name" is not found.
Could anyone help find what I missed there ?
Thanx for ur help.
Olivier
CALL METHOD i_control->get_document_proxy
EXPORTING
document_type = 'Word.Document'
register_container = 'X'
IMPORTING
document_proxy = i_document.
*item_url contains the document's URL, so call open_document to open it
CALL METHOD i_document->open_document
EXPORTING
open_inplace = w_inplace
document_url = w_url.
*check if desktop application supports mail merge, and if yes get an
*instance of the interface
CALL METHOD i_document->has_mail_merge_interface
IMPORTING
is_available = has.
IF NOT has IS INITIAL.
CALL METHOD i_document->get_form_interface
IMPORTING
f_interface = handle.
IF NOT handle IS INITIAL.
CALL METHOD handle->protect
EXPORTING
protect = ' '.
CALL METHOD handle->get_data
EXPORTING
all = 'X'
IMPORTING
fields = tabel.
2006 Nov 23 10:17 AM
Hello Oliver,
Did you solve this problem ? I am encountering the same problem that you are describing.
If you solved this problem can you send me de solution.
Thanks in advanced.
Regards Hicham
2007 Jan 29 6:05 PM
Did you guys figure this out?
There is a difference between a FORM interface and a MAILMERGE interface.
I have made use of the following to retrieve the list of mailmerge fields defined in the Word document:
CALL METHOD DOCUMENT->HAS_MAIL_MERGE_INTERFACE
IMPORTING
IS_AVAILABLE = HAS.
IF NOT HAS IS INITIAL.
CALL METHOD DOCUMENT->GET_MAIL_MERGE_INTERFACE
IMPORTING
MM_INTERFACE = MM_HANDLE.
IF NOT MM_HANDLE IS INITIAL.
refresh: mm_fieldnames_tab.
CALL METHOD MM_HANDLE->GET_FIELDS
IMPORTING
descr_list = mm_fieldnames_tab.
....
Regards,
Bruce de Wet
2010 Sep 09 3:49 PM
Hello,
I had the same problem. The problem is because the MS-Word document properties are not correctly set. Have a look (in Word) under File > Properties on the Personalization tab. For every form field you create you must create a connection at that place.
Then and only then the structure returned by GET/SET_DATA is correctly recognized.
2011 Jun 27 2:57 PM
Hi,
Please send the setting you have done in Office - 2007 for Mail Merge.I'm facing the same issue.I didn't find any Personalized Tab in File -> Properties.
Thanks and Regards,
Kumar
2011 Oct 27 11:02 AM
Hi, can anyone please show me how to do the settings in word 2007, cause I'm facing the same problem and didn't find any Personalized Tab in File -> Properties.
Thanks and Regards.
Guy
2011 Oct 27 11:02 AM
Hi, can anyone please show me how to do the settings in word 2007, cause I'm facing the same problem and didn't find any Personalized Tab in File -> Properties.
Thanks and Regards.
Guy
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |