2007 Mar 10 5:54 PM
Hello everyone
I have a such task: In abap program I have fields(screen fields), which I want to import into excell file. I don't want to export into empty file but into ready template .xls. Is there any possibility to match corresponding fields?
I really need to know, I will be gratefully for any suggestions.
Greetings
Hello everyone
I have a such task: In abap program I have fields(screen fields), which I want to import into excell file. I don't want to export into empty file but into ready template .xls. Is there any possibility to match corresponding fields?
I really need to know, I will be gratefully for any suggestions.
Greetings
2007 Mar 10 7:37 PM
Hi Katarzyna ,
something like
DATA: EXCEL TYPE OLE2_OBJECT.
DATA: BOOKS TYPE OLE2_OBJECT.
DATA: BOOK TYPE OLE2_OBJECT.
DATA: CELL TYPE OLE2_OBJECT.
DATA: FONT TYPE OLE2_OBJECT.
DATA: FILE TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
CALL METHOD OF FILE 'OPEN' EXPORTING #1 = P_FILE
#2 = 1.
CALL METHOD OF EXCEL 'CELLS' = CELL EXPORTING #1 = P_LINE
#2 = P_COLUMN.
SET PROPERTY OF CELL 'VALUE' = P_VALUE.
CALL METHOD OF EXCEL 'QUIT'.
This is just a compilation from a complex program. Do some modularization (i.e. create FORM fill_cell using P_line P_column P_value...)
Hope I did not forget anything. Meanwhile we have much more modern and advanced methods and classes - this one is of 2000 (Release 4.5?).
Regards,
Clemens
2007 Mar 11 4:56 PM
Hello Clemens
Thank you very much, I will try your solution.
Greetings
2007 Mar 12 7:41 AM
Hello Clemens
I have one more question. In that form fill_cell the arguments p_line and p_column are:
For example:
An excel cell A6 - p_line 6 , p_column A. Which is: the cell' s address where I want export p_value is p_column,p_line?
Could you explain it for me please. I'm totally beginner.
2007 Mar 12 8:00 AM
And another question: what if I don't have a cell with address, but I have text field which contains 3 cells? Then, how looks the method 'CELLS'? Please, could you show me.
2007 Mar 12 11:34 AM
OK it's all right. Now I know answers for my all questions and everything works great.
Thank you.
Greetings
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |