HVS32 SAP RFC Interface (Polling)

From Wiki - Heidler Strichcode GmbH
Jump to navigation Jump to search


Requirements

DGS-Version 3.6.0.550 or higher
DGS-Plugins HVS32Client, SAP RFC Server


Functional description

The DataGatewayServer (DGS) uses the SAP library "JCo" for communication with an SAP system and acts as a JCo server program during automatic polling.

The DGS is the central communication unit through which all data is exchanged between the shipping system and the SAP system. It runs in the context of a service on a Windows server.

Any RFC functions can be implemented in the DGS, which are called from an RFC client (SAP).

A separate RFC module must be used for each HVS32 function. The structure of the RFC module (fields, tables, structures) without implementation must be available in the SAP system on an application server for the DGS - since the metadata of the RFC modules are retrieved at system startup.

The DGS registers itself under a program ID at a SAP gateway (not for a specific SAP system) and waits for incoming RFC calls.

If an RFC call is transmitted from any SAP system to this SAP Gateway with the option "Connection with an already registered program" (with the same program ID), the connection with the DGS takes place.

After executing an RFC function, the DGS waits for further RFC calls from the same or another SAP system.

In the event of an interrupted or terminated RFC connection, the DGS automatically re-registers with the same SAP gateway under the same program ID.

Required SAP components/parameters

  • latest version 3 of SAP library Java Connector "JCo" in 64Bit.
  • SAP GUI installation on the server where the DataGatewayServer is installed - alternatively a manual adjustment of %SystemRoot%\system32\drivers\etc\services and %SystemRoot%\system32\drivers\etc\hosts.
  • a defined destination with connection type T (TCP/IP connection) in the SAP system via transaction SM59

(siehe Destination über SM59 definieren)
the following parameters are required by the DGS to register with a program ID at a SAP gateway:

Parameter Description
jco.server.gwhost SAP gateway at which the function modules are registered
jco.server.gwserv SAP gateway service (port) which is used (e.g. sapgw00)
jco.server.progid program ID from SM59 under which the registration takes place
jco.server.connection_count Number of simultaneous connections that can be used later by SAP to call the program
jco.client.ashost SAP application server on which the structure of the RFC block is located
jco.client.sysnr SAP system no.
jco.client.client Client ID (SAP)
jco.client.user SAP user with rights to execute RFC
jco.client.passwd Password
rfcfunctions List of function modules provided by the DataGatewayServer to SAP

If load balancing (SAP Message Server) is used on the SAP side for client-side RFC calls, the following must be configured instead of the ashost and sysnr parameters:

Parameter Description
jco.client.mshost IP or name of the SAP Message Server
jco.client.r3name System ID of the SAP system
jco.client.group Name of the SAP server group

Available HVS32 functions

Item data and dangerous goods information must be defined as Table or Struct in the RFC module, as they have a 1:n relationship to the package data.
All parameters which are to be sent to the HVS32 must be written into the import parameters. The feedback from the HVS32 is done in the export parameters. The communication is bidirectional, i.e. the feedback is done synchronously in the same transaction as the request.

Please note that the field descriptions refer only to a standard, which should serve as a suggestion for the interface. Function names, field names /-lengths /-formats may differ in principle, but in this case must be considered/analyzed individually.

Available HVS32 functions

Examples

Example of RFC module structure for shippingDataRequest
'Z_HVS_VERSANDDATENANFRAGE'

