Odata logo

Odata

Community
likweitan
odata

Help with OData service development in ABAP including OData V2 and V4 services via RAP service bindings, SEGW-based services, service definitions, service bindings, OData annotations, consumption of external OData services, and troubleshooting common OData errors. Use when users ask about OData, OData V2, OData V4, service binding, service definition, SEGW, OData annotations, OData consumption, OData client proxy, HTTP client, communication arrangement, external API consumption, /IWBEP/ errors, or exposing a RAP BO as OData. Triggers include "create OData service", "expose RAP BO", "service binding", "OData V4", "consume external OData", "OData annotations", "SEGW service", or "OData error".

Overview

Publisherlikweitan
Repositoryabap-skills
Skill nameodata
Stars
64
Forks
15
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by likweitan on GitHub. Read the source before you install it.

Installation

Install the Odata AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/likweitan/abap-skills.git /tmp/abap-skills
mkdir -p .claude/skills
cp -r /tmp/abap-skills/skills/odata .claude/skills/odata
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Odata in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Odata on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Odata is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

OData Service Development

Guide for creating and consuming OData services in ABAP, covering both RAP-based (V4/V2) and SEGW-based (V2) approaches.

Workflow

  1. Determine the user's goal:

    • Exposing a RAP BO as an OData service (recommended approach)
    • Creating a classic SEGW-based OData V2 service
    • Consuming an external OData service from ABAP
    • Adding OData annotations for Fiori UIs
    • Troubleshooting OData errors
  2. Identify the approach:

    • RAP-based service (preferred for ABAP Cloud)
    • SEGW-based service (classic, Standard ABAP only)
    • OData consumption (client proxy)
  3. Guide implementation following SAP best practices

RAP-Based OData Services (Recommended)

Architecture Flow

CDS View Entity → Behavior Definition → Service Definition → Service Binding
                                                              OData V4/V2 Endpoint

Service Definition

Exposes CDS entities and their behaviors as a named service:

cds
@EndUserText.label: 'Travel Service'
define service ZUI_TRAVEL_O4 {
  expose ZC_Travel as Travel;
  expose ZC_Booking as Booking;
  expose I_Currency as Currency;
  expose I_Country as Country;
}
Key Rules
  • Expose projection CDS views (C_ prefix by convention), not root views
  • Include value help CDS views (I_* views) the UI needs
  • Alias names become OData entity set names
  • One service definition can be bound to multiple protocols

Service Binding

Binds a service definition to a specific OData protocol and provides a URL:

Binding TypeProtocolUse Case
OData V4 - UIV4SAP Fiori Elements apps
OData V2 - UIV2Legacy Fiori apps, older frontends
OData V4 - Web APIV4API consumption (A2X scenarios)
OData V2 - Web APIV2API consumption (legacy)
InA - UIInAAnalytical scenarios

Creating a Service Binding

  1. In ADT: New → Other ABAP Repository Object → Business Services → Service Binding
  2. Select the service definition
  3. Choose binding type (e.g., OData V4 - UI)
  4. Activate
  5. Click Publish to register the service
  6. Click Preview to open the Fiori Elements preview

OData V4 vs V2

FeatureOData V4OData V2
ProtocolJSON by defaultXML (Atom) default, JSON option
Batch$batch with JSON$batch with multipart
Deep operationsDeep create/update supportedLimited
Actions/FunctionsBound and unboundFunction imports
Filtering$filter with lambda$filter basic
DraftFull supportSupported via extensions
Aggregation$apply transformationNot natively supported
RecommendationPreferred for new developmentMaintain existing only

SEGW-Based OData V2 Services (Classic)

For Standard ABAP only (not available in ABAP Cloud):

Architecture

SEGW Project → Data Model (Entity Types, Sets, Associations)
             → Service Implementation (MPC/DPC classes)
             → Register & Activate in /IWFND/MAINT_SERVICE

Steps

  1. Create project in SEGW transaction
  2. Define data model: Entity types, properties, navigation properties
  3. Generate runtime artifacts (MPC/DPC classes)
  4. Implement DPC extension methods: GET_ENTITYSET, GET_ENTITY, CREATE_ENTITY, etc.
  5. Register service in /IWFND/MAINT_SERVICE
  6. Test via /IWFND/GW_CLIENT or browser

DPC Method Implementation Example

abap
METHOD travelset_get_entityset.
  SELECT * FROM ztravel_tab
    INTO TABLE @DATA(lt_travel)
    UP TO 100 ROWS.

  et_entityset = CORRESPONDING #( lt_travel ).
