If you wish to copy the contents of the internal table to the Windows clipboard, you can do so by using the following function module.
SAP ABAP Function Module Copy to Clipboard
CLPB_EXPORT
If you use this function module, then the contents of the internal table can be copied to the Clipboard of the Presentation Server. Once the contents are copied to the clipboard they can be pasted into any windows application.
Find the code below.
REPORT ZEX_CLIPBOARDEXP .
types: ty_tab(200) type c. Data: wa_tab type ty_tab, int_tab type table of ty_tab.
Move: 'This is line 1 again' to wa_tab. append wa_tab to int_tab. clear wa_tab.
Move: 'This is line 2 again' 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.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
No comments:
Post a Comment