Monday, June 23, 2008

SAP Function Module Import Clipboard

SAP Function Module Import Clipboard

If you wish to import the contents of the clipboard into SAP, then you can use the function module given below.

SAP ABAP function module to import the windows clipboard contents

CLPB_IMPORT

The above mentioned Function Module grabs the contents of the windows clipboard into an internal table. Once the contents are in the internal table they can be processed as desired.

Find the code below.

REPORT ZEX_CLIPBOARDIMP .

types: ty_tab(200) type c.
Data: wa_tab type ty_tab,
      int_tab type table of ty_tab.



CALL FUNCTION 'CLPB_IMPORT'
     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.



No comments:

Post a Comment