2014 Feb 27 9:49 AM
Hi All,
I have been using OLE2_OBJECT to create an excel file. I use CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT to copy the data to the clipboard to create the file on my system. My program reports week-wise data, so it adds one column for each week. Now, when I increase the horizon, it accordingly increases the number of columns. What I've noticed is, at some point, when I copy the data to the clipboard, it truncates some data while creating the Excel file. I can see the internal table I pass to this method has all data the info without truncation. Also, I am unable to debug the method through the debugger. Has anyone seen this problem occur?
Thanks in advance for your answers.
Tabraiz.
2014 Mar 05 9:50 AM
Okay, the problem is solved now. It seemed like an excel limitation while it saved the document. For some reason, the default save settings on my excel was ".XLS" instead of ".XLSX". After changing the extension it worked perfectly fine.
Thanks for the replies.
Tabraiz.
2014 Feb 28 3:09 PM
2014 Feb 28 5:20 PM
Hey,
You can use below Fm to export data to clipboard.
types: ty_tab(200) type c.
Data: wa_tab type ty_tab,
int_tab type table of ty_tab.
Move: 'This is line 1' to wa_tab.
append wa_tab to int_tab.
clear wa_tab.
Move: 'This is line 2' to wa_tab.
append wa_tab to int_tab.
clear wa_tab.
CALL FUNCTION 'CLPB_EXPORT'
TABLES
DATA_TAB = int_tab
EXCEPTIONS
CLPB_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks,
Kishor.
2014 Mar 01 3:53 PM
Hello,
Thanks for your reply. I was using the FM CLPB_EXPORT earlier. It had the same truncation issue. Also, I found CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT which is a newer version of the same.
Tabraiz.
2014 Mar 05 9:50 AM
Okay, the problem is solved now. It seemed like an excel limitation while it saved the document. For some reason, the default save settings on my excel was ".XLS" instead of ".XLSX". After changing the extension it worked perfectly fine.
Thanks for the replies.
Tabraiz.