Quantcast
Channel: SCN : Popular Discussions - Business Server Pages (BSP)
Viewing all 1497 articles
Browse latest View live

SET language

$
0
0

Hi all

 

On an onInputProcessing event, I would like to modify the language used by my BSP page which includes OTR texts (shorts)

 

I do this

<%@page language="abap"%><html><body><% 
set LANGUAGE LANG.
%><%=SY-SUBRC%><form method="post"><h1><%=OTR(ZMPP2010/TAB_HO)%></h1>( <%=LANG%> )<input type="submit" name="onInputProcessing(EN)" value="EN" /><input type="submit" name="onInputProcessing(FR)" value="FR" /></form></body></html>

 

with this event onInputProcessing

 

CASE event_id:.  When 'EN':.    SET LANGUAGE 'E'.    navigation->set_parameter( name = 'LANG' value = 'E' ).    navigation->goto_page( 'testlang.htm' ).  When 'FR':.    SET LANGUAGE 'F'.
navigation->set_parameter( name = 'LANG' value = 'F' ).    navigation->goto_page( 'testlang.htm' ).
 ENDCASE.

 

But It doesn't work

 

J


how read serialized POST data from JQuery/AJAX call in the another page

$
0
0

hi,

 

i've a page (one.htm), which has a form with input/dropdown etc fields and make a call to second.htm using AJAX call method. I'm serializing the form data and sending along with AJAX method to second.htm. When i debug, it goes to second.html. but now i want this form data to be submitted to SAP from second.htm. So how should i get/read the data (each element value in the form) in second.htm and so that call a function module to update it to SAP.

 

waiting for your inputs, and let me know if need to provide more details..! plz refer me the blogs, articles if any in this similar exercise!

 

thanks, JB

FAVICON.ico in BSP with

$
0
0

Hi,

I built into my BSP a favicon.

  <link  rel   =  "shortcut icon"         href  =  "favicon.ico"         type  =  "image/ico">

Sometimes it is indicated

and sometimes not

Do you know why?

 

That is my Coding:

-


 

<%@page            language          =        "ABAP"%><%@extension       name              =        "HTMLB"                   prefix            =        "HTMLB"%><HTMLB:content     design            =        "DESIGN2003"                   forceEncode       =        "ENABLED"                   controlRendering  =        "SAP"><link              rel               =        "shortcut icon"                   href              =        "favicon.ico"                   type              =        "image/ico"><HTMLB:document><HTMLB:documentHead/><HTMLB:documentBody><HTMLB:form><HTMLB:button      id          =   "BU_ANM"                   onClick     =   "ONINPUTPROCESSING"                   text        =   "only a Test for favicon"/></HTMLB:form></HTMLB:documentBody></HTMLB:document></HTMLB:content>

 

Mini SAP 6.2: Executing First BSP Page

$
0
0

Hi All,

I am trying to execute the first BSP in Mini SAP 6.2. Getting the following error : Business server PAGE (BSP) error BSP exception: The URL does not contain complete Domainangabe. Even i tried to configure domain using Tcode RZ10, INSTANCE PRofile. I selected the Radio buttong Extended maintenance. THere also i am getting another error (Server p72367_BSP_00 is not active - action cannot be executed). Could any please tell me how to configure the FQDN. I already gone thro "BSP In-Depth: Fully Qualified Domain Names". But i couldnt solve the problem.

 

Thanks in advnce.

Raja T

How to display smartform through transaction code on action of button

$
0
0

Hi All,

Please let me know how can i display smartform through tcode on button action.

For e.g. I have a F.62 tcode where the smartform is attached. Now i want a button in BSP which when clicked should call tcode F.62 and display that smartform.

 

Also if i cannot use "CALL TRANSACTION" can i use "SUBMIT" and call that transaction.

 

If not how will i able to acheive that?

 

Please help as it is very urgent.

 

 

Thanks,

Rahul

"IT_SPFLI" is not an internal table "OCCURS n" specification is missing.

Documentation BSP Extension Calendar

$
0
0

I saw, that there is a BSP Extension "Calendar". Where can I find the documentation, how to use it?

 

thanks a lot, Claudia

Filter in tableView

$
0
0

Hello,

 

I am using a TableView with filter-functionality. Can i make the filter line look different so that it differs from the "normal" rows of the table? A TableViewIterator is already used.

 

Regards,

 

ALEX


GENERATE_SUBPOOL_DIR_FULL issue - also in 6.40?

