PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

abap-sdk-nwas

An ABAP client library for IBM Watson's Discovery, Language Translator, Natural Language Understanding, Speech to Text, Text to Speech and Assistant services, installed through abapGit.

Each Watson service is wrapped as its own ABAP class, such as ZCL_IBMC_DISCOVERY_V2 or ZCL_IBMC_ASSISTANT_V2, created through zcl_ibmc_service_ext=>get_instance with the service's URL and API key, and the library is delivered as package ZIBMC. Those credentials and the other parameters a wrapper class needs at instantiation can sit in table ZIBMC_CONFIG rather than in the application, and if an API key is passed the SDK generates the IAM bearer token under the cover and refreshes it before it expires; without one, the caller implements token management and hands a token to set_bearer_token. It is for any SAP application run on SAP NetWeaver 7.50 and above, such as SAP Business Suite or SAP S/4HANA on-premises edition, and needs an IBM Cloud account; a separate repository, abap-sdk-scp, covers SAP Cloud Platform ABAP Environment. IBM calls it a community SDK written by ABAPers for the ABAPers in the open-source community and says a community release is not updated on the same schedule as IBM-supported SDKs; the Language Translator row of its service table is marked as a deprecated service that will be discontinued.

Facts

Last pushLicenceApache-2.0

Where it sits

Lives in
Provides
LLM integrationABAPLLM integrationcapabilityCalling a language model from application code with the tenant, destination and credential handling already solved instead using an SDK call with a hand-rolled key.
Requires
abapGitabapGitartifactInstalls the SDK into the SAP system; the README's installation steps are to install abapGit and then clone the SDK repository with it into the package ZIBMC.

Who is behind it

IBM Watson APIsIBM Watson APIsOrganisationMaintains this
In the atlas: maintains 1
@watson-developer-cloud
maintainerJochen RöhrigPersonContributes to this
In the atlas: contributes to 2
@jridfe
Lars HvamPersonContributes to this
In the atlas: maintains 13, contributes to 92, wrote 1
@larshp
Ajiemar SantiagoPersonContributes to this
In the atlas: contributes to 1
@mediumTaj
3 contributors

Before choosing this

Signals

ActivityQuietNo published releases; repository quiet for 34 months

It publishes no releases, and its repository has been quiet for at least 24 full months. This may be normal for stable software; check whether its current state still fits your use.

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
Inside its host
Distributed through
abapGit

Connections2

README

quoted from watson-developer-cloud/abap-sdk-nwas under Apache-2.0, read
watson-developer-cloud/abap-sdk-nwas/README.mdOn GitHub

CLA assistant

ABAP SDK for IBM Watson, using SAP NetWeaver

ABAP client library to use the IBM Watson APIs. This is a Community SDK written by ABAPers for the ABAPers in the Open Source community, to provide easy usage of IBM Watson Developer Services in innovation initiatives combined with any SAP Application which is run on SAP NetWeaver 7.50 and above, such as SAP Business Suite or SAP S/4HANA on-premises edition. It is the choice and responsibility of application developers how this Community SDK is used.

Additionally, as the ABAP SDK is a community release it is not updated with the same schedule as IBM-supported SDKs. Please see more information in Questions.

Choose ABAP SDK release for the applicable ABAP Runtime

abap-sdk-nwasabap-sdk-scp
for SAP NetWeaver AS ABAP 7.50+for SAP Cloud Platform ABAP Environment 2002+
tested on SAP Business Suite and SAP S/4HANA on-premises edition
this repository

Table of Contents

ANNOUNCEMENTS

Major version 2.0.0 released

Version v2.0.0 of the SDK has been released and includes breaking changes - see what's changed in the migration guide.

Before you begin

Installation

The client library is provided as ABAP Git Repository. Proceed as follows to clone the ABAP SDK code to your SAP system.

  1. Install abapGit, using the abapGit Docs
  2. Use abapGit to clone the ABAP SDK Git repository into your SAP system.
  3. Assign the ABAP SDK to the package ZIBMC when performing setup of the abapGit repository.

