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:

Switch digital outputs with ABAP


The ABAP routine described here shows how using the Wayback procedure you can switch the digital outputs on the ERP Gateway. The code can be copied directly into your own ABAP projects, whereby the execution takes place there as a response to the occurrence of particular events.

For example, using the ERP Gateway you can signal under- or overlimit violations of quantities or utilization on a light column directly from SAP.

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 in the first four lines need to be replaced by your own parameters:

  • user = command with the desired status of the outputs
    e.g. "output0=on" switches the first output of the ERP Gateway on,
    "output1=off" switches the second output of the ERP Gateway off.

  • 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

					user(30) type c value output1=on’,
					pwd(30) type c,
					host(64) type c value’,
					dest like rfcdes-rfcdest value ’SAPFTP’.
					pwd =  test’
					hdl type i,
					key type i value 26101957,
					slen type i.
					begin of result occurs 0,
					line(100) type c,
					end of result.
				set extended check off.
					slen = strlen( pwd ).
				call function ’HTTP_SCRAMBLE’
						source      = pwd
						sourcelen   = slen
						key         = key
						destination = pwd.
				call function ’FTP_CONNECT’
						user        = user
						password    = pwd
						host        = host
						rfc_destination = dest
						handle      = hdl.
				call function ’FTP_DISCONNECT’
						handle		= hdl.
				call function ’RFC_CONNECTION_CLOSE’
						destination = dest
						others		= 1.