$
0
0

Hi fellows,

after implementing some dynamic table creation in my MVC application I came across this GENERATE_SUBPOOL_DIR_FULL error, and found this topic in ABAP forum:

Resetting the counter for Generate Subroutine Pool I read that for the WebAS 6.40 approach removes some of theses issues, this might be one of them.

Does anybody know of similar problems that occur or occur not when using 6.40?

 

*) As the 6.40 kernel can also be used for 6.20 installations ... will upgrading the kernel affect or even solve this problem in any way? (or make the 6.40 approach possible?)

 

Thanks for reading (and answering),

Max

PMS Offline Scenario - Download Issue

$
0
0

Hi,

 

I am facing issue in the PMS offline scenario (Download).

I am executing an standard BSP application (HAP_DOCUMENT) for PMS process.

 

In that i tried PMS offline process, download the appraissal form from he BSP page.

A popup window opens without displaying anything and all of a sudden it get closed.

But as per the standard scenario whenever an appraisal form is downloaded it will be locked automatically, for me also the form get locked but it was not downloaded.

 

I don't know why that popup window getting closed automatically, as that window only shows the option of saving the appraissal form to the local desktop.

 

Kindly help me on this to get solved.........

 

Thanks in Advnace.........

 

Thanks & Regards,

Chandran S

PDF Output

$
0
0

So what am I missing?

 

<b>BSP Programming: Handling Of Non-HTML Documents</b>

/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents

 

<b>Generate file .doc or .pdf as from a text</b>

Generate file .doc or .pdf as from a text

 

<b>Page Layout</b>

<%@page language="abap" %><%@extension name="htmlb" prefix="htmlb" %><htmlb:content design="design2002" >  <htmlb:page>    <htmlb:form method       = "post"                encodingType = "multipart/form-data" >      <htmlb:radioButtonGroup id="display_type" >        <htmlb:radioButton id   = "inline"                           text = "Display Inline" />        <htmlb:radioButton id   = "html"                           text = "Display Inside HTML Page" />        <htmlb:radioButton id   = "window"                           text = "Display In New Window" />        <htmlb:radioButton id   = "convert"                           text = "Convert to PDF Inside HTML Page" />        <htmlb:radioButton id   = "convertnew"                           text = "Convert to PDF In New Window" />      </htmlb:radioButtonGroup>      <htmlb:fileUpload id          = "myUpload"                        onUpload    = "HandleUpload"                        upload_text = "Display"                        size        = "90" />      <hr>      <br>Name = <%= file_name%>      <br>MIME-Type = <%= file_mime_type%>      <br>Length = <%= file_length%>      <%  IF ( display_type = 'html' OR display_type = 'convert' ) AND  display_url IS NOT INITIAL.      %>      <iframe src="<%= display_url%>" width="100%" height="500px">      </iframe>      <%  ENDIF.  IF ( display_type = 'window' OR display_type = 'convertnew' ) AND display_url IS NOT INITIAL.      %>      <script language="Javascript">        window.open("<%= display_url%>").focus();      </script>      <%  ENDIF.      %>    </htmlb:form>  </htmlb:page></htmlb:content>

 

<b>OnInputProcessing</b>

* event handler for checking and processing user input and
* for defining navigation

DATA: radioButtonGroup TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD.
DATA: cached_response TYPE REF TO if_http_response.
DATA: response TYPE REF TO if_http_response.
DATA: guid TYPE guid_32.

fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(                       request = request                       id      = 'myUpload'                       name    = 'fileUpload' ).

file_name      = fileUpload->file_name.
file_mime_type = fileUpload->file_content_type.
file_length    = fileUpload->file_length.
file_content   = fileUpload->file_content.

radioButtonGroup ?= CL_HTMLB_MANAGER=>GET_DATA(                       request = request                       id      = 'display_type'                       name    = 'radioButtonGroup' ).

display_type = radioButtonGroup->selection.

IF display_type = 'inline' AND XSTRLEN( file_content ) > 0.  response = runtime->server->response.  response->set_data( file_content ).  response->set_header_field( name  = if_http_header_fields=>content_type                              value = file_mime_type ).  " response->set_header_field( name  = if_http_header_fields=>content_length  "                             value = file_length ).  response->delete_header_field( name = if_http_header_fields=>cache_control ).  response->delete_header_field( name = if_http_header_fields=>expires ).  response->delete_header_field( name = if_http_header_fields=>pragma ).
* signal that response is complete  navigation->response_complete( ).   RETURN.
ENDIF.