SAP System Configuration

SAP Profile Parameters

The following SAP profile parameter settings are recommended.

icm/HTTPS/client_sni_enabled = TRUE
ssl/ciphersuites = 135:PFS:HIGH::EC_P256:EC_HIGH
ssl/client_ciphersuites = 150:PFS:HIGH::EC_P256:EC_HIGH
wdisp/ssl_ignore_host_mismatch = TRUE
Proxy configuration

The client library respects the ABAP proxy settings. If you are using a central proxy server that is not already configured in your SAP system, proceed as follows.

  1. Logon to the SAP system and call transaction SICF.
  2. Click Execute (or press F8).
  3. Select menu item Client → Proxy Settings.
  4. On tab Global Settings: Select Proxy Setting is Active and No Proxy Setting for Local Server.
  5. On tabs HTTP Protocol and HTTPS Protocol specify the proxy Host Name and Port. If the proxy server requires logon credentials, also specify User Name and Password.
  6. Click Execute (F8) and OK.
SSL Certificates

Communication between SAP and the IBM Cloud is secured by the Transport Layer Security (TLS) protocol, also known as Secure Sockets Layer (SSL). SSL requires certificates that must be stored on the SAP application server in the Personal Security Environment (PSE). Transaction STRUST is used to maintain the PSE.

Determine required certificate

If a call to an IBM Cloud service failed due to a missing SSL certificate, check the ICM trace file to find the required certificate. To do so, call transaction SMICM and select menu item Goto → Trace File → Display End. Alternatively, call transaction AL11 and navigate to file DIR_HOME/dev_icm. Find last entry in trace file that indicates error SSSLERR_PEER_CERT_UNTRUSTED, as shown in the example below.

[Thr nn] Peer not trusted
[Thr nn] Certificate:
[Thr nn]  Certificate:
[Thr nn]   Subject:                CN=*.watsonplatform.net, O=INTERNATIONAL BUSINESS MACHINES CORPORATION, L=Armonk, SP=New York, C=US
[Thr nn]   Issuer:                 CN=GeoTrust RSA CA 2018, OU=www.digicert.com, O=DigiCert Inc, C=US
[Thr nn]   Serial Number:          05:1C:46:1B:6E:C2:29:48:BD:F0:03:B3:A6:87:1A:5B
[Thr nn]  Verification result:
[...]
[Thr nn]    SignerCert:
[Thr nn]     Certificate:
[Thr nn]      Subject:                CN=GeoTrust RSA CA 2018, OU=www.digicert.com, O=DigiCert Inc, C=US
[Thr nn]      Issuer:                 CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US
[Thr nn]      Serial Number:          05:46:FE:18:23:F7:E1:94:1D:A3:9F:CE:14:C4:61:73
[Thr nn]     Verification result:
[...]
[Thr nn]       SignerCert:
[Thr nn]        Certificate:
[Thr nn]         Subject:                CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US
[...]
[Thr nn] << ---------- End of Secu-SSL Errorstack ----------
[Thr nn]   Target Hostname="stream.watsonplatform.net"
[Thr nn]   SSL NI-hdl 463: local=9.152.20.145:56542  peer=169.48.115.62:443
[Thr nn] <<- ERROR: SapSSLSessionStartNB(sssl_hdl=3fef0000c70)==SSSLERR_PEER_CERT_UNTRUSTED
[Thr nn] *** ERROR => SSL handshake with stream.watsonplatform.net:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102)
[Thr nn] The peer's X.509 Certificate (chain) is untrusted

The SSL error stack shows the SSL certificate chain, which in the example above looks like follows:

Certificate Authority TypeCertificate Authority (CA)
end-user*.watsonplatform.net
intermediateGeoTrust RSA CA 2018
rootDigiCert Global Root CA

You can install any of these SSL certificates. However, it is recommended to install the root CA certificate.
Download the appropriate SSL certificate from the provider's website, for example https://www.digicert.com/digicert-root-certificates.htm. Store the certificate file on your computer.

