likweitan/abap-skills

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,…

Hot #862 First seen May 7, 2026

Installation

$ npx skills add likweitan/abap-skills --skill odata

Summary

  • 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".

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from likweitan/abap-skills · top by installs.

npx skills add likweitan/abap-skills

Browse all from likweitan/abap-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 59
License LICENSE
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 8,587 B
  • docs SUMMARY.md 713 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 51 installs

SKILL.md

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

  1. Identify the approach:

- RAP-based service (preferred for ABAP Cloud) - SEGW-based service (classic, Standard ABAP only) - OData consumption (client proxy)

  1. 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:

@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 Type Protocol Use Case
OData V4 - UI V4 SAP Fiori Elements apps
OData V2 - UI V2 Legacy Fiori apps, older frontends
OData V4 - Web API V4 API consumption (A2X scenarios)
OData V2 - Web API V2 API consumption (legacy)
InA - UI InA Analytical 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

Feature OData V4 OData V2
Protocol JSON by default XML (Atom) default, JSON option
Batch $batch with JSON $batch with multipart
Deep operations Deep create/update supported Limited
Actions/Functions Bound and unbound Function imports
Filtering $filter with lambda $filter basic
Draft Full support Supported via extensions
Aggregation $apply transformation Not natively supported
Recommendation Preferred for new development Maintain 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: GETENTITYSET, GETENTITY, CREATE_ENTITY, etc.
  5. Register service in /IWFND/MAINT_SERVICE
  6. Test via /IWFND/GW_CLIENT or browser

DPC Method Implementation Example

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)

"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)

"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:

@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 / Issue Solution
/IWBEP/CXMGWBUSI_EXCEPTION Check DPC implementation, validate input data
/IWBEP/CXMGWTECH_EXCEPTION Check data model consistency, regenerate artifacts
403 Forbidden Check ICF node activation, authorization
404 Not Found Verify service is registered and activated
$metadata returns empty Publish service binding, check activation
Draft not working Verify draft table exists, BDEF has with draft
Deep create fails Check composition in CDS and BDEF
CXWEBHTTPCLIENTERROR Check communication arrangement, SSL certificates

Output Format

When helping with OData topics, structure responses as:

## 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