Weighbridge Integration Scale - SAP
Weighbridge Integration Scale - SAP
Reference links :
https://blogs.sap.com/2013/07/10/read-comm-port-using-abap-wo-third-party-software/
on their PC configuration :
https://blogs.sap.com/2014/10/02/how-to-registeractivate-activex-component-
mscomm32ocx-on-windows-7/
may help :
SAP Plant Connectivity 2.2 Wire to the Outside World for SAP Business Suite-Applications
– Quick Start
System Requirements:
1. Desktop PC
2. Operating System : Windows XP (or above)
3. COM ports (RS-232) : 2
4. CPU : 1.7 GHz (or above)
5. RAM : 2 GB (or above)
Instructions:
1. Port Settings for COM
Please make sure that the COM drivers are installed properly. The properties of the COM port have to be
defined as below.
1.1. Right click My Computer -> Properties -> Hardware -> Device Manager.
1.2. Select the COM port and right click on to select Properties.
1.3. Select the Port Settings tab on top and set the following parameters :
Bits per second: 9600
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None
2. OCX File
Copy the file MSCOMM32.OCX into folder C:\WINDOWS\system32.
4.1. Go to Start -> Run and type regedit and click OK.
4.3. Go to HKEY_CLASSES_ROOT\Licenses
4.4. Create new key (Folder) name with '4250E830-6AC2-11cf-8ADB-00AA00C00905'
5. COMM Ports
Connect the COMM Port 1 to the weighbridge terminal for incoming trucks.
Connect the COMM Port 2 to the weighbridge terminal for outgoing trucks.
6. Reboot
Restart the system to let the changes update in above steps 1 to 4.
Notes:
FUNCTION ZSD_WB_DATA_READ.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" REFERENCE(IN_WGT) TYPE MENG15
*" REFERENCE(OUT_WGT) TYPE MENG15
*"----------------------------------------------------------------------
data: in_str(100),
out_str(100).
data: in_len type i,
out_len type i.
data: in_len_fin type i,
out_len_fin type i.
data: in_str_fin(100),
out_str_fin(100).
data: in_weight type MENG15,
out_weight type MENG15.
try.
out_wgt = out_str_fin.
catch cx_sy_conversion_no_number.
endtry.
try.
in_wgt = in_str_fin.
catch cx_sy_conversion_no_number.
endtry.
ENDFUNCTION.
FUNCTION Z_SERIAL_PORT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(MODE) TYPE I DEFAULT 0
*" REFERENCE(COMMPORT) TYPE I DEFAULT 1
*" REFERENCE(SETTINGS) TYPE C DEFAULT '9600,N,8,1'
*" REFERENCE(OUTPUT) TYPE C OPTIONAL
*" EXPORTING
*" REFERENCE(INPUT) TYPE C
*"----------------------------------------------------------------------
TYPE-POOLS: sabc.
INCLUDE ole2incl.
clear: INPUT.
PERFORM init.
PERFORM open_port USING commport settings.
IF mode = 0.
PERFORM read_port
CHANGING input.
ENDIF.
IF mode = 1.
PERFORM write_port
USING output
CHANGING input.
ENDIF.
PERFORM final.
ENDFUNCTION.