Full implementation of WHATWG URL Standard.
NO WARRANTIES, MIT License
┌────────┬──┬──────────┬──────────┬─────────────────┬──────┬──────────┬─┬──────────────┬──────────┐
" https: // user : pass @ sub.example.com : 8080 /p/a/t/h ? query=string #hash "
│ scheme │ │ username │ password │ host │ port │ path │ | query │ fragment │
├────────┴──┴──────────┴──────────┴─────────────────┴──────┴──────────┴─┴──────────────┴──────────┤
│ url │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘
(All spaces in the "" line should be ignored. They are purely for formatting.)
Parse a URL into it's component:
DATA(url) = zcl_url=>parse( 'https://example.com/path?query#fragment' ).
" url->components-scheme = 'https'
" url->components-host = 'example.com'
" url->components-path = '/path'
" url->components-query = 'query'
" url->components-fragment = 'fragment'
Serialize a URL from components:
DATA(components) = VALUE zcl_url=>ty_url_components(
scheme = 'https'
username = 'user'
password = 'pass'
host = 'example.com'
port = '8080'
path = '/path/to/resource'
query = 'key=value'
fragment = 'section' ).
DATA(url_string) = zcl_url=>serialize( components ).
" url_string = 'https://user:pass@example.com:8080/path/to/resource?key=value#section'
SAP Basis 7.50 or higher
There's no support for punycode (should be a separate package).
Install url
as a global module in your system using apm.
or
Specify the url
module as a dependency in your project and import it to your namespace using apm.
All contributions are welcome! Read our Contribution Guidelines, fork this repo, and create a pull request.
You can install the developer version of ABAP URL using abapGit by creating a new online repository for https://github.com/abapPM/ABAP-URL
.
Recommended SAP package: $URL
Made with ❤ in Canada
Copyright 2025 apm.to Inc. https://apm.to