02-18-2014 5:34 AM
Hi all,
I am making a module pool program.
In which I have to capture the gross weight, truck weight and net weight. All these weights will come from a .net application.
What I need to do is, I have to get these values from clipboard.
Does anyone know how to do it?
02-18-2014 6:27 AM
You can use CL_GUI_FRONTEND_SERVICES for your purpose.
Call CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT for pasting data from clipboard
whereas CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT for copying data to clipboard.
Thanks, Abhinab
02-18-2014 5:53 AM
Hi,
If the .net is "home made" can you make it create a file ?
Regards .
02-18-2014 5:58 AM
Yash,
Pl. use "CLPB_IMPORT" function module to fetch the data from the clipboard.
I am also using same FM for fetching the data from the clipboard in our company for Weigh Bridge Application.
Regards
Vivek
02-18-2014 6:06 AM
02-18-2014 6:16 AM
Pl. have a look at the screen:
Here Capture Load button and capture tare weight are Push buttons. When a user clicks on these push buttons, the control will go to the FM.
Code:
TYPES:BEGIN OF ty_file,
line(100) TYPE c,
END OF ty_file.
data: t_file TYPE STANDARD TABLE OF ty_file,
w_file TYPE ty_file,
g_empty(1).
FORM get_file USING value(fp_var) TYPE any
CHANGING value(fp_weh) TYPE any . "#EC NEEDED
*Importing Weighbridge weight from Clipboard
CALL FUNCTION 'CLPB_IMPORT' "#EC *
IMPORTING
empty = g_empty
TABLES
data_tab = t_file
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.
IF NOT t_file IS INITIAL.
LOOP AT t_file INTO w_file.
fp_weh = w_file+3(13).
fp_weh = fp_weh / 1000.
ENDLOOP.
ENDIF.
REFRESH:t_file.
CLEAR:sy-ucomm.
ENDFORM. " GET_FILE
This will help you.
Vivek
02-18-2014 6:14 AM
02-18-2014 6:27 AM
You can use CL_GUI_FRONTEND_SERVICES for your purpose.
Call CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT for pasting data from clipboard
whereas CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT for copying data to clipboard.
Thanks, Abhinab