2007 Sep 03 9:25 AM
Hi,
How exactly do I export data to a Word template? I have a custom program in which data is stored in an internal table. I would like to create an option for the user so that a Word template is opened and the fields are filled with the data from SAP.
For example, transaction FBL5N has this option: File->Export->Word Processing.
I would like to have something like that.
Thanks!
2007 Sep 03 9:59 AM
You can use FM - <b>ALV_WORD_EXECUTE_SIMPLE_LIST</b> for doing this.
You need to pass your internal table to this FM alongwith ur ALV fieldcatalog - and you will be able to export your internal table in the same way FBL1N does.
Cheers.
SKC.
Hi,
How exactly do I export data to a Word template? I have a custom program in which data is stored in an internal table. I would like to create an option for the user so that a Word template is opened and the fields are filled with the data from SAP.
For example, transaction FBL5N has this option: File->Export->Word Processing.
I would like to have something like that.
Thanks!
2007 Sep 03 9:59 AM
You can use FM - <b>ALV_WORD_EXECUTE_SIMPLE_LIST</b> for doing this.
You need to pass your internal table to this FM alongwith ur ALV fieldcatalog - and you will be able to export your internal table in the same way FBL1N does.
Cheers.
SKC.
2007 Sep 04 9:53 AM
Thanks.
In the end, I use the FM MS_WORD_OLE_FORMLETTER. I think that FM makes it easier to work with templates.
Another question: in the Word template there are checkboxes. Is there a way to check/uncheck these automatically? Depending on whether a value in the internal table is 'X' or not, for example.
Thanks!
2007 Sep 04 10:13 AM
There is no readymade FM to do that automatically.. for acessing the Form Controls ( like check Boxes,edit boxes, buttons or drop down boxes).
You will have to do that programatically...if u have a look at the FM MS_WORD_OLE_FORMLETTER.. it will give u some idea of doing this... It basically calls the methods of <b>Word.Document</b>. By this object you will be able to access the form objects too ( provided u understand the methods of the Word.Document - u need to some VBA basics.)
2007 Sep 04 11:39 AM
Thanks again. I think I'll leave the checkboxes for what they are then. Maybe I could just replace them by a simple 'X' in the document.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |