W&T connects
Interfaces for TCP/IP, Ethernet, RS-232, RS-485, USB, 20mA, glass and plastic fiber optic cable, http, SNMP, OPC, Modbus TCP, I/O digital, I/O analog, ISA, PCI

Application for ERP Gateways:

Switching via mouse-click with ABAP


The ABAP example described here enables you to control the digital outputs of the ERP Gateway by means of a simple mouse-click by the user on his usual user interface.

With minimum effort this makes it possible to switch lights, shutters, door openers, signal columns etc. in SAP environments.

1. Preparations

You have already supplied your ERP Gateway(s)

  • with power,
  • connected it to your network,
  • assigned it an IP address - which with WuTility is no problem.

As for the rest, the ERP Gateway is already fully pre-configured.

2. The ABAP source code

The following example codes can be copied and pasted directly. Only the red marked assignments for the IP address and password need to be replaced by your own values:

  • pwd = Wayback password
    corresponding to the password stored in the ERP Gateway

  • host = IP address or host name of the ERP Gateway

Source text as text file: Download


	data:
	user(30) type c,
	pwd(30) type c,
	host(64) type c,
	dest like rfcdes-rfcdest value 'SAPFTP'.
	write: /'Testprogramm für das WuT ERP-Gateway Wayback #57635',
				/'Hier können Sie durch einen Doppelklick auf die entsprechende',
				/'Zeile direkt die Ausgänge des Gerätes schalten.'.
				uline.
	write: /'Kanal 0 an',
				/'Kanal 0 aus',
				/, /'Kanal 1 an',
				/'Kanal 1 aus'.
	at line-selection.
	CASE SY-LISEL.
	WHEN 'Kanal 0 an'.
			user = 'output0=on'.
	WHEN 'Kanal 0 aus'.
			user = 'output0=off'.
	WHEN 'Kanal 1 an'.
			user = 'output1=on'.
	WHEN 'Kanal 1 aus'.
			user = 'output1=off'.
	WHEN OTHERS.
			user = ''.
	ENDCASE.
	*********** Hier die IP-Adresse und das Passwort eintragen.************
	host = '148.53.130.1'.
	pwd = 'test'.
	***********************************************************************
	data: hdl type i,
			key type i value 26101957,
			slen type i.
	data: begin of result occurs 0,
			line(100) type c,
			end of result.
	set extended check off.
	slen = strlen( pwd ).
	call function 'HTTP_SCRAMBLE'
		exporting
		source = pwd
		sourcelen = slen
		key = key
		importing
		destination = pwd.
	call function 'FTP_CONNECT'
		exporting
		user = user
		password = pwd
		host = host
		rfc_destination = dest
		importing
		handle = hdl.
	call function 'FTP_DISCONNECT'
		exporting
		handle = hdl.
	call function 'RFC_CONNECTION_CLOSE'
		exporting
		destination = pwd
		exceptions
		others = 1.
	

Do you not have an ERP Gateway but still would like to simply try out the example shown here?

No problem: We will be glad to supply you with an ERP Gateway for 30 days at no charge. Simply fill out the sample order form, and we will ship the ERP Gateway on open invoice. If you return the unit within 30 days, we will credit the invoice in full.

To sample orders