Skip to content

Python Template with FastAPI for B-Tocs ABAP Connector

License

Notifications You must be signed in to change notification settings

b-tocs/pyapi4abap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

B-Tocs Python API Template for SAP ABAP

B-Tocs Logo

This repository is a simple template for building Python based APIs for SAP ABAP and multi target scenarios. The python API based on FastAPI. For the ABAP part the B-Tocs ABAP SDK is used.

Big Picture

This project handles the following aspects:

  1. Create a python based API
  2. Call this API from SAP ABAP systems
  3. Create a cloud native container for multi target deployment
flowchart LR
    subgraph cloud-native-container["Multi Target Container"]
        pyapi4abap["Python API for ABAP Service"]

    end

    subgraph sap["SAP ABAP System"]

        subgraph demo_code["B-Tocs pyapi4abap demo code"]
            sap_hello["SAP Demo for /hello - HTTP GET"]
            sap_check["SAP Demo for /check - HTTP GET with params"]
            sap_process[SAP Demo for /process - HTTP POST]
        end

       
        subgraph sdk["B-Tocs ABAP SDK"]
            sdkcore-->pyapi4abap
        end
       
        sap_hello-->sdkcore
        sap_check-->sdkcore
        sap_process-->sdkcore
    end

 

    subgraph cloud-native-world["Deployment Target"]
        subgraph onpremise["Data Center On-Prem"]
            container_at_home
        end
        subgraph datacenter["Data Center"]
            container_at_3rd_party
        end
        subgraph hyperscaler["HyperScaler"]
            container_at_hyperscaler
        end
        subgraph sapbtp["SAP BTP"]
            container_at_sapbtp
        end
        subgraph saas["SaaS"]
            container_at_saas
        end
    end

    pyapi4abap --> container_at_home    
    pyapi4abap --> container_at_3rd_party
    pyapi4abap --> container_at_hyperscaler    
    pyapi4abap --> container_at_sapbtp
    pyapi4abap --> container_at_saas

Loading

Step-By-Step Guide

  1. Create a python based API
    1. Install requirements - python, git, vsc
    2. Create a new python project
    3. Check the code and API
  2. Call this API from SAP ABAP systems
    1. Expose API to the internet
    2. Connect SAP to the API
    3. Call the API endpoints from ABAP programs
    4. Enable API Debugging
  3. Create a cloud native container for multi target deployment
    1. Build and start local docker container
    2. Deploy the container image to a container registry
    3. Use a container image for a target platform

For ABAPers without Python interests

You can skip part 1 of the Step-By-Step Guide and start the python stack as local container as described in 3.3. Continue with 2.1 "Expose API ...".

FAQ

Where I can get more examples for using the B-Tocs ABAP SDK?

Check the project site of the B-Tocs ABAP SDK. There are some other projects listed using this SDK. The projects LibreTranslate and Ollama are recommended for this.

How I can add more description and configuration to the swagger UI?

Check the FastAPI documentation.


last updated: 16.05.2024 mdjoerg

About

Python Template with FastAPI for B-Tocs ABAP Connector

Resources

License

Stars

Watchers

Forks

Packages

No packages published