IF ( display_type = 'html' OR display_type = 'window' ) AND XSTRLEN( file_content ) > 0.  CREATE OBJECT cached_response TYPE CL_HTTP_RESPONSE EXPORTING add_c_msg = 1.  cached_response->set_data( file_content ).  cached_response->set_header_field( name  = if_http_header_fields=>content_type                                     value = file_mime_type ).  cached_response->set_status( code = 200 reason = 'OK' ).  cached_response->server_cache_expire_rel( expires_rel = 180 ).  CALL FUNCTION 'GUID_CREATE'    IMPORTING      ev_guid_32 = guid.  CONCATENATE runtime->application_url '/' guid INTO display_url.  cl_http_server=>server_cache_upload( url      = display_url                                       response = cached_response ).  RETURN.

ENDIF.

IF ( display_type = 'convert' OR display_type = 'convertnew' ) AND XSTRLEN( file_content  ) > 0.  CREATE OBJECT cached_response TYPE CL_HTTP_RESPONSE EXPORTING add_c_msg = 1.  cached_response->set_data( file_content ).  cached_response->set_header_field( name  = if_http_header_fields=>content_type                                     value = 'application/pdf' ).  cached_response->set_status( code = 200 reason = 'OK' ).  cached_response->server_cache_expire_rel( expires_rel = 180 ).  CALL FUNCTION 'GUID_CREATE'    IMPORTING      ev_guid_32 = guid.  CONCATENATE runtime->application_url '/' guid '.pdf' INTO display_url.  cl_http_server=>server_cache_upload( url      = display_url                                       response = cached_response ).  RETURN.

ENDIF.

 

Again so what am I missing? If I select the Convert to PDF with a text file and open in a new window I get my page then I do a save as and I save it as a .PDF but then Adobe can't open it. So I must be missing something easy...

The case of the reappearing cookies...

$
0
0

I've a page with some flow logic in the OnInitialization event.  At the end of the flow logic I have

        request->get_cookies( CHANGING cookies = lt_cookies ).        request->delete_cookie( 'Mycookie' ).        request->get_cookies( CHANGING cookies = lt_cookies ).        CALL METHOD navigation->response_complete.

I test the page from SE80.  Through debug, I can see that lt_cookies (after the second get_cookies) no longer has the cookie "Mycookie".

 

I then run the test again.  At the start of my flow logic, I've got

request->get_cookies( CHANGING cookies = lt_cookies ).

In debug, I look at lt_cookies - and "Mycookie" is listed again!

 

The whole process is

IF cookie has a value. " Second time page is called  Do stuff with the cookie value.  Delete cookie.
ELSE. " First time page is called  Do some other stuff.  Set the cookie.
ENDIF.

  So I really do need to delete it.

 

matt

HCM_LEARNING customization

$
0
0

Hi BSP experts,

 

In HCM_Learning  BSP standard application ,a XXXX.htm page is there,now i made a z page i.e. zXXXX.htm.

My question is that if i made changes in the z page then how can this page be used the Standard Application.?? How can the changes in zpage reflect in standard Application??

 

Regards and Thanks in advance

Sachin Sharma

CX_SY_RANGE_OUT_OF_BOUNDS dump in BSP F4 help

$
0
0

Hi ,

 

I am following a blog for creating a standard F4 help for MATNR in

my BSP application.

 

The standard search help has a custom elementary search help

for which the following dump is coming :

 

The following error text was processed in the system:

An exception with the type CX_SY_RANGE_OUT_OF_BOUNDS occurred, but was neither handled locally, nor declared in a RAISING clause

Exception Class CX_SY_RANGE_OUT_OF_BOUNDS

Error Name DATA_OFFSET_LENGTH_TOO_LARGE

Program ZCL_M_INPUT_HELP==============CP

Include ZCL_M_INPUT_HELP==============CM002

ABAP Class ZCL_M_INPUT_HELP

Method GET_HELPVALUES_BAPI

Line 221 

Long text The sub area access (Offset = 248, Länge = &LEN GTH&) on a data object of size 255, lies outwith the valid boundaries.

 

I have the following code in my model class zcl_m_input_help in method

get_helpvalues_bapi where dump is coming:

 

****For each component (field) in the table -Output the data

    LOOP AT struct ASSIGNING  LEFT DELETING LEADING '0'.

      ENDIF.

    ENDLOOP.

  ENDLOOP.

 

