{"id":15148626,"url":"https://github.com/simonwaldherr/saprfc","last_synced_at":"2025-10-24T05:30:20.174Z","repository":{"id":57493827,"uuid":"59958314","full_name":"SimonWaldherr/saprfc","owner":"SimonWaldherr","description":"call SAP ABAP Code from Golang (Remote Function Call)","archived":false,"fork":false,"pushed_at":"2018-11-07T15:04:29.000Z","size":38,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T22:51:31.873Z","etag":null,"topics":["abap","go","golang","rfc-connectors","sap","sap-library","sap-nw-rfc","sap-service-marketplace"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonWaldherr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-29T18:39:36.000Z","updated_at":"2023-07-18T13:35:45.000Z","dependencies_parsed_at":"2022-09-02T01:40:13.851Z","dependency_job_id":null,"html_url":"https://github.com/SimonWaldherr/saprfc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Fsaprfc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Fsaprfc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Fsaprfc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Fsaprfc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonWaldherr","download_url":"https://codeload.github.com/SimonWaldherr/saprfc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237915423,"owners_count":19386724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abap","go","golang","rfc-connectors","sap","sap-library","sap-nw-rfc","sap-service-marketplace"],"created_at":"2024-09-26T13:21:16.351Z","updated_at":"2025-10-24T05:30:19.815Z","avatar_url":"https://github.com/SimonWaldherr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAP NW RFC Connector for GO\n\n**this is only a fork, but it seems that [origin](https://github.com/SAP/gorfc) is very *static***  \n\n**all credit for this code goes to [@bsrdjan](https://github.com/bsrdjan)**  \n\nThe **saprfc** package provides bindings for **SAP NW RFC Library**, for an easy way of interacting with SAP systems\n\nThe goal of this fork is the best possible compatibility with Linux, if you want work with Windows use the [original package](https://github.com/SAP/gorfc) \n\n## Table of contents\n\n* [ToC](#table-of-contents)\n* [Badges](#badges)\n* [Platforms and Prerequisites](#platforms-and-prerequisites)\n* [Install](#install)\n* [Getting Started](#getting-started)\n* [To Do](#to-do)\n* [References](#references)\n\n## Badges\n\n[![GoDoc](https://godoc.org/github.com/SimonWaldherr/saprfc?status.svg)](https://godoc.org/github.com/SimonWaldherr/saprfc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/SimonWaldherr/saprfc)](https://goreportcard.com/report/github.com/SimonWaldherr/saprfc)\n[![codebeat badge](https://codebeat.co/badges/7bdd3011-cae5-408b-aa71-8b2b779f6cd8)](https://codebeat.co/projects/github-com-simonwaldherr-saprfc)\n[![license](https://img.shields.io/badge/license-Apache-blue.svg)](https://raw.githubusercontent.com/SimonWaldherr/saprfc/master/LICENSE)\n\n*automatic CI Tests are not possible since the SAP library **SAP NW RFC** is not open source*\n\n## Platforms and Prerequisites\n\nThe SAP NW RFC Library is a prerequsite for using the GO RFC connector and must be installed on a same system. It is available on platforms supported by GO, except OSX.\n\nA prerequisite to download _SAP NW RFC Library_ is having a **customer or partner account** on _SAP Service Marketplace_ . If you are SAP employee please check SAP OSS note [1037575 - Software download authorizations for SAP employees](http://service.sap.com/sap/support/notes/1037575).\n\n_SAP NW RFC Library_ is fully backwards compatible, supporting all NetWeaver systems, from today, down to release R/3 4.0. You can always use the newest version released on Service Marketplace and connect to older systems as well.\n\n## Install\n\nTo start using SAP NW RFC Connector for GO, you shall:\n\n1. [Install and Configure Golang](https://golang.org/doc/install)\n2. Install SAP NW RFC Library for your platform\n3. Install SAPRFC package\n\n### Install SAP NW RFC Library\n\nTo obtain and install _SAP NW RFC Library_ from _SAP Service Marketplace_, you can follow [the same instructions as for Python or nodejs RFC connectors](http://sap.github.io/PyRFC/install.html#install-c-connector).\nThe Download is [here](https://launchpad.support.sap.com/#/softwarecenter/template/products/%20_APP=00200682500000001943\u0026_EVENT=DISPHIER\u0026HEADER=Y\u0026FUNCTIONBAR=N\u0026EVENT=TREE\u0026NE=NAVIGATE\u0026ENR=01200314690200010197\u0026V=MAINT\u0026TA=ACTUAL\u0026PAGE=SEARCH), but the SAP page is the worst, maybe it's better to search for a torrent or ask a friend at SAP.\n\n### Install SAPRFC\n\nTo install _saprfc_ and dependencies, run following commands:\n\n```bash\nexport CGO_CFLAGS=\"-I $SAPNWRFC_HOME/include\"\nexport CGO_LDFLAGS=\"-L $SAPNWRFC_HOME/lib\"\ngo get simonwaldherr.de/go/saprfc\ncd $GOPATH/src/simonwaldherr.de/go/saprfc\ngo build\ngo install\n```\n\n## Getting Started\n\nSee the _hello_gorfc.go_ example and _saprfc_test.go_ unit tests.\n\nThe GO RFC Connector follows the same principles and the implementation model of [Python](https://github.com/SAP/PyRFC) and [nodejs](https://github.com/SAP/node-rfc) RFC connectors and you may check examples and documentation there as well.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"simonwaldherr.de/go/golibs/arg\"\n    saprfc \"simonwaldherr.de/go/saprfc\"\n    \"time\"\n)\n\nvar SAPconnection *saprfc.Connection\n\nfunc printTable(table string) {\n    params := map[string]interface{}{\n        \"QUERY_TABLE\": table,\n        \"DELIMITER\":   \";\",\n        \"NO_DATA\":     \"\",\n        \"ROWSKIPS\":    0,\n        \"ROWCOUNT\":    0,\n    }\n    r, err := SAPconnection.Call(\"RFC_READ_TABLE\", params)\n    if err != nil {\n        fmt.Println(err)\n        return\n    }\n\n    echoStruct := r[\"DATA\"].([]interface{})\n    for _, value := range echoStruct {\n        values := value.(map[string]interface{})\n        for _, val := range values {\n            fmt.Println(val)\n        }\n    }\n    return\n}\n\nfunc main() {\n    arg.String(\"table\", \"USR01\", \"read from table\", time.Second*55)\n    arg.String(\"dest\", \"\", \"destination system\", time.Second*55)\n    arg.String(\"client\", \"\", \"client\", time.Second*55)\n    arg.String(\"user\", \"RFC\", \"username\", time.Second*55)\n    arg.String(\"pass\", \"\", \"password\", time.Second*55)\n    arg.String(\"lang\", \"DE\", \"language\", time.Second*55)\n    arg.String(\"host\", \"127.0.0.1\", \"SAP server\", time.Second*55)\n    arg.String(\"sysnr\", \"00\", \"SysNr\", time.Second*5)\n    arg.String(\"router\", \"/H/127.0.0.1/H/\", \"SAP router\", time.Second*55)\n    arg.Parse()\n\n    SAPconnection, _ = saprfc.ConnectionFromParams(saprfc.ConnectionParameter{\n        Dest:      arg.Get(\"dest\").(string),\n        Client:    arg.Get(\"client\").(string),\n        User:      arg.Get(\"user\").(string),\n        Passwd:    arg.Get(\"pass\").(string),\n        Lang:      arg.Get(\"lang\").(string),\n        Ashost:    arg.Get(\"host\").(string),\n        Sysnr:     arg.Get(\"sysnr\").(string),\n        Saprouter: arg.Get(\"router\").(string),\n    })\n\n    printTable(arg.Get(\"table\").(string))\n\n    SAPconnection.Close()\n}\n```\n\n## To Do\n\n* Improve the documentation\n* Fix Windows compiler flags\n\n## References\n\n* [GO Installation](https://golang.org/doc/install)\n* [GO Configuration](https://golang.org/doc/code.html)\n* [GO Environment Variables](https://golang.org/cmd/go/#hdr-Environment_variables)\n* [GO on Windows Example](http://www.wadewegner.com/2014/12/easy-go-programming-setup-for-windows/)\n* [Another GO on Windows Example](https://github.com/abourget/getting-started-with-golang/blob/master/Getting_Started_for_Windows.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwaldherr%2Fsaprfc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonwaldherr%2Fsaprfc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwaldherr%2Fsaprfc/lists"}