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: 

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"

CL_GUI_ALV_GRID=>MC_FC_LOC_COPY <&LOCAL&COPY>

?

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.

1 REPLY 1

Former Member
0 Kudos

Hi,

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

IMPORTING

data = clippboard[]

CHANGING

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

Peter