Amazon RDS examples using SDK for SAP ABAP - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Amazon RDS examples using SDK for SAP ABAP

The following code examples show you how to perform actions and implement common scenarios by using the AWS SDK for SAP ABAP with Amazon RDS.

Actions are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

Each example includes a link to the complete source code, where you can find instructions on how to set up and run the code in context.

Topics

Actions

The following code example shows how to use CreateDBParameterGroup.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_dbparametergroupname = 'mydbparametergroup' " iv_dbparametergroupfamily = 'mysql8.0' " iv_description = 'My custom DB parameter group for MySQL 8.0' TRY. oo_result = lo_rds->createdbparametergroup( iv_dbparametergroupname = iv_dbparametergroupname iv_dbparametergroupfamily = iv_dbparametergroupfamily iv_description = iv_description ). MESSAGE 'DB parameter group created.' TYPE 'I'. CATCH /aws1/cx_rdsdbparmgralrexfault. MESSAGE 'DB parameter group already exists.' TYPE 'I'. CATCH /aws1/cx_rdsdbprmgrquotaexcd00. MESSAGE 'DB parameter group quota exceeded.' TYPE 'I'. ENDTRY.

The following code example shows how to use DeleteDBParameterGroup.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_dbparametergroupname = 'mydbparametergroup' TRY. lo_rds->deletedbparametergroup( iv_dbparametergroupname = iv_dbparametergroupname ). MESSAGE 'DB parameter group deleted.' TYPE 'I'. CATCH /aws1/cx_rdsdbprmgrnotfndfault. MESSAGE 'DB parameter group not found.' TYPE 'I'. CATCH /aws1/cx_rdsinvdbprmgrstatef00. MESSAGE 'DB parameter group is in an invalid state.' TYPE 'I'. ENDTRY.

The following code example shows how to use DescribeDBEngineVersions.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_engine = 'mysql' " iv_dbparametergroupfamily = 'mysql8.0' (optional - filters by parameter group family) TRY. oo_result = lo_rds->describedbengineversions( iv_engine = iv_engine iv_dbparametergroupfamily = iv_dbparametergroupfamily ). DATA(lv_version_count) = lines( oo_result->get_dbengineversions( ) ). MESSAGE |Retrieved { lv_version_count } engine versions.| TYPE 'I'. ENDTRY.

The following code example shows how to use DescribeDBParameterGroups.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_dbparametergroupname = 'mydbparametergroup' TRY. oo_result = lo_rds->describedbparametergroups( iv_dbparametergroupname = iv_dbparametergroupname ). MESSAGE 'DB parameter group retrieved.' TYPE 'I'. CATCH /aws1/cx_rdsdbprmgrnotfndfault. MESSAGE 'DB parameter group not found.' TYPE 'I'. ENDTRY.

The following code example shows how to use DescribeDBParameters.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_dbparametergroupname = 'mydbparametergroup' " iv_source = 'user' (optional - filters by parameter source) TRY. oo_result = lo_rds->describedbparameters( iv_dbparametergroupname = iv_dbparametergroupname iv_source = iv_source ). DATA(lv_param_count) = lines( oo_result->get_parameters( ) ). MESSAGE |Retrieved { lv_param_count } parameters.| TYPE 'I'. CATCH /aws1/cx_rdsdbprmgrnotfndfault. MESSAGE 'DB parameter group not found.' TYPE 'I'. ENDTRY.

The following code example shows how to use DescribeOrderableDBInstanceOptions.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_engine = 'mysql' " iv_engineversion = '8.0.35' TRY. oo_result = lo_rds->descrorderabledbinstoptions( iv_engine = iv_engine iv_engineversion = iv_engineversion ). DATA(lv_option_count) = lines( oo_result->get_orderabledbinstoptions( ) ). MESSAGE |Retrieved { lv_option_count } orderable DB instance options.| TYPE 'I'. ENDTRY.

The following code example shows how to use ModifyDBParameterGroup.

SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

" iv_dbparametergroupname = 'mydbparametergroup' " it_parameters - table containing parameter objects with: " - parametername = 'max_connections' " - parametervalue = '100' " - applymethod = 'immediate' or 'pending-reboot' TRY. oo_result = lo_rds->modifydbparametergroup( iv_dbparametergroupname = iv_dbparametergroupname it_parameters = it_parameters ). MESSAGE 'DB parameter group modified.' TYPE 'I'. CATCH /aws1/cx_rdsdbprmgrnotfndfault. MESSAGE 'DB parameter group not found.' TYPE 'I'. CATCH /aws1/cx_rdsinvdbprmgrstatef00. MESSAGE 'DB parameter group is in an invalid state.' TYPE 'I'. ENDTRY.