Dear ABAPers,
Have you ever written code using the ABAP statements OPEN, READ, and WRITE DATASET to read an SAP-generated file from one directory and write it to another directory on a shared file system in your organization? If so, you may have liked the ease with which you can accomplish this by writing code in your se38 ABAP editor.
But what if there was a way to read an SAP-generated file or read data from SAP tables and write it directly to an AWS S3 bucket using your own ABAP code and editor? That’s right, it’s now possible thanks to the AWS SDK for SAP ABAP! With this you can read a file using Open/Read Dataset and send it to AWS S3 by calling new class and method provided by the AWS SDK for SAP ABAP.
On top of this imagine doing this without worrying about writing code for authorization, authentication, non-sap editors and API connections. Instead, you can concentrate on business data, logic, and innovation you want work on. This can give you the innovation and flexibility of using AWS services ranging from simple file storage to very innovative Gen AI at your fingertips.
The AWS SDK for SAP ABAP offers several benefits, including:
These links below are a good starting point for your first steps:
After getting overview of how things work you can set your plan into action by getting SAP Basis, Security and AWS expert to do following steps mentioned in below link:
https://docs.aws.amazon.com/sdk-for-sapabap/latest/developer-guide/getting-started.html
The steps vary slightly based on on-premises, AWS cloud or other cloud based SAP system.
Prerequistes: Have SAP NetWeaver ABAP 7.4 or higher environment.
Rough summary of steps in above link:
Once you have completed these steps, you can start writing ‘z-program’ ABAP code to read files and write them to S3 buckets.
Let’s consider a simple but heavily used example. Let’s send a file to AWS S3 using ABAP code assuming a S3 bucket is already existing. If not, you can ask your AWS expert to create one for you with appropriate authentication and ‘WRITE’ permissions for your SAP user-id as discussed above.
I have taken below snippet of ABAP code from GitHub link provided by Amazon:
In the link you will find ABAP class ‘zcl_aws1_s3_actions’ and method ‘put_object’ which reads a file using OPEN/READ DATASET command and executes method of SDK to write file to S3 bucket.
More API documentation for S3 service can be found at this link:
https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/s3/index.html
Next steps you can consider: