In this tutorial, we’ll configure the AWS SDK for SAP ABAP to enable your SAP system to securely interact with Amazon S3 and Textract for document storage and OCR use cases. This is part two of my hands-on blog and video series on how to build ABAP RAP applications that leverage AWS services.
If you haven’t installed the AWS SDK transports into your SAP system yet, make sure to check out Part 1: Installing the AWS SDK for SAP ABAP in Docker first.
✅ This guide is suitable for:
- Docker-based ABAP developer trial systems
- On-premise SAP NetWeaver systems (7.4+) or Systems running in clouds other than AWS
- NOT suitable for BTP ABAP or native AWS-hosted SAP environments (different auth mechanisms)
What You’ll Learn in This Post
- Setting technical prerequisites
- Importing AWS certificates
- Creating an SDK profile for your RAP app
- Configuring secure credential storage using SSF
- Defining logical AWS resources
- Creating IAM roles and policies in AWS
- Switching between operational and DR scenarios
- Testing the setup with a real ABAP report
- Enabling trace logging for troubleshooting
🔗 Resources
- Install the AWS SDK for SAP ABAP – Part 1
- AWS SDK for SAP ABAP Official Page
- Configuring the AWS SDK for SAP ABAP – An excellent blog post
📹 Watch the Video
Watch the full walkthrough on YouTube:
🧪 Test Code
REPORT zdemo_s3_listbuckets.
START-OF-SELECTION.
PARAMETERS pv_lres TYPE /aws1/rt_resource_logical
DEFAULT 'ZINVOICE_BUCKET' OBLIGATORY.
DATA(go_session) = /aws1/cl_rt_session_aws=>create( 'ZINVOICE' ).
DATA(gv_bucket) = go_session->resolve_lresource( pv_lres ).
DATA(go_s3) = /aws1/cl_s3_factory=>create( go_session ).
TRY.
DATA(lo_output) = go_s3->listobjectsv2(
iv_bucket = CONV string( gv_bucket )
iv_maxkeys = 100
).
LOOP AT lo_output->get_contents( ) INTO DATA(lo_object).
DATA lv_mdate TYPE datum.
CONVERT TIME STAMP lo_object->get_lastmodified( )
TIME ZONE 'UTC'
INTO DATE lv_mdate.
WRITE: / CONV text30( lo_object->get_key( ) ),
lv_mdate, lo_object->get_size( ).
ENDLOOP.
CATCH /aws1/cx_rt_generic INTO DATA(lo_ex).
DATA(lv_msg) = lo_ex->if_message~get_text( ).
MESSAGE lv_msg TYPE 'I'.
ENDTRY.
🎉 Wrap-Up
You’ve now fully configured the AWS SDK for SAP ABAP to integrate your RAP apps with Amazon S3 and Textract. With authentication, regional failover, logical resource mapping, and secure credential storage, you’re ready to build powerful document-handling ABAP applications.
Leave a Reply