Add an SSL certificate to the PSE

Proceed as follows to add the downloaded SSL certificate to your SAP system's Standard SSL Client PSE.

  1. Logon to the SAP system and call transaction STRUST.
  2. Switch to edit mode (press according tool bar icon).
  3. If a local PSE file does not exist already, create it by right-clicking on SSL client SSL Client (Standard) and selecting Create from context menu. Keep all default settings in next popup dialog.
  4. In Certificate section, click Import (alternatively select menu item Certificate → Import). Choose the certificate file that you have downloaded and import the certificate.
  5. Click button Add to Certificate List.
  6. Click Save (F3).
Restart the ICM (Internet Communication Manager)

It is recommended to restart the ICM after a new SSL certificate has been applied to the PSE. To do so, proceed as follows.

  1. Logon to the SAP system and call transaction SMICM.
  2. Select menu item Administration → ICM → Restart → Yes.

Credentials

Before you can access a specific service from your SAP system, you must create a service instance in the IBM Cloud and obtain credentials. The credentials can be shared among multiple end users of the SAP system, but you must ensure that the selected plan is sufficient to support the expected number of calls or the expected data volume. Please note that some plans may have restrictions on the allowed methods, so make sure to select the right plan for your purpose.

All currently supported services support IAM authentication (see below). Service credentials consist of an API Key and a URL. Both the API Key and the URL are character values that can be viewed through the IBM Cloud dashboard and need to be provided as parameters i_apikey and i_url to method zcl_ibmc_service_ext=>get_instance.

You can store the values with your application, but it is suggested to do that in an encrypted format. Using cloud services usually creates costs based on usage for the owner of the service instance, and anyone with the credentials can use the service instance at the owner's expenses. If you want to distribute the costs over multiple cost centers, you need to create a service instance and provide service credentials for each cost center separately.

Configuration table

Service credentials and other parameters that must be specified at Watson service wrapper ABAP class instantiation can also be provided in table ZIBMC_CONFIG. This table has three keys:

Table KeyDescription
SERVICEThe ABAP class name without prefix ZCL_IBMC_
INSTANCE_UIDID chosen by application developer that must be provided by application as parameter to method zcl_ibmc_service_ext=>get_instance()
PARAMThe parameter name
List of configuration parameters in table ZIBMC_CONFIG
Parameter NameDefault ValueDescription
URLservice-dependentWatson service url
APIKEYWatson service API keys
PROXY_HOSTProxy server
PROXY_PORTProxy server port
AUTH_NAMEservice-dependentAuthorization, IAM or basicAuth
SSL_IDCLIENTSSL Identity, defines PSE for SSL certificates: CLIENT or ANONYM

IAM Authentication

Identity and Access Management (IAM) is a bearer-token based authentication method. Token management is either performed by the ABAP SDK or must be implemented by the SDK user.
If a value for apikey is provided by the caller in method zcl_ibmc_service_ext=>get_instance(), the ABAP SDK generates a bearer-token under the cover when needed and refreshes it when it is about to expire.
If apikey is not provided for method zcl_ibmc_service_ext=>get_instance(), the ABAP SDK user must implement an individual token management. Before a service method is called the first time, a valid bearer-token must be provided to the Watson service wrapper ABAP class instance as follows:

  lo_service_class->set_bearer_token( i_bearer_token = '...' ).

Afterwards, service methods can be called as long as the provided token is valid. When the token has expired, the method above must be called again with a new (refreshed) bearer-token as parameter.

Usage

The client library is delivered as package ZIBMC. Once the Git Repository has been cloned to the SAP system, a Watson service instance is wrapped by an ABAP class instance.
The following Watson services are currently supported:

ServiceABAP Class Name
DiscoveryZCL_IBMC_DISCOVERY_V2
Language TranslatorZCL_IBMC_LANG_TRANSLATOR_V3 (*)
Natural Language UnderstandingZCL_IBMC_NAT_LANG_UNDRSTND_V1
Speech to TextZCL_IBMC_SPEECH_TO_TEXT_V1
Text to SpeechZCL_IBMC_TEXT_TO_SPEECH_V1
Watson AssistantZCL_IBMC_ASSISTANT_V1
ZCL_IBMC_ASSISTANT_V2

