Skip to content

Avoid Hardcoded HTTP, HTTPS, and FTP URLs in Source Code ​

WarningSecurity & Robustness#EC NO_HARDCODED_URLRemote Enabled

Overview ​

Avoid hardcoded HTTP, HTTPS, and FTP URLs in source code.

ATC Finding Message: Avoid hardcoded URL; use SM59 destination or communication arrangement

Rationale ​

Hardcoding absolute URLs and endpoint addresses directly in source code creates brittle dependencies, environment pollution, and security vulnerabilities. When promoting code across landscapes (DEV -> QA -> PROD) or deploying to ABAP Cloud environments, hardcoded URLs prevent environment-specific endpoint resolution and break proxy routing.

Best Practice: Maintain remote endpoints in SM59 RFC destinations, Communication Arrangements, or Customizing tables, and resolve them dynamically at runtime.

Non-Compliant ​

abap
" Anti-pattern: Hardcoded URL connection
DATA(lo_dest) = cl_http_destination_provider=>create_by_url(
  i_url = 'https://api.skylint.org/v1/orders' ).
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( lo_dest ).

Compliant ​

abap
" Clean ABAP: Configuration-based destination (SM59, BTP, or Communication Arrangement)
DATA(lo_dest) = cl_http_destination_provider=>create_by_destination(
  i_destination = 'SKYLINT' ).
DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( lo_dest ).

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault ValueDescription & Guidance
CHECK_HTTPBooleantrueFlag hardcoded HTTP and HTTPS URLs
CHECK_FTPBooleantrueFlag hardcoded FTP and SFTP URLs

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_HARDCODED_URL

" SAP CI_ prefix format:
... "#EC CI_NO_HARDCODED_URL

Technical Details ​

Released under the MIT License.