🏭

SAP Integration — Extract Invoice Data Automatically

Integrate Cargoffer OCR with SAP to automatically extract invoice, delivery note, and price list data from PDF attachments.

Overview

SAP generates thousands of PDF documents daily. Cargoffer OCR automates data extraction from SAP invoices, delivery notes, and price lists, feeding structured JSON directly into your SAP modules.

Architecture

SAP → PDF via print program → HTTP POST to Cargoffer OCR API → Structured JSON → SAP RFC/BAPI callback

SAP ABAP Code

abap
DATA: lv_url TYPE string VALUE 'https://ocr.cargoffer.com/api/upload',
      lv_api_key TYPE string VALUE 'ocr_your_api_key',
      lt_file TYPE TABLE OF string.

" Read PDF from SAP application server
OPEN DATASET lv_pdf_path FOR INPUT IN BINARY MODE.
READ DATASET lv_pdf_path INTO lv_file_content.
CLOSE DATASET lv_pdf_path.

" Call Cargoffer OCR API via HTTP
cl_http_client=>create_by_url(
  EXPORTING url = lv_url
  IMPORTING client = lo_client ).

lo_client->request->set_method('POST').
lo_client->request->set_header_field(
  name = 'Authorization'
  value = |Bearer { lv_api_key }| ).
lo_client->request->set_content_type('multipart/form-data').

" Send and receive JSON result
lo_client->send( ).
lo_client->receive( ).
lv_response = lo_client->response->get_cdata( ).

SAP PI/PO Setup

Configure SAP Process Integration to route PDFs to Cargoffer OCR. Use the REST adapter with JSON converter to parse the structured response and map it to SAP IDoc or BAPI structures.

Pricing

Each SAP invoice costs ~$0.002 to process. With 10,000 invoices/month (Pro plan at $49), the total cost is ~$69/month including OCR.

Ready to try it?

Start Free →