(*) Deprecated service; will be discontinued in the future.

Using the client library requires two steps:

  1. Create an instance of the Watson service wrapper ABAP class by calling method zcl_ibmc_service_ext=>get_instance.
  data:
    lo_service_class type <ABAP Class Name>.

  zcl_ibmc_service_ext=>get_instance(
    exporting
      i_url      = <url>
      i_apikey   = <api key>
      ...
    importing
      eo_instance = lo_service_class ).
  1. Call the Watson service API endpoint by invoking the corresponding class method.
  try.
      lo_service_class->method(
        exporting
          is_input = ...
        importing
          es_output = ... ).
    catch zcx_ibmc_service_exception into data(lo_service_exception).
      ...
  endtry.
Text to Speech Example
* List all voices provided by Watson Text to Speech

  " declare variables
  data:
    lv_apikey            type string value '...',
    lo_text_to_speech    type ref to zcl_ibmc_text_to_speech_v1,
    lo_service_exception type ref to zcx_ibmc_service_exception,
    ls_voice             type zcl_ibmc_text_to_speech_v1=>t_voice,
    lt_voices            type zcl_ibmc_text_to_speech_v1=>t_voices.

  " get Watson Text-to-Speech service instance
  zcl_ibmc_service_ext=>get_instance(
    exporting
      i_url    = 'https://api.kr-seo.text-to-speech.watson.cloud.ibm.com/instances/<uuid>'
      i_apikey = lv_apikey
    importing
      eo_instance = lo_text_to_speech ).

  " call Watson Text-to-Speech service to retrieve available voices
  try.
      lo_text_to_speech->list_voices(
        importing
          e_response = lt_voices ).

    catch zcx_ibmc_service_exception into lo_service_exception.
      message lo_service_exception type 'E'.
  endtry.

  " evaluate voices
  loop at lt_voices-voices into ls_voice.
    ...
  endloop.
Natural Language Understanding Example
* Analyze www.ibm.com using Watson Natural Language Understanding

  " declare variables
  data:
    lv_apikey            type string value '...',
    lo_instance          type ref to zcl_ibmc_nat_lang_undrstnd_v1,
    lo_service_exception type ref to zcx_ibmc_service_exception,
    ls_parameter         type zcl_ibmc_nat_lang_undrstnd_v1=>t_parameters,
    ls_analysis_results  type zcl_ibmc_nat_lang_undrstnd_v1=>t_analysis_results.

  " get Watson Natural Language Understanding service instance
  zcl_ibmc_service_ext=>get_instance(
    exporting
      i_url     = 'https://api.eu-de.natural-language-understanding.watson.cloud.ibm.com/instances/<uuid>'
      i_apikey  = lv_apikey
      i_version = '2019-07-12'
    importing
      eo_instance = lo_instance ).

  " set the input parameters
  ls_parameters-url                         = 'www.ibm.com'.
  ls_parameters-return_analyzed_text        = zcl_ibmc_service=>c_boolean_true.
  ls_parameters-features-entities-emotion   = zcl_ibmc_service=>c_boolean_true.
  ls_parameters-features-entities-sentiment = zcl_ibmc_service=>c_boolean_true.
  ls_parameters-features-keywords-emotion   = zcl_ibmc_service=>c_boolean_true.
  ls_parameters-features-keywords-sentiment = zcl_ibmc_service=>c_boolean_true.

  " call Watson Natural Language Understanding service to analyze URL www.ibm.com
  try.
      lo_instance->analyze(
        exporting
	  i_parameters = ls_parameters
        importing
          e_response = ls_analysis_results ).

    catch zcx_ibmc_service_exception into lo_service_exception.
      message lo_service_exception type 'E'.
  endtry.

  " retreive analysis results from ls_analysis_results
