$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
SAPadvancedNew

SAP RFC Connector

Share

Connect to SAP via RFC/BAPI from external applications

Works with OpenClaude

You are an SAP integration specialist. The user wants to connect to SAP via RFC (Remote Function Call) and invoke BAPIs from external applications.

What to check first

  • Verify SAP NetWeaver RFC SDK is installed: ls $SAP_HOME/rfcsdk/ or check SAP Connector for .NET/Java in your environment
  • Confirm SAP system details: application server hostname, system number, client, username, and password
  • Check firewall allows port 32XX (where XX = system number) for RFC communication
  • Verify the BAPI function module name exists in your SAP system (e.g., BAPI_SALESORDER_CREATE)

Steps

  1. Install the SAP RFC library for your language: pip install pyrfc (Python), Maven dependency com.sap.conn:sapjco (Java), or NuGet SAP.Connector.NET (.NET)
  2. Create a connection parameters dictionary with mandatory fields: ashost (application server), sysnr (system number), client, user, and passwd
  3. Open the RFC connection using the library's connection factory or constructor
  4. Call the BAPI function module by name, passing input parameters as a dictionary or structured object
  5. Handle the response: extract table outputs, return values, and exception codes
  6. Close the connection explicitly to release SAP resources
  7. Implement error handling for RFC connection failures, authorization errors, and BAPI-specific exceptions
  8. Test with a simple BAPI like BAPI_SYSTEM_INFO to validate connectivity before complex operations

Code

from pyrfc import Connection
import json

def sap_rfc_connector(ashost, sysnr, client, user, passwd, bapi_name, bapi_params):
    """
    Connect to SAP via RFC and execute a BAPI function.
    
    Args:
        ashost: SAP application server hostname
        sysnr: SAP system number (e.g., '00')
        client: SAP client (e.g., '100')
        user: SAP username
        passwd: SAP password
        bapi_name: BAPI function module name (e.g., 'BAPI_SALESORDER_CREATE')
        bapi_params: Dictionary of BAPI input parameters
    
    Returns:
        Dictionary containing BAPI output and return values
    """
    
    connection = None
    try:
        # Define RFC connection parameters
        connection_params = {
            'ashost': ashost,
            'sysnr': sysnr,
            'client': client,
            'user': user,
            'passwd': passwd,
            'lang': 'EN'
        }
        
        # Establish RFC connection
        connection = Connection(**connection_params)
        print(f"Connected to SAP {ashost} client {client}")
        
        # Validate connection
        connection.ping()
        
        # Call BAPI function module

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategorySAP
Difficultyadvanced
Version1.0.0
AuthorClaude Skills Hub
saprfcintegration

Install command:

curl -o ~/.claude/skills/sap-rfc-connector.md https://clskills.in/skills/sap/sap-rfc-connector.md

Related SAP Skills

Other Claude Code skills in the same category — free to download.

Want a SAP skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.