I would be really thankful if someone could help.

 

Server not 302 Redirecting to Mangled URL when POST form to BSP via AJAX

$
0
0

Hi all,

 

I am attempting to POST a form to a BSP, the clean URL, not the mangled session url.  Normally, a request to that clean URL would return a page that says "Your request is being processed" with a 302 redirect to the mangled URL, but in this one case, it is not.  I am getting an immediate 200 success code, so my final result is that page that says "Your request is being processed."  Submitting the same form via a GET AJAX request redirects with no problem.  It is only POST and only when coming through an AJAX request.

 

I know that I could avoid the redirect altogether by just submitting my AJAX request directly to the mangled URL, but that is not an option for me, since jQuery does not support parentheses in form URL's.

 

Can anyone help?  Is there some configuration setting that needs to be changed?

 

Thanks for any advice,

-Chris


BC-BSP / HTTP-Handler / Themes and ALFS not working anymore

$
0
0

Hi experts,

 

we have a BSP Application which uses the ALFS Editor for a quick and dirty theme customization

Our Basis Support patched the Development Server from Support Package 701 -> 0008 to 0011.

 

Now the ALFS Handler is not working anymore.

 

I'm not sure where the error is and how i have to solve it.

I found two things that seem to be not ok.

 

1) Missing ~alfs~ in HTTP_HANDLER / PATH_INFO

 

When debugging the CL_HTTP_EXT_ALFS, the handler exits when checking the path_info.

 


IF server->request->get_header_field( if_http_header_fields_sap=>path_info ) CS '~alfs~'. "#EC NOTEXT

 

The PATH_INFO only contains a  String / HEX Value, but not the string ~alfs~, so the handler exits without converting the stylesheets.

 

In my bsp side i use the themeroot of htmlb:content, which worked fine until the patch.

 

<htmlb:content design       = "design2003"
           themeRoot    = "/sap/public/bc/ur/design2002/themes/sap_tradeshow/~alfs~1000102a5a5a54c50508484842B23263D3135"
           controlRendering = "SAP" >

 

2) Different Upper/Lower-Case in mime repository path

 

When looking at the HTML-source of the BSP I'm wondering why the mimerepository path is a little different, also some characters are url-encoded, e.g. spaces, probably this is a result of the not working HTTP-Handler, but I'm not quiet sure.

 

Working BSP on production system:

 

The title is with normal "spaces", the themeRoot path is /design2002/

 

<html><head><title>C1 BSP Infosystem</title>

      <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" ><meta http-equiv="imagetoolbar" content="no"><script type="text/javascript" language="JavaScript" src="/sap/public/bsp/sap/htmlb/events.js?0008"></script><script type="text/javascript" language="JavaScript" src="/sap/public/bsp/sap/htmlb/event_dictionary.js?0008"></script><link id="urstyle" rel="stylesheet" type="text/css"

href="/sap/public/bc/ur/design2002/themes/~alfs~1000102a5a5a54c50508484842B23263D3135/ur/ur_ie6.css?6.0.17.0.0">

 

Incorrect BSP on development system

 

<html><head><title>C1&#x20;BSP&#x20;Infosystem</title>

      <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" ><meta http-equiv="imagetoolbar" content="no"><script type="text/javascript" language="JavaScript" src="/sap/public/bsp/sap/htmlb/events.js?0008"></script><script type="text/javascript" language="JavaScript" src="/sap/public/bsp/sap/htmlb/event_dictionary.js?0008"></script><link id="urstyle" rel="stylesheet" type="text/css" href="/sap/public/bc/ur/Design2002/themes/sap_tradeshow/ur/ur_ie6.css?6.0.17.0.0">

 

Has someone faced the same issue?

I looked through the OSS-notes regarding the BC-BSP components but found nothing that would explain the issue.

 

Best regards

Volker Ritzau

Generate Download Dialog from Ajax Input on BSP

$
0
0

Hello All,

 

I'm having some unusual issues with my BSP page that I can't seem to work around. Any input would be greatly appreciated. I'll give as much detail as possible, because the issue only exists at a certain point.

 

Overview: I'm creating a simple bsp with input fields that once filled the user hits a 'submit' button and the field entries are sent back to SAP via ajax in an simple 'POST'. The fields are read into SAP and a report is generated and converted to xstring. This xstring is then sent back to the BSP using the cl_bsp_utility=>download. Herein lies the problem. The webpage responds to this as a 'message'. If I test this functionality on initialization it is fine, but as a response it doesn't work. Very odd.

 

