Skip to Content
-1
Aug 25, 2023 at 01:11 PM

how to read the java script file a in abap class

240 Views

Hi Experts ,

I have the below code in a abap method that does the purpose of closing a external dialog with response but it has found a security issue that needs to be checked .

CONCATENATE

'<html><head>' "#EC NOTEXT
'<script type="text/javascript" language="JavaScript">' "#EC NOTEXT
'window.open('''',''_self'').close()'
'</script>' "#EC NOTEXT
INTO data(lv_html) RESPECTING BLANKS. "#EC NOTEXT
CONCATENATE lv_html '</head><body></body></html>' INTO lv_html. "#EC NOTEXT
server->response->append_cdata( lv_html ).



The alternate approach suggested is to place the code in a java script file(same package of the abap class possible where this code is ?) and read the file here . Can some one please help how and where to place a file with this code in script file and then in abap class method read it to get the same content and does the job ?


Thanks,

Rajendra