cancel
Showing results for 
Search instead for 
Did you mean: 

How can we integrate weight scale to SAP system

former_member204513
Active Contributor
0 Kudos

Dear Friends,

I have one requirement

When the Company deliver the goods to their customer they will take those goods to Weigh bridge to scale the weight of those goods.

This weight they want to capture in the SAP system how can we capture to SAP system.

How can we integrate weight scale to SAP system.

Can you please reply back ASAP

Regards,

Murali.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Murali,

The solution is like, through the vb program you create a file and stores it in the local PC's desktop or in any folder in which the Weigh Bridge is connected and write a FTP program in SAP .Scheduled the program in BG so that it will fetch the file from the directory and send the data to SAP.

Preethi.

Answers (2)

Answers (2)

former_member204513
Active Contributor
0 Kudos

Answered

Former Member
0 Kudos

Hi Murali,

The solution is like, through the vb program you create a file and stores it in the local PC's desktop or in any folder in which the Weigh Bridge is connected and write a FTP program in SAP .Scheduled the program in BG so that it will fetch the file from the directory and send the data to SAP.

Use the following as sample code:

  • Executing VB EXE file to get the weight from weigh bridge

call function 'WS_EXECUTE'

exporting

  • DOCUMENT = ' '

  • CD = ' '

  • COMMANDLINE = ' '

inform = 'X'

cd = 'C:\SAPWEI'

program = 'C:\sapwei\MyVB.exe'

  • STAT = ' '

  • WINID = ' '

  • OSMAC_SCRIPT = ' '

  • OSMAC_CREATOR = ' '

  • WIN16_EXT = ' '

  • EXEC_RC = ' '

  • IMPORTING

  • RBUFF

  • EXCEPTIONS

  • FRONTEND_ERROR = 1

  • NO_BATCH = 2

  • PROG_NOT_FOUND = 3

  • ILLEGAL_OPTION = 4

  • GUI_REFUSE_EXECUTE = 5

  • OTHERS = 6

.

  • IF sy-subrc 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

  • ENDIF.

  • Fetching Value from VB text file

call function 'WS_UPLOAD'

exporting

  • CODEPAGE = ' '

filename = 'C:\sapwei\w1.txt'

  • FILETYPE = 'ASC'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTHtables

data_tab = itab3

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • FILE_OPEN_ERROR = 2

  • FILE_READ_ERROR = 3

  • INVALID_TYPE = 4

  • NO_BATCH = 5

  • UNKNOWN_ERROR = 6

  • INVALID_TABLE_WIDTH = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • CUSTOMER_ERROR = 9

  • NO_AUTHORITY = 10

  • OTHERS = 11

.

if sy-subrc 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

loop at itab3.

v1 = itab3-num.

pgrwt = v1.

endloop.

message 'Save Gross Weight' type 'S'.

endform. " grosswt

Hope it helps!

Preethi.