Here is my html: (Don't critique the hard-coded values, I'm not worried about that yet).

<!DOCTYPE html>

<html>

     <head>

         <meta charset="utf-8" />

         <meta name="viewport" content="width=device-width, initial-scale=1" />

         <title>

         </title>

         <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css" />

         <link rel="stylesheet" href="usl_cc_01.css" />

         <style>

             /* App custom styles */

         </style>

         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">

         </script>

         <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js">

         </script>

         <script src="usl_cc_01.js"></script>

         <script src="usl_cc_02.js"></script>

     </head>

     <body>

         <!-- Home -->

         <div data-role="page" id="page1">

             <div data-theme="b" data-role="header">

                 <h3>

                     Cost Center Reporting

                 </h3>

             </div>

             <form id="target">

             <div data-role="content">

                 <div data-role="fieldcontain">

                         <label for="userId">

                             Name

                         </label>

                         <input name="userId" id="userId" placeholder="" value="" type="text" class="required" />

                 </div>

                 <div data-role="fieldcontain">

                         <label for="password">

                             Password

                         </label>

                         <input name="password" id="password" placeholder="" value="" type="password" class="required"/>

                 </div>

                 <div data-role="fieldcontain">

                         <label for="reportType" class="select" data-mini="true">Report Type</label>

                         <select name="reportType" id="reportType">

                           <option selected="selected">Actual</option>

                             <option>Plan/Forecast</option>

                         </select>

                 </div>

                 <div data-role="fieldcontain">

                         <label for="period">

                             Period

                         </label>

                         <select name="period" id="period">

                           <option selected="selected">001</option>

                             <option>002</option>

                             <option>003</option>

                             <option>004</option>

                             <option>005</option>

                             <option>006</option>

                             <option>007</option>

                             <option>008</option>

                             <option>009</option>

                             <option>010</option>

                             <option>011</option>

                             <option>012</option>

                             <option>013</option>

                         </select>

                 </div>

                 <div data-role="fieldcontain">

                         <label for="year">

                             Year

                         </label>

                         <select name="year" id="year">

                           <option selected="selected">2010</option>

                             <option>2011</option>

                             <option>2012</option>

                             <option>2013</option>

                             <option>2014</option>

                             <option>2015</option>

                             <option>2016</option>

                             <option>2017</option>

                             <option>2018</option>

                             <option>2019</option>

                             <option>2020</option>

                         </select>

                 </div>

                 <div data-role="fieldcontain">

                         <label for="version">

                             Version

                         </label>

                         <select name="version" id="version">

                             <option>PF - USL Plan Version Final</option>

                             <option>R1 - USL Rolling Forecast April - December</option>

                             <option>R2 - USL Rolling Forecast July - December</option>

                             <option>R3 - USL Rolling Forecast October - December</option>

                         </select>

                 </div>

                 <input id="submitToSap" type="button" data-icon="search" data-iconpos="left" value="Submit to SAP" />

                 <input id="emailMePass" type="button" data-icon="info" data-iconpos="left" value="Email Password" />

             </div>

             </form>

         </div>

         <script>

 

         </script>

     </body>

</html>

My simple js is just this:

// JavaScript Document

$(document).ready(function() {

    $('#submitToSap').click(function() {

        // Compile data to send to SAP server

        var cc_data_string =

                      '&purpose=view' +

             '&userId=' + $("input#userId").val() +

             '&password=' + $("input#password").val() +

             '&reportType=' + $("select#reportType").val() +

             '&period=' + $("select#period").val() +

             '&year=' + $("select#year").val() +

             '&version=' + $("select#version").val();

          

                               $.ajax({

                                type: "POST",

                          url: "usl_cc_01_control.do",

                    data: cc_data_string,

                                            success: function(ret){

                                                            alert(ret);

                        }

          });

           });

});


My Controller has a simple DO_REQUEST.

DATA: l_view TYPE REF TO if_bsp_page,

           lt_fields TYPE tihttpnvp.

 

   request->get_form_fields( CHANGING fields = lt_fields ).

 

   IF lt_fields IS INITIAL.

     l_view = create_view( view_name = 'usl_cc_01.html').

     call_view( l_view ).

   ELSE.

     process_input( lt_fields ).

   ENDIF.

 

And the Process_input:

