elielelie/laravel-sap 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elielelie/laravel-sap

最新稳定版本:v1.0.7

Composer 安装命令:

composer require elielelie/laravel-sap

包简介

SAP features integrated with Laravel.

README 文档

README

SAP features integrated with Laravel.

Maintainer PHP VERSION BUILD LICENSE

Installation

Make sure you have the php7-sapnwrfc extension installed.

composer require elielelie/laravel-sap

To establish the connection with SAP, you need to add the following variables to your .env file:

SAP_HOST        Host
SAP_SYSTEM      System number
SAP_LANGUAGE    Language default
SAP_CLIENT      Client instance
SAP_USERNAME    Username
SAP_PASSWORD    Password    

You can publish the configuration file and add new connections by running:

$ php artisan vendor:publish --provider="Elielelie\Sap\SapServiceProvider"

Usage

Connecting to SAP

<?php

use Elielelie\Sap\Sap;

$sap = app(Sap::class);

$connection = $sap->open();

or

// Connection name defined in the configuration file config/sap.php
 
$connection = $sap->open('name');

Perform Function Module call

<?php

// ... connection

$function = $connection->fm('BAPI_USER_GET_DETAIL');

// Get function description.
print_r($function->description());

// Add import parameter.
$function->param('USERNAME', 'USER');

// Perform function call and retrieve result.
$results = $function->execute();

$connection->close();

Getting details about a user using RFC_READ_TABLE

<?php

// ... connection

$function = $connection->fm('RFC_READ_TABLE');

$function->param('QUERY_TABLE', 'USR01')
	->param('OPTIONS', [
		['TEXT' => 'BNAME = 'USER' OR BNAME = 'USER2' OR BNAME LIKE 'USER5*']
	])
	->param('ROWCOUNT', 5)
	->param('DELIMITER', '~')
;

$result = $function->execute();

$connection->close();

Query Builder usage

<?php

// ... connection

$fm = $connection->fmc(Table::class);

$results = $fm->table('USR01')
    ->fields(['BNAME', 'STCOD', 'MANDT' ...])
	->where('bname', ['USER', 'USER5'])
	->orWhere('bname', 'LIKE', 'USER5*')
	->limit(5)
	->get()
;

Testing

This package includes a comprehensive test suite using Pest PHP.

Running Tests

# Run all tests
php vendor/bin/pest

# Run with detailed output
php vendor/bin/pest --testdox

# Run with coverage
php vendor/bin/pest --coverage

Test Coverage

  • Unit Tests: Guid, Arr, QueryBuilder, Server (100% coverage)
  • ⏭️ Feature Tests: Connection, Sap, FunctionModule, Table (require SAP connection or mocking)

For more information about testing, see TESTING.md.

License

This software is licensed under the MIT license. See LICENSE for details.

Legal Notice

SAP and other SAP products and services mentioned herein are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries.

统计信息

  • 总下载量: 911
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固