cancel
Showing results for 
Search instead for 
Did you mean: 

SRM7 - how to get clipboard content at runtime

matteo_montalto
Contributor
0 Kudos

Hello gurus,

not sure this is the proper section as my question is kinda technical and ABAP-related, anyway.... SRM 7.0 has a Copy/Paste option on items of a document (purchase order or contract): once the user selects an item, the "Copy" button uploads the item on the clipboard, while the "Paste" one gets clipboard's content and generate a new item with that data.

I have to check at runtime which data are in the clipboard in a WDDOMODIFYVIEW post-exit enhancement.

For a specific customer desiderata, I have to check the "copied" position w.r.t. the item that is selected at runtime in order to enable/disable the "Paste" button.

So the question is: how can I get the "copied" item? I need to check some fields in it in order to eventually disable the "Paste" button dinamically.

I assume this question could be equivalent to the following: how can I access the clipboard area and get the "copied" item(s) ?

I'm working on the item main area (/SAPSRM/WDC_CTR_DOTC_IT web dynpro) and tried as follows:

DATA: lv_FILLED Type abap_bool.
  DATA: facade_clip TYPE REF TO /SAPSRM/IF_CH_WD_SETF_CLIPBRD.
* check clipboard
  CALL METHOD wd_this->MO_DODM_CTR_ITEMS->/sapsrm/if_cll_do_mapper~is_clipboard_filled
    RECEIVING
      rv_data_contains = lv_filled.

  IF lv_filled EQ abap_true.
    CALL METHOD wd_this->mo_dodm_ctr_items->get_clipboard
*      EXPORTING
*        iv_cross_tx  =
      receiving
        ro_clipboard = facade_clip.

Unfortunately, the second method (get_clipboard) seems to be private/protected. Is there any other way to get info on the copied positions?

Thanks in advance

EDIT: moreover, I noticed also that IS_CLIPBOARD_FILLED is not relevant for my task, as it returns always abap_true even though no item was copied. I guess that clipboard can be filled with every kind of data... I have anyway a workaround which is based on a post-exit on the COPY_ITEM method, in which I mark a custom field in the context ("copy_pressed"), so I know in WDDOMODIFYVIEW whether the "Copy" button has been pressed.

Edited by: Matteo Montalto on Mar 2, 2012 3:53 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

matteo_montalto
Contributor
0 Kudos

Hi all,

back on the argument as I probably found a way to achieve the desiderata... only a little tile missing, hope someone could provide me an help.

Basically, in WDDOMODIFYVIEW, I coded as follows:

DATA: clipbrd TYPE REF TO /SAPSRM/IF_CH_WD_SETF_CLIPBRD.

clipbrd = wd_this->mo_dodm_ctr_items->/sapsrm/if_cll_do_mapper~get_clipboard( iv_cross_tx = 'X' ).

This gives correctly the clipboard object, that is however not usable as object of type /SAPSRM/IF_CH_WD_SETF_CLIPBRD.

I should then use a method to retrieve the content of the clipboard in an usable format; I found out that the method

CALL METHOD (of /SAPSRM/IF_CH_WD_SETF_CLIPBRD) get_clipboard_content
    EXPORTING
      io_set_facade        = 
    receiving
      rt_clipboard_content = test (type ref DATA).

is exactly what I'm looking for.

The problem is: what's that io_set_facade intended for? As it's a mandatory parameter I have to pass it in order to retrieve clipboard's content, but don't have idea on how to get it in WDDOMODIFYVIEW as it seems an private attribute of the interface IF_CLL_DO_MAPPER.

Any help is welcome.

Thanks.

.