Skip to Content
author's profile photo Former Member
Former Member

Capture weight using clipboard

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Feb 18, 2014 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2014 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on Feb 18, 2014 at 06:14 AM

    Hi,

    I was not aware of the existence of CLPB_IMPORT that Vivek Goyal Former Member

    mention (Thanks for the lesson),

    so I thought that reading from a text file will be simpler.

    But I can see that CLPB_IMPORT is "obsolete" and the documentation say to use

    CL_GUI_FRONTEND_SERVICES .

    Regards .


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 18, 2014 at 05:53 AM

    Hi,

    If the .net is "home made" can you make it create a file ?

    Regards .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.