Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Predefined escape function in ABAP - escape your HTML / XML / JS content

$
0
0

I want to mention the nice feature of escaping string characters in ABAP. There is predefined function escape available with all options (HTML, XML, JS, JSON, XSS, URI, etc.) when you are using SAP_BASIS >= 731.

 

 

Function definition

Calling of the function is in this format:

escaped_string = escape( val = unescaped_string format = format )

 

 

Use cases

There are several use cases when you can use it such as:

  • Encoding URL / URIs
  • Escaping XML / HTML content, even HTML with Javascript
  • Encoding file name in HTTP header response as described in my other blog post

 

 

Documentation

There are two nice documentation sites:

 

 

This escape function should provide complex way in order to escape everything. I hope you enjoy it.


Viewing all articles
Browse latest Browse all 943

Trending Articles