sap4j

Interactions with SAP made dead easy.

Лицензия

Лицензия

Группа

Группа

com.sap4j
Идентификатор

Идентификатор

sap4j
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

sap4j
Interactions with SAP made dead easy.

Скачать sap4j

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.sap4j/sap4j/ -->
<dependency>
    <groupId>com.sap4j</groupId>
    <artifactId>sap4j</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.sap4j/sap4j/
implementation 'com.sap4j:sap4j:1.0.2'
// https://jarcasting.com/artifacts/com.sap4j/sap4j/
implementation ("com.sap4j:sap4j:1.0.2")
'com.sap4j:sap4j:jar:1.0.2'
<dependency org="com.sap4j" name="sap4j" rev="1.0.2">
  <artifact name="sap4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.sap4j', module='sap4j', version='1.0.2')
)
libraryDependencies += "com.sap4j" % "sap4j" % "1.0.2"
[com.sap4j/sap4j "1.0.2"]

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
org.apache.commons : commons-lang3 jar 3.9
log4j : log4j jar 1.2.17
net.jodah : failsafe jar 2.4.0
commons-io : commons-io jar 2.6
com.google.guava : guava jar 29.0-jre
com.google.code.gson : gson jar 2.8.6

provided (1)

Идентификатор библиотеки Тип Версия
com.sap.conn.jco » sapjco3 jar 3.0.14

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.13.1
org.mockito : mockito-core jar 1.10.19
org.powermock : powermock-module-junit4 jar 1.6.2
org.powermock : powermock-api-mockito jar 1.6.2

Модули Проекта

Данный проект не имеет модулей.

sap4j

We make SAP interactions dead easy :)

Download

sap4j is available on Maven central repository.

<dependency>
    <groupId>com.sap4j</groupId>
    <artifactId>sap4j</artifactId>
    <version>1.0.2</version>
</dependency>

Features

  • Clean and intuitive DSL to describe connections, queries and iterate results.
  • Maintain multiple SAP connections, query tables and BAPI functions while retrieving all results with same interface.
  • Includes circuit breaker pattern, to avoid overhelming SAP server when query execution issues arise.
  • Provide means to define throttling policies for queries execution.

Usage Examples

Properties properties = new Properties();
properties.setProperty("username", "xxx");
properties.setProperty("password", "xxx");

SAPConnection connection =
    SAPConnectionBuilder.getInstance()
       .withLanguage(ISO639LanguageCode.EN)
       .withAsHost("somehost")
       .withClient("001")
       .withSysnr("01")
       .withPoolCapacity(3)
       .withCredential(SAPCredential.fromProperties(properties))
       .build();

// Instantiate executor for given connection
SAPQueryExecutor executor = SAPQueryExecutor.forConnection(connection, throttlingPolicy, circuitBreaker);

// Write some query
SAPQuery query = SAPQueryBuilder.queryFunction("BAPI_MATERIAL_STOCK_REQ_LIST")
    .withQueryCondition("MATERIAL", "XAEA12")
    .withQueryCondition("GET_IND_LINES", "X")
    .fromTable("MRP_IND_LINES").build();
    
// Execute query
Map<String, Iterator<SAPResultRow>> results = executor.execute(query);
// Retrieve results
Iterator<SAPResultRow> rows = results.get("MRP_IND_LINES");

// Iterate and process results
while(rows.hasNext()){
    StringBuilder builder = new StringBuilder();
    Map<String, String> values = rows.next().getColumnValues(); // process results
    for(String key : values.keySet()){
        builder.append(String.format("'%s', ", values.get(key)));
    }
    System.out.println(builder.toString());
}

Limitations

At the current stage, the library provides means to read data. Executions to write data into SAP were not developed yet. We do not deal with queries caching: this should be handled on server side, to ensure data consisenty.

Recommendations

To ensure optimal queries, please check query conditions target indexed fields. More details on how to ensure high performance can be found in the following SAP document. We specifically advice "Section 5.5: SQL Tuning Guidelines". The rest of the document provides an overview on inner workings of relational DBs, providing details regarding queries optimization, compilation and execution; useful information on how to debug queries performance issues.

Версии библиотеки

Версия
1.0.2
1.0.1
1.0.0