ENDMETHOD.

Consuming External OData Services

In ABAP Cloud (using HTTP Client and Communication Arrangements)

abap
"1. Get HTTP client via communication arrangement
DATA(lo_dest) = cl_http_destination_provider=>create_by_comm_arrangement(
  comm_scenario  = 'Z_MY_OUTBOUND_SCENARIO'
  service_id     = 'Z_MY_HTTP_SERVICE' ).

DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( lo_dest ).

"2. Build request
DATA(lo_request) = lo_client->get_http_request( ).
lo_request->set_uri_path( '/sap/opu/odata4/sap/api_business_partner/srvd_a2x/sap/api_business_partner/0001/A_BusinessPartner?$top=10' ).

"3. Execute and parse response
DATA(lo_response) = lo_client->execute( if_web_http_client=>get ).
DATA(lv_json) = lo_response->get_text( ).
lo_client->close( ).

Using OData Client Proxy (V2/V4)

abap
"Create OData client proxy for V4
DATA(lo_proxy) = /iwbep/cl_cp_client_proxy_fact=>create_v4_remote_proxy(
  iv_service_definition_name = 'Z_MY_ODATA_CDEF'
  io_http_client             = lo_client
  iv_relative_service_root   = '/sap/opu/odata4/sap/api_service/0001/' ).

"Build and execute read request
DATA(lo_request) = lo_proxy->create_resource_for_entity_set( 'ENTITYSETNAME' )->create_request_for_read( ).
lo_request->set_top( 10 ).
DATA(lo_response) = lo_request->execute( ).

"Get business data
DATA lt_data TYPE STANDARD TABLE OF z_entity_type.
lo_response->get_business_data( IMPORTING et_business_data = lt_data ).

OData Annotations for Fiori

Key CDS annotations that control OData/Fiori behavior:

cds
@UI.headerInfo: {
  typeName: 'Travel',
  typeNamePlural: 'Travels',
  title: { type: #STANDARD, value: 'TravelID' },
  description: { type: #STANDARD, value: 'Description' }
}

@UI.lineItem: [{ position: 10 }]
@UI.selectionField: [{ position: 10 }]
@UI.identification: [{ position: 10 }]
TravelID;

@UI.lineItem: [{ position: 20, importance: #HIGH }]
@UI.identification: [{ position: 20 }]
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_Currency', element: 'Currency' } }]
CurrencyCode;

Troubleshooting

Error / IssueSolution
/IWBEP/CX_MGW_BUSI_EXCEPTIONCheck DPC implementation, validate input data
/IWBEP/CX_MGW_TECH_EXCEPTIONCheck data model consistency, regenerate artifacts
403 ForbiddenCheck ICF node activation, authorization
404 Not FoundVerify service is registered and activated
$metadata returns emptyPublish service binding, check activation
Draft not workingVerify draft table exists, BDEF has with draft
Deep create failsCheck composition in CDS and BDEF
CX_WEB_HTTP_CLIENT_ERRORCheck communication arrangement, SSL certificates

Output Format

When helping with OData topics, structure responses as:

markdown
## OData Service Guidance

### Approach

- Type: [RAP-based / SEGW-based / Consumption]
- Protocol: [OData V4 / OData V2]

### Implementation

[Step-by-step with code examples]

### Testing

[How to test the service]

References

Related Skills

  • rap: Use for building RAP business objects that are exposed as OData services
  • cds-view-entities: Use for data modeling that underpins OData services
  • authorization-iam: Use for securing OData services via IAM apps
  • btp-abap-environment: Use for communication arrangement setup for OData consumption

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Odata AI skill do?

Help with OData service development in ABAP including OData V2 and V4 services via RAP service bindings, SEGW-based services, service definitions, service bindings, OData annotations, consumption of external OData services, and troubleshooting common OData errors. Use when users ask about OData, OData V2, OData V4, service binding, service definition, SEGW, OData annotations, OData consumption, OData client proxy, HTTP client, communication arrangement, external API consumption, /IWBEP/ errors, or exposing a RAP BO as OData. Triggers include "create OData service", "expose RAP BO", "service...

Why use Odata on TypingMind?

Because you install it once and use it with any model. Odata is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Odata in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/likweitan/abap-skills/tree/main/skills/odata. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Odata?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Odata?

As many as you like. As long as a model supports skills, you can use Odata with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Odata AI skill free?

Yes. It is published on GitHub by likweitan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