0

I know my question is rather common on these forums, although it has a unique aspect to it.

I have an HTML page with a HTML Input Form & Submit button on it. This Submit button is linked to a MS SQL 2008 Select Statement which is coded in a language called ABAP. ABAP is the standard language for any SAP programs / functions / transactions. The page with the ABAP Code, is distinct from the HTML page, but is linked by means of the BSP (Business Server Pages) in SAP. Basically you configure the "On Input Processing" which is the "What happens when I click SUBMIT" in ABAP. But you cannot configure the OUTPUT of a SQL SELECT query in ABAP as it is not allowed, this needs to be done in HTML.

What I would like to do is, I need to add code to my HTML page, which will take the results returned from the SQL Query after clicking the SUBMIT button, and export it in CSV format for the user to view / download.

How would I do this?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • HTML is only a markup language, there is no algorithmic logic. Could you explain what you mean by "the output of a SQL select query must be configured in HTML" ? SQL is server-side, and HTML is interpreted client-side, so I do not understand what you mean. – personne3000 Sep 18 '14 at 06:41
  • Basically, I cannot add the OUTPUT section to the SQL Select Statement as it is in ABAP and not directly in SQL. So I would need to add the OUTPUT part somewhere else, what are my options? – Juandre R. Sep 18 '14 at 07:10
  • Does ABAP allow you to print values in any format you want ? You could print a CSV file yourself instead of using the MSSQL OUTPUT statement. You should add the "abap" and "sap" tags to your question so people that know this stuff can answer. – personne3000 Sep 18 '14 at 07:42
  • ABAP allows you to print in several values yes. CSV, Text, XLS, but it all needs to be configured. Although in this case, which is a BSP Application, it is not configurable. Let's try an alternative, is it possible to display the results in HTML format when clicking the submit button? Is that something which can be coded into the existing HTML page? – Juandre R. Sep 19 '14 at 08:31
  • If the server can send the data you need in another format, and if you can add your own HTML to the page, one option is to query the data using AJAX, parse it in JavaScript and display it client-side this way. Very dirty. Waiting for sap-aware people to give clean options :-) – personne3000 Sep 19 '14 at 08:48
  • It looks like you need to add some logic in the BSP code. The BSP is like ASP, JSP, etc. – Jagger Sep 20 '14 at 17:33

0 Answers0