1

im working on a new project where by i wish to be able to build a django project around an existing SAPB1 application that is in production. My goal of doing so is to be able to extract certain information from SAP database and sync them with my django database as well as write certain things into the SAP database from my django program. An example is , i would wish to generate a payment voucher from my program , and write it into the SAP data base.

Is there a suitable API for such a task? I have done certain research and it seems like my client's SAPB1 does not have python RFC feature. A possible alternative would be the DI API , however most materials are written in c# which is not my expertise , therefore would love to hear your advise!

thanks!

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
neowenshun
  • 860
  • 1
  • 7
  • 21

4 Answers4

2

I will vote to the Service Layer which is a RESTFul API that allows you to build your strong extension platform. It builds on core protocols such as HTTP and OData, and provides a uniform way to expose full-featured business objects on top of a highly scalable and high-availability Web server.

0

Use SAP B1 Restful framework for interacting with B1 if you don't satisfied with DI server default features.

It is Python-built app on top of DI default interfaces and send and get data from DI in REST service.

Example script by curl:

curl -H 'authorization: JWT XXXXXXXXXXXXXXXXXXXXXXXXXXXX' -X GET -H 'Content-Type: application/json' http://192.168.44.151:5000/v1/code?type=ExpnsName
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Hi @suncatcher thank you so much for your response , but it seems that this application is built for flask applications , do you know if there's one for django? – neowenshun Mar 25 '20 at 17:43
  • Not that I am aware of. But I think you adapt it for Django – Suncatcher Mar 25 '20 at 19:05
0

If you have SAP Business One for SQL Server you could create a webservice using the SDK SAP Business One and consume it from Django with the request library, in the case that it is SAP Business One for Hana you can use Service Layer which is a REST API and you can also use it with request library

0

you can load the DI API dll with pywin32 to python. You can get the company object and query, add, and modify whatever you need.

Issue with Django (and Flask) might be, that it is loading multiple threads, and therefore be not very efficient (compared to DI Server). Be sure to share one connection.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Karl
  • 45
  • 4