Language Translator Example
* Translate text from English to German using Watson Language Translator

  " declare variables
  data:
    lv_apikey            type string value '...',
    lo_lang_translator   type ref to zcl_ibmc_lang_translator_v3,
    lo_service_exception type ref to zcx_ibmc_service_exception,
    ls_request           type zcl_ibmc_lang_translator_v3=>t_translate_request,
    lv_text              type string,
    ls_trans             type zcl_ibmc_lang_translator_v3=>t_translation_result.

  " get Watson Language Translator service instance
  zcl_ibmc_service_ext=>get_instance(
    exporting
      i_url      = 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/<uuid>'
      i_apikey   = lv_apikey
      i_version  = '2018-05-01'
    importing
      eo_instance = lo_lang_translator ).

  " store text to be translated into ls_request and set the languages
  lv_text = 'Welcome'.
  append lv_text to ls_request-text.
  ls_request-model_id = 'en-de'.
  ls_request-source = 'EN'.
  ls_request-target = 'DE'.

  " call Watson Language Translator service to translate the text in ls_request
  try.
      lo_lang_translator->translate(
        exporting
          i_request     =   ls_request
          i_contenttype = 'application/json'
          i_accept      = 'application/json'
        importing
          e_response = ls_trans ).

    catch zcx_ibmc_service_exception into lo_service_exception.
      message lo_service_exception type 'E'.
  endtry.

  " retreive translation results from ls_trans

API Reference

GitHub Pages contain the ABAP Client Library for Watson API Reference.

Questions

The ABAP SDK is a Community SDK for IBM Watson, created by the IBM Watson development community and SAP's ABAP development community - written by ABAPers from IBM Cloud, IBM Services and IBM Systems. Therefore as a community release it is not updated with the same schedule as IBM-supported SDKs, and does not include support by IBM. For more information on IBM-supported SDKs and the update policy, please see https://cloud.ibm.com/docs/watson?topic=watson-using-sdks

If you have questions about the IBM Watson services or are having difficulties using the APIs, please ask a question at IBM Support Forums or Stack Overflow.

License

This library is licensed under the Apache 2.0 license.


Contributors

  • Christian Bartels
  • Joachim Rese
  • Jochen Röhrig
  • Aleksandar Debelic
  • Stefan Diederichs

Acknowledgements

  • Bradley Knapp (Sponsor)
  • Devraj Bardhan (Sponsor)
  • Sean Freeman (Sponsor)

In addition, we would like to thank the abapGit contributors and the SAP Mentors of this team.

Apache-2.0, read

History

Latest

v2.0.0

Other 11

Notes

Version 2.0.0 of the SDK includes the following enhancements and changes to version 1.0.0:

New service

Enhanced services

  • Watson Assistant V1 with new methods Create_Workspace_Async, Export_Workspace_Async, and Update_Workspace_Async.

  • Watson Assistant V2 with new methods Create_Assistant, Delete_Assistant, List_Assistants, Create_Release, Delete_Release, Deploy_Release, Get_Release, List_Releases Export_Skills, Get_Skill, Import_Skills, Import_Skills_Status, Update_Skill Get_Environment, List_Environments, and Update_Environment.

  • Natural Language Understanding V1 with new methods Create_Categories_Model, List_Categories_Models, Get_Categories_Model, Update_Categories_Model, Delete_Categories_Model, Create_Classifications_Model, List_Classifications_Models, Get_Classifications_Model, Update_Classifications_Model, and Delete_Classifications_Model.

  • Text to Speech V1 with new Methods List_Custom_Prompts, Get_Custom_Prompt, Add_Custom_Prompt, Delete_Custom_Prompt List_Speaker_Models, Get_Speaker_Model, Create_Speaker_Model, and Delete_Speaker_Model.

There were also changes to method parameters to support the most current version of the services. For details, see the migration document.

