The AWS SDK comprises of 341 sets of R files and K files (TR’s), all these TRs are basically ABAP programs used as interface with some 200+ AWS Services and to complete the integration, import of all 341 TR’s is essential for invoking the SDK in the ABAP environment.

Details of all the 341 sets present in the AWS SDK can be seen here –
https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/tla.html

In this blog, I am sharing the details of the steps to performed to create the TR queue in stms_import

Step 1

Post preview request approval from AWS, you need to download the AWS SDK for SAP ABAP.
To download the SDK, you need to use the following command (Suse Linux) in a system connected to the internet and then move file accordingly in your test or dev system.

aws s3 cp s3://awssdksapabapv1-prod-us-west-2/awsSdkSapabapV1/release/abapsdk-LATEST.zip .

if the output of above command is as seen here:
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

the above error could for one of the two reasons
1. Approval for preview request from AWS is not in place.
2. Access to the AWS owned S3 bucket is not setup in your AWS environment – Refer the steps to setup this access here – https://docs.aws.amazon.com/sdk-for-sapabap/latest/developer-guide/installation.html

Once the SDK downloaded and its moved to the target system is completed, it is recommended to unzip the downloaded file in /usr/sap/trans directory.
The uncompressed package contains 341 folders and each folder have its R file and the K file.

Step 2

The following command will be helpful to move the R & K files into the system.

cp a*/R* /usr/sap/trans/data       [to move R file into the /usr/sap/trans/data folder] cp a*/K* /usr/sap/trans/cofiles   [to move K file into the /usr/sap/trans/cofiles folder]

In the above command, a* will ensure all the folder names starting with word “a” will be used to move the R file & the K file respectively.
Accordingly, you need to repeat above command with first character of the all the folders. To be repeated until all the folders are completed.

Step 3

Using the following script, you can now generate the TR queue in the stms_import

Create a directory where you like, I created inside trans directory with name TrnScript. Provide read write access to sidadm for this directory (chown sidadm:sapsys TrnScript)

Instead of moving 341 TR’s, one by one using stms_import and then from the Extras > Other Requests > Add > entering each TR name to import will be time consuming and prone to typo errors etc.

1. cd /usr/sap/trans/cofiles
2. Execute the command ls > transport_list.txt [for creating list in a .txt file] 3. Only the list of all the K files will be stored in the file named transport_list.txt.
4. In the file transport_list.txt, in each of the line, you need to prefix the word “AWS” and remove the characters “.AWS”
5. this file will contain transports list, each transport in new line, which will look like below:

AWSK961234
AWSK964567
AWSK967890
AWSK960123
AWSK963456
AWSK966789

6. mv transport_list.txt /usr/sap/trans/TrnScript

This is a simple text file and we need to ensure count of TRs in this file is 341 only, and they will be processed one by one in linear sequence, the transport in top will be processed first and it will move to second line and so on in downward direction. This file will need read access rights for sidadm.

Step 4

We are creating a script which will add the transports into the buffer (generate the TR queue in stms_import), below script is not going to do any harm in system.

cd /usr/sap/trans/TrnScript
vi trns_add2buff.sh

[insert the following code in this file] #!/bin/bash
# Start of Script file
#! This script will add transports to buffer one by one sequentially.
# The list of transport should be given in transport_list.txt file where
# each transport should be in new line.
###
TPLIST=/usr/sap/trans/TrnScript/transport_list.txt
TPSTATUS=${TPLIST}.log
for i in `cat ${TPLIST}`
do
/usr/sap/SID/SYS/exe/uc/linuxx86_64/tp addtobuffer $i SID u1 pf=/usr/sap/trans/bin/TP_DOMAIN_SID.PFL
RC=$?
print “`date`…Transport ${i} Status RC=${RC}” >> ${TPSTATUS}
done
# End of script file

Note: This above file should have executable rights for sidadm. Check this file carefully for the path mentioned & for following key names.
i. SID (must be of your target system)
ii. TPLIST
iii. tp
iv. DOMAIN file

Execute the script with following command.
su sidadm

./trns_add2buffer.sh

It will create a log file named transport_list.txt.log at same location where transport_list.txt file is present, provided sidadm has write access to the directory.

This log file will have data to check if data file and cofiles are present and readable. Also, if any of the transport is imported in system without option “Leave transport Request in Queue for Later Import” then it will add it again so the request can become transportable again. If you find any other return code than zero, then correct the issue rename the log file and rerun this script file again and check log file.

Post completion of above steps, we can verify the count of TRs, i.e., 341 in the transport_list.txt are matching with the counts of TR’s available for import in the queue inside the transaction stms_import

Verify the status of all the 341 items are showing the status as “Ready for import”.
Once the TR queue of 341 items is ready, we can proceed to import the TRs into the system.
As a best practice usually one TR is imported at a time, but in the current scenario, all the 341 TRs are required to be imported. If we carry out import one by one, it’s going to take long time as well the manual process will be prone to typo errors & other delays.

Thus, the step 5 below gives us a script to import all the 341 TRs in one go. Kindly note that by following the step 5 below, system might need approx.

Note:
1. As per AWS, you can import the transports into any client, however, it may be required to import the TRs in client number where ABAP Developer Teams are setup
2. Approx 12+Hrs are required to complete all of the import of 341 TRs

Step 5

cd /usr/sap/trans/TrnScript
vi trns_import.sh

in this script enter the following:

#!/bin/bash # Start of Script file
#! This script will import transports one by one sequentially.
# The list of transport should be given in transport_list.txt file where each transport should # be in new line.
###
TPLIST=/usr/sap/trans/trnscript/transport_list.txt
TPSTATUS=${TPLIST}.RClog
for i in `cat ${TPLIST}`
do
/usr/sap/SID/SYS/exe/uc/linuxx86_64/tp import $i SID client=400 u237 pf=/usr/sap/trans/bin/TP_DOMAIN_SID.PFL
RC=$?
print “`date`…Transport ${i} Status RC=${RC}” >> ${TPSTATUS}
if [ “$RC” -ne 0 ] && [ “$RC” -ne 4 ]; then
break
fi
done
# End of script file

Note:

1. This above file should have executable rights for sidadm. Check this file carefully for the path mentioned & for following key names.

I. SID (must be of your target system)
II. Client #
III. TPLIST
IV. tp
V. DOMAIN file

Once the above execution is over, in the transaction stms_import, you can verify the successful completion of all the 341 TR’s by checking “status” column for each item is displayed as “Request already imported” & a green coloured check mark is present.

You need to proceed further for rest of the configurations of the AWS SDK for SAP ABAP

 

Note: At the time of posting this blog (June 2023), the AWS SDK for SAP ABAP is under preview program and not intended for use in Production environment.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x