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.
Showing results for 
Search instead for 
Did you mean: 

ALV: Context Menu: Standard Functions: Copy to clipboard: How to throw?

Former Member
0 Kudos

How can I throw the standard function "copy to clipboard"



If I try to throw it with the method

<ref to cl_gui_alv_grid>->set_user_command(
EXPORTING i_ucomm = cl_gui_alv_grid=>mc_fc_loc_copy )

, it doesn't work.

This standard function is a feature of every context menu of an ALV grid control.

It is possible to inactivate it via the method

<ref to cl_gui_alv_grid>->disable_functions

, so it must be the right function code.

I visited that the "application server is working"-logo

(the blue waving-water-picture in the upper right corner of

every SAP GUI window) doesn't move if I use this function via

context menu.

So possibly there is no server-turn-around between the

presentation server an the application server when using this

function. The application server only catches an event

cl_gui_alv_grid_base=>evt_copy_clipboard_failed <34>

on copy malfunction.


Former Member
0 Kudos


there is a simple method to put something to the clipboad. I have done it a couple of times and it works fine.

Data Definitions:

DATA: BEGIN OF clippboard OCCURS 0,

line(172) TYPE c,

END OF clippboard.

cnt1 type i.

ABAP Example:

refresh clippboard.

append xx_outtab_pos-prodh to clippboard.

CALL METHOD cl_gui_frontend_services=>clipboard_export


data = clippboard[]


rc = cnt1.

In this example the content of the field xx_outtab_pos-prodh has been put to the clipborad and can be inserted anywhere by pressing Ctrl/V.

If you want to restore it from the clipboard, there is a m

ethod called cl_gui_frontend_services=>clipboard_import. It works the same as the clipboard_export.

Best regards