DATA: l_view TYPE REF TO if_bsp_page,

         ls_field  TYPE ihttpnvp.

 

* Refresh model if necessary

   IF m_cc_model IS NOT BOUND.

     do_init( ).

   ENDIF.

 

   READ TABLE lt_fields INTO ls_field WITH KEY name = 'purpose'.

"Here is where I do my simple ABAP logic to generate a report, send it to the spooler, convert to pdf and then convert to xstring.

"My xstring is outputx

     CONCATENATE cl_abap_char_utilities=>byte_order_mark_little outputx INTO outputx IN BYTE MODE.

      DATA: app_type TYPE string VALUE 'APPLICATION/PDF;charset=utf-16le'.

        CALL METHOD cl_bsp_utility=>download

            EXPORTING

              object_s            = outputx

              content_type        = app_type

              content_disposition = 'attachment;filename=your_cc.pdf'

              response            = server->response

              navigation          = navigation.


However...the webpage responds with a dialog that says 'message from webpage'. ???

I've created a test webpage that does the download dialog from the start and it works fine and generates the pdf, but as a response to an input it responds with 'message from webpage' and not the dialogue. Any help would be so greatly appreciated, I'm spinning my wheels here. All the 'pieces' are fairly simple, but something is amiss as a whole.

 

Thanks for any help,

Greg

 

PS. I'm still working on it, if I find the solution I'll make sure to post it.


EP integration: How to prune away authentication screen to WAS?

$
0
0

Hallo,

I'm trying to integrate my BSP application in EP 6.0. I created iView with my BSP from iView template for BSP. But when accessing this iView, there appears IE window which requests authentication to SAP WAS. Do anybody know how to prune away this authentication screen?

Best regards,

Josef Motl

Open new BSP page

$
0
0

Hi all,

i am in ABAP report and i want to open new BSP page from the ABAP report

becuse some time it is open the BSP page in the same session of SAP system.

and also how i can maximize it automatically in the same way of (F11 key).

 

is there any documents that describe and explain the signature of this method.

 

CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE

EXPORTING

       DOCUMENT      = 'XXXXXX .......'

  •      APPLICATION            = 'X'

  •      PARAMETER              =

  •      DEFAULT_DIRECTORY      =

  •      MAXIMIZED              =

  •      MINIMIZED              =

  •      SYNCHRONOUS            =

       OPERATION              = 'OPEN'

EXCEPTIONS

        CNTL_ERROR             = 1.

Need to replicate short php code in BSP

$
0
0

HI All,

 

First off I know nothing about BSP, just thought I would get that one out the way.

 

With that said I have tried to follow this wiki :- http://wiki.sdn.sap.com/wiki/display/BSP/Handling+Binary+Data with some success.

 

Now what I am trying to achieve is simply reproduce this small piece of php code :-

 

<?php
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"my-data.csv\"");
$data=stripcslashes($_REQUEST['csv_text']);
echo $data; 
?>

 

in a BSP application.

 

I have tried the following in the layout tab and in the Event OnInitialization:-

 

<%   IF request->get_form_field( 'csv_text' ) IS NOT INITIAL.      response->set_header_field( name = 'Content-Type'        value = 'application/octetstream' ).      response->set_header_field( name = 'Content-Disposition' value = 'attachment; filename=csv_text.csv' ).      response->set_header_field( name = 'Connection'          value = 'close' ).       DATA: file_content TYPE string. file_content = request->get_form_field( 'csv_text' ).      response->set_header_field( name = 'Expires'       value = '0' ).      response->set_header_field( name = 'Pragma'        value = 'no-cache' ).      response->set_header_field( name = 'Cache-Control' value = 'max-age=0' ).       REPLACE ALL OCCURRENCES OF ' ' IN file_content WITH ''.      response->set_cdata( file_content ).      RETURN.   ENDIF.
%>

 

The only problem is that I get the desired download dialog box but I am directed to a blank BSP screen with "Your request is being processed" message instead of simply leaving me on my current page and showing a download dialog like with PHP.

 

I am POSTING some CSV data from a table page in SAP BW to this BSP application that I want to download as a CSV text file.

I can't simply use the export to CSV function of SAP BW because of the modifications I have made in javascript to change the tables.

 

I am utilising this piece http://www.kunalbabre.com/projects/table2CSV.php  of jQuery utility to get what I require from the client side.  Option 3.1 is what I am trying to achieve.

 

Any help please?

 

Thanks

Craig

Viewing all 1497 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>