Removed services (discontinued)

  • Compare and Comply V1
  • Discovery V1
  • Natural Language Classifier V1
  • Personality Insights V3
  • Tone Analyzer V3
  • Visual Recognition V3 and V4
  1. v1.0.0

    Other 2

    Notes

    Update for ABAP SDK for IBM Watson, using SAP NetWeaver.

    • Adapt SDK to latest IBM Watson service APIs.
    • Minor bug fixes
  2. v0.3.0

    Other 3

    Notes

    Update for ABAP SDK for IBM Watson, using SAP NetWeaver.

    • Adapt SDK to latest OpenAPI specifications
    • Improvements in ABAPDoc documentation
    • Minor bug fixes
  3. v0.2.0

    Notes

    Update for ABAP SDK for IBM Watson, using SAP NetWeaver.

  4. v0.1.0

    Notes

    Initial release of the ABAP SDK for IBM Watson.

LLM integration
  1. llm_clientABAP client with one interface to chat-completion LLM APIsfrom ABAP
  2. abap-agent-runtimeABAP-native MCP endpoint that drives opted-in abap2UI5 appsfrom ABAP
  3. abap_btocs_ollamaB-Tocs ABAP SDK plugin connecting to Ollama modelsfrom ABAP
  4. SAP AI CoreAI runtime on BTP with the Generative AI Hubfrom BTP/BAIP
  5. cap-java/cds-aiBridge from CAP Java to SAP AI Core, with Fiori field recommendationsfrom CAP
  6. @cap-js/aiValue-help recommendations and SAP AI Core as a CAP servicefrom CAP
  7. cap-llm-pluginGenerative AI in CAP with fields anonymised through SAP HANAfrom CAP
  8. @geertjanklaps/cds-toon-ai-protocol-adapterProtocol adapter serving CAP data as TOON instead of JSONfrom CAP
  9. abap-sdk-nwas-xABAP client library for IBM watsonx.ai APIsfrom ABAP
  10. @jerome-benoit/sap-ai-providerVercel AI SDK provider for SAP AI Corefrom CAP
  11. ui5-cap-ai-featuresCDS plugin and UI5 controls for AI text features via SAP AI Corefrom CAP
  12. Microsoft AI SDK for SAPABAP library for calling Azure OpenAI and OpenAIfrom ABAP
  13. zllmABAP framework for chaining and orchestrating LLM callsfrom ABAP
  14. ABAP AI SDKSAP reuse library for calling large language models from ABAPfrom ABAP
  15. @sap-ai-sdk/ai-apiAI Core control plane API surface of SAP's AI SDKfrom CAP
  16. @sap-ai-sdk/coreShared internals of SAP's AI SDKfrom CAP
  17. @sap-ai-sdk/foundation-modelsClient for foundation models via SAP AI Core and Generative AI Hubfrom CAP
  18. @sap-ai-sdk/orchestrationOrchestration Service client for templating, grounding and maskingfrom CAP
  19. @sap-ai-sdk/prompt-registryClient for prompts kept in SAP's prompt registryfrom CAP
  20. @saptarishi/cds-plugin-llmCAP service kind putting eleven model providers behind one APIfrom CAP
  21. @shahid.la/cds-db-nlquery-mcpMCP server answering plain-English questions against a CDS schemafrom CAP
  22. @ui5/webcomponentsSAP's UI elements as standard custom elementsfrom UI5

Details

Sources3
Added by handdiscovered herechecked
github.com/watson-developer-cloud/abap-sdk-nwastree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainabap, ai-and-agents
abaplint
issues under its own abaplint configuration15,068
lines42,560
statements31,323
objects20
files26
analysed, master
abaplint version2.120.84
Flavors1
Standard ABAP
“tested on SAP Business Suite and SAP S/4HANA on-premises edition” — watson-developer-cloud/abap-sdk-nwas — READMEchecked
Contributors3

From the repository’s contributor list, .

History in the atlas1
  1. First seen.
For your agent
Ref
artifact:watson-developer-cloud-abap-sdk-nwas
JSON
/artifacts/watson-developer-cloud-abap-sdk-nwas.json
MCP
Connecting an agent