Capture screenshots in ABAP
Add screenshot and scrolling GIF capabilities to your SAP ABAP applications with HTTP client classes. Enterprise-ready, no browser infrastructure needed.
Installation
- 1Use cl_http_client or if_http_client interface
- 2Get your API key from the dashboard
- 3Set the X-KEY header in your requests
Authentication
Include your API key in the X-KEY header with every request:
DATA: lo_client TYPE REF TO if_http_client. cl_http_client=>create_by_url( EXPORTING url = lv_url IMPORTING client = lo_client ). lo_client->request->set_header_field( name = 'X-KEY' value = 'your-api-key' ).
ABAP Screenshot Example
Capture a screenshot or create a scrolling GIF animation with a simple GET request:
DATA: lo_client TYPE REF TO if_http_client,
lv_url TYPE string VALUE 'https://api.scrnpix.com/screenshot?url=https%3A%2F%2Fexample.com&width=1280&height=720&format=png'.
cl_http_client=>create_by_url(
EXPORTING url = lv_url
IMPORTING client = lo_client ).
lo_client->request->set_header_field(
name = 'X-KEY' value = 'your-api-key' ).
lo_client->send( ).
lo_client->receive( ).
DATA(lv_image) = lo_client->response->get_data( ).DATA: lo_client TYPE REF TO if_http_client,
lv_url TYPE string VALUE 'https://api.scrnpix.com/animate?url=https%3A%2F%2Fexample.com&scroll_duration=3000&scroll_easing=ease-in-out'.
cl_http_client=>create_by_url(
EXPORTING url = lv_url
IMPORTING client = lo_client ).
lo_client->request->set_header_field(
name = 'X-KEY' value = 'your-api-key' ).
lo_client->send( ).
lo_client->receive( ).
DATA(lv_animation) = lo_client->response->get_data( ).Response Format
On success, the API returns the image binary data directly in the response body.
| Status Code | 200 OK |
| Content-Type | image/png, image/jpeg, or image/gif |
| Body | Binary image data (XSTRING) |
| Error Response | Error message with 4xx/5xx status |
Key Features
Zero Setup
Use SAP's built-in HTTP client classes. No additional installations required in SAP environments.
Production Ready
Built on Cloudflare Workers with global edge network. Handles concurrency and browser lifecycle automatically.
ABAP Integration
Works with SAP S/4HANA, ECC, BTP, or any SAP system with HTTP client support.
Rich Features
Custom viewport sizes, full page capture, PNG/JPEG formats, scrolling GIFs with 15 easing functions.
Frequently Asked Questions
Do I need to install anything in SAP for this?
No. Scrnpix is a REST API. Use SAP's built-in cl_http_client or REST client frameworks.
Can I use this with SAP S/4HANA or BTP?
Yes. Scrnpix works with any SAP environment — S/4HANA, ECC, BTP (Cloud Foundry/Kyma), or standalone ABAP systems.
How do I handle errors in ABAP?
Check the HTTP return code and use TRY-CATCH for exception handling. Store binary response in XSTRING.
What SAP Basis version is required?
SAP Basis 7.0+ with HTTP client support. The API is a simple HTTP GET request.
Ready to capture screenshots in ABAP?
Get your API key and start rendering screenshots in seconds. Free tier includes 50 screenshots per month.
Start Free