IMPORTING
  PACKSTUECK STRUCTURE
    KUNDEN_NR CHAR(20)
    ZIEL_ADR_NAME1 CHAR(50)
    ZIEL_ADR_NAME2 CHAR(50)
    ZIEL_ADR_NAME3 CHAR(50)
    ZIEL_ADR_STRASSE CHAR(50)
    ZIEL_ADR_LKZ CHAR(5)
    ZIEL_ADR_PLZ CHAR(10)
    ZIEL_ADR_ORT CHAR(50)
    ZIEL_ADR_REGION CHAR(20)
    ZIEL_ADR_BAHNHOF CHAR(30)
    ANSPRECHPARTNER CHAR(20)
    TELEFON_NR CHAR(20)
    FAX_NR CHAR(20)
    UST_ID_NR CHAR(20)
    ILN_NR CHAR(20)
    AUFTRAGGEBER_ID CHAR(10)
    VERSANDART_ID CHAR(10)
    AVIS_HINWEIS1 CHAR(30)
    AVIS_HINWEIS2 CHAR(30)
    AVIS_ZUSATZ1 CHAR(20)
    AVIS_ZUSATZ2 CHAR(20)
    LIEFERSCHEIN_NR CHAR(40)
    AUFTRAG_NR CHAR(20)
    BESTELL_NR CHAR(20)
    WARENWERT CHAR(19)
    WW_WAEHRUNG CHAR(3)
    NACHNAHME CHAR(19)
    NN_WAEHRUNG CHAR(3)
    NN_VERMERK CHAR(1)
    NN_VERWENDUNG CHAR(30)
    VERSICHERUNGSWERT CHAR(19)
    VW_WAEHRUNG CHAR(3)
    FRANKATUR_KENNUNG CHAR(10)
    ZAHLUNGSBEDIGNUNG CHAR(10)
    ZB_ZOLL CHAR(1)
    FRACHTFUEHRER_KD_NR CHAR(10)
    SONDERDIENSTE CHAR(30)
    SENDUNGS_INHALT CHAR(30)
    TERMIN_ART CHAR(1)
    TERMIN_DATUM CHAR(10)
    TERMIN_ZEIT CHAR(5)
    NEUTABSENDER_NAME1 CHAR(30)
    NEUTABSENDER_NAME2 CHAR(30)
    NEUTABSENDER_NAME3 CHAR(30)
    NEUTABSENDER_STRASSE CHAR(30)
    NEUTABSENDER_LKZ CHAR(3)
    NEUTABSENDER_PLZ CHAR(10)
    NEUTABSENDER_ORT CHAR(30)
    RECHNUNGS_EMPF_NAME1 CHAR(50)
    RECHNUNGS_EMPF_NAME2 CHAR(50)
    RECHNUNGS_EMPF_NAME3 CHAR(50)
    RECHNUNGS_EMPF_STRASSE CHAR(50)
    RECHNUNGS_EMPF_LKZ CHAR(5)
    RECHNUNGS_EMPF_PLZ CHAR(10)
    RECHNUNGS_EMPF_ORT CHAR(50)
    POST_LEITCODE CHAR(15)
    POST_ZIEL_FRACHTZENT CHAR(5)
    FRACHT_BRIEF CHAR(20)
    GEWICHT CHAR(9)
    NETTO_GEWICHT CHAR(9)
    PACK_STK_GES CHAR(10)
    PACK_STK_NR CHAR(10)
    VERPACKUNGSART CHAR(6)
    PACKSTUECK_LAENGE CHAR(10)
    PACKSTUECK_BREITE CHAR(10)
    PACKSTUECK_HOEHE CHAR(10)
    PACKPLATZ CHAR(10)
    PACKSTUECK_ID CHAR(15)
    ANZAHL_ARTIKEL CHAR(10)
    ZUSATZ_ZEILE1 CHAR(150)
    ZUSATZ_ZEILE2 CHAR(150)
    FREI_AVIS1 CHAR(62)
    FREI_AVIS2 CHAR(62)
    HV_ELEKTRONIK_ARTIKEL CHAR(1)
    EMPF_EMAILADRESSE CHAR(100)
    KOSTENSTELLE CHAR(30)
    DRUCKERNAME CHAR(30)
  DGPOSITIONS STRUCTURE
    UNNR CHAR(4)
    KLASSE CHAR(6)
    VPG CHAR(5)
    K_CODE CHAR(5)
    BEZEICHNUNG CHAR(110)
    MENGE CHAR(9)
    BEGRENZTE_MENGE CHAR(1)
    VERP_ANZAHL CHAR(10)
    VERPACKUNGSART CHAR(8)
    NEBEN_GEFAHR CHAR(20)
    BUCHST640 CHAR(1)
    MENGEN_EINHEIT CHAR(2)
    BEFOERD_KAT CHAR(10)
    FAKTOR CHAR(10)
    NETTO_EXPL_MASSE CHAR(9)
    TUNNEL_B_CODE CHAR(10)
    FREIGEST_MENGE CHAR(1)
    FF_CODE CHAR(20)
  DELIVERYPOSITIONS STRUCTURE
    ANZAHLPOSETIKETTEN CHAR()
    ARTIKELBTNNR CHAR(25)
    ARTIKELEAN CHAR(20)
    ARTIKELEINHEIT CHAR(10)
    ARTIKELGEWICHT CHAR(9)
    ARTIKELMENGE CHAR(9)
    ARTIKELSOLLMENGE CHAR(9)
    ARTIKELTEXT1 CHAR(100)
    ARTIKELTEXT2 CHAR(100)
    ARTIKELTEXT3 CHAR(100)
    ARTIKELTEXT4 CHAR(100)
    ARTIKELWAEHRUNG CHAR(3)
    ARTIKELWERT CHAR(9)
    CHARGEFLAG CHAR(1)
    KUNDENARTIKELNR CHAR(50)
    KUNDENBESTELLNR CHAR(50)
    POSAUFTRAGNR CHAR(50)
    POSITIONNR CHAR(40)
    POSLIEFERNR CHAR(40)
    SERIENNR CHAR(30)
    URSPRUNGLAND CHAR(2)
    ARTIKELGRUPPE CHAR(50)
    ARTIKELSERVICES CHAR(100)
    ARTIKELVOLUMEN CHAR(9)


EXPORTING
  PACKSTUECKRUECK STRUCTURE
    TRACKING_NR CHAR(35)
    VERSAND_SENDUNGS_NR CHAR(20)
    DRUCK_DATE_TIME CHAR(10)
    AUSGANG_DATE_TIME CHAR(10)
    GEBUEHR CHAR(19)
    GEBUEHR_WAEHRUNG CHAR(3)
    FEHLERTEXT1 CHAR(200)
    FEHLERTEXT2 CHAR(200)


}

FAQ / Troubleshooting

Define destination via SM59

To set up an RFC connection in SAP, which is intended for the connection of the HVS32 shipping system, please proceed as follows:

  1. Go to transaction sm59
  2. Select the type T (TCP/IP connections) [Abb.1]
  3. Create a new connection with the "create" button
  4. Specify an RFC destination (e.g. "RFC_HVS32")
  5. Set the activation type to "Registered server program
  6. Set a program ID (e.g. "HVS32") [Abb.2]
  7. Open the "MDMP & Unicode" tab
  8. Set the communication type to "Unicode" [Abb.3]'
  9. Save the settings
  10. You can test the connection via "Connection Test" once the DataGatewayServer is installed on the target system and started as a service [Abb.4]