Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT truncates data

tabraiz_khan
Participant
0 Kudos
2,005

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.

1 ACCEPTED SOLUTION

tabraiz_khan
Participant
0 Kudos
594

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.

4 REPLIES 4

tabraiz_khan
Participant
0 Kudos
594

Anyone?

0 Kudos
594

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.

0 Kudos
594

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.

tabraiz_khan
Participant
0 Kudos
595

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.