.js file in BSP
Hello Everyone,
I am developing BSP application using MVC. For client side validation I am using JavaScript. Currently I am including my JavaScript code in the view itself which is working fine.But I tried to separate the javascript code by using the traditional .js method.
My question is where to put that .js file. I tried by importing it as a MIME object and then calling as
<script language="javascript" src = "myjsfile.js">
</script>.
But I guess its not finding the same. Even I tried to give the relative path as src="../../sap/myappfolder/myjsfile.js" but still its giving the javascript error in the browser.
Has anyone implemented the same?
Thanks in advance.
Thanks and Regards
Rajeev Patkie
We are using a "Page with Flow Logic" to generate our JavaScript files. So you can use language independent text
( for example to build a error messages alert(<%= otr(/ZZABC/INVALID) %>"); )
or build your validation code using the data dictionary.
Page property Mime Type is set to: text/javascript
And the page name is validation.js
We include the JavaScript "file" via:
<script type="text/javascript" src="validation.js"></script>
This also works in the view of MVC.
Regards,
Thilo
Similar Messages
-
Download Internal Table into a Text File in BSP?
I have an internal table which i need to download into my local pc. I know i can not use FM gui_download. Could some one please post code on how to download the internal table into a text file in BSP. Also i am not sure if i can use save dialog FM. Also need suggestion on which FM to use for save dialog which tells where to save the file.
Any help will be appreciated.
Thanks
NahmanThis might be a good starting point.
<a href="/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table">/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table</a> -
Hi Experts
here by i am developing 1 bsp application.
the requirement is i have a text file in c Drive . here by i have to uplaod to BSP .
data from text file has to come to bsp in the form of internal table
when i try to use the gui_upload function to upload a text file into bsp , its thru dump.
kindly help. how to uplaod a data into bsp page .Hi Irfan Rehman,
This topic is already raised by the many people in SDN. Please look at these following threads,
It should be useful!
1. How to upload file with BSP?
2. Excel File Upload Problem
3. File Upload
4. Uploading multiple documents using file upload option
Hope it helps! Please do search in SDN before posting the question. Thanks!
Regards,
Maheswaran -
Uploading a file in bsp application
i want to upload a file in abap.
i am using gui_upload function.
DATA: BEGIN OF pic_tab OCCURS 10,
data TYPE sdokcntbin,
END OF pic_tab.
DATA: aux_string TYPE string.
DATA: aux_length TYPE i.
TABLES: zpro_pa,
zbsp_pkgklg.
PARAMETERS: p_packid LIKE zpro_pa-package_id,
p_file(256) DEFAULT 'c:\test.jpg'.
START-OF-SELECTION.
aux_string = p_file.
DELETE FROM zbsp_pkgklg WHERE type = 'PACKAGE'
AND identifier = p_packid.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = aux_string
filetype = 'BIN'
IMPORTING
filelength = aux_length
TABLES
data_tab = pic_tab
separator_not_allowed = 10
zbsp_pkgklg-type = 'PACKAGE'.
zbsp_pkgklg-identifier = p_packid.
LOOP AT pic_tab.
IF aux_length > 1022.
zbsp_pkgklg-length = 1022.
aux_length = aux_length - 1022.
ELSE.
zbsp_pkgklg-length = aux_length.
ENDIF.
zbsp_pkgklg-line = sy-tabix.
zbsp_pkgklg-data = pic_tab-data." here not able tocopy
INSERT zbsp_pkgklg.
IF sy-subrc <> 0.
MESSAGE a001.
ENDIF.
ENDLOOP.
am not able to copyfrom pic_tb field data into zbsp_pkgklgfield data.
can anyone tell whats the problem?.You'll find about a million things in this forum alone on this topic.
<a href="/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help">BSP Trouble Shooting: Getting Help</a>
I would suggest you do a search not only in this forum for "file upload" but also take a look at the weblogs from Brian McKellar and Thomas Jung. Both have many examples of this topic. -
Download internal table value to local file from BSP
Dear all
I ve converted a word file to XML and doing some modifications with the help of ABAP program .After that am replacing some of the fields by passing values.after that i am getting the same file to the local system.All these i am able to do in our SAP GUI.
But while trying in BSP am uanle to download it to the local file.
I am having file which i have to download in the following formats.
1.XSTRING
2.ITAB
3.Rawstring ITAB
Now am trying this with cl_bsp_utility->download class.....please anybody help how to use this in my application.
regards
meiHi,
You can't directly access the file system of the end user from a BSP.
Either you create a link on your web page, either you set the mime type of the response with runtime->server->response->set_header_field( name = 'Content-Type' value = 'some mime type' ) in order to let the end user save the file.
Eddy -
Download File from BSP to presentation server.
Hi all,
We have a requirement to Download and Upload a file in Standard BSP application HRECM_BDG_MAINT.
Flow of the logic is :
1. On click on Download button. A Save file dialog should come and then user will select the path for saving the file. Then the internal table sholud be save in excel on the presentation server.
2. User will modify the excel file.
3 on click of upload button again the open dialog should come and then user will select the excel file from the presentation server and then file will be uploaded into the BSP application.
Note : We are very much clear with the functionality. Over main concern is to get the file dialog popup on the BSP application.
Changes in the layout (Download & Upload Button) has been created.
Actually HRECM_BDG_MAINT call another BSP application HR_ECM_BDG_SRV02.
Controller class of of page budget_details.bsp (HR_ECM_BDG_SRV02) is CL_HRECM00_BSP_BDG_DETAILS.
All the button displayed in this BSP page are created at runtime in class (CL_HRECM00_BSP_BDG_DETAILS) in method DO_REQUEST. We have used enhancement spot and added two more buttons (Download and Upload).
Now our main problem is to get file dialog popup on the BSP screen when we click on that button.
Kindly help
Ankit GuptaHello
I have a BSP that shows all the client data and generate a file when a boton is push.
What I need to know is; how can i made that the system generate a file for each client without having the internet explorer pup-up for download each time, furthermore, I want that these files to be located at the local unit C:\.
The code i have is as follow:
DATA: fichero TYPE string.
CONCATENATE 'F' vnomfich '.xls' INTO vnomfich.
some Browsers have caching problems when loading Excel format
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 ).
start Excel viewer either in the Browser or as a separate window
response->set_header_field( name = if_http_header_fields=>content_type
value = 'application/vnd.ms-excel' ).
CONCATENATE ' attachment; filename= ' vnomfich INTO fichero.
response->set_header_field( name = 'Content-Disposition'
value = fichero ).
finally display Excel format in Browser
response->set_cdata( data = l_output ).
do not process Layout, response has been rendered
navigation->response_complete( ). -
Formating an excel file by BSP Download
I have made a BSP application which can dowload file into an excel file.But now i have a requirement in which i have to format the excel file with colour and cell width.I have to colour the column header of the excel file with some colours like blue,red etc.
Please suggest me how we can achieve this?
Thanks and regards,
Manish KumarHi Manish,
This can be achieved using javascirpts and active x objects. Check this wiki,
http://wiki.sdn.sap.com/wiki/display/CRM/DownloaddatafromwebuitoExcelandPPT
Regards,
Arun -
How to accept XML file in BSP .
Hi experts,
We are implementing PAYMENT GATEWAY application in BSP,
The requirement is like we will divert our user on BANK for the payment,
at the end of payment procedure the bank will diver again that user on our site,
The moment we get user back on our site we have to give confirmation to the bank by sending some parameters,
till now everything is going fine,
But Now bank will send 1 XML file to us having some parameters for the final confirmation,
so my problem is that how to accept that page from bank and read that parameters.
is there any provision in BSP to Accept XML file from some third party on internet,
We are suppose to provide a url to bank for this final confimation,
so what this url will be if i have to accept xml file on this,
will a normal BSP url will do or we have to go for some other method .
XML file structure send by BANK.
<?xml version='1.0' encoding='UTF-8'?>
<Verify PER='451sdf' TAL='400' REF=ABCD123412341234
STATUS='SUCCESS'>
</Verify>Hi Paresh,
many thousands of thankyou's for awarding me all those wonderful points. I can't begin to tell you what a magnanimous and generous benefactor you are. I hope you don't mind if I make a copy of those valuable points and frame them up on my wall so that I can forever remember their significance and the wonderful being that bequested them upon my unworthy self.
Sheesh!! Okay - sarcasm itch has been successfully scratched.
Now onto your questions.
A HTTP request handler is a class that "handles" HTTP requests. In other words it is the piece of ABAP code that gets lauched when the HTTP request comes into the ICF from the HTTP client. The online help has guidance on how to build your own at http://help.sap.com/saphelp_nw04/helpdata/en/72/c730dac06511d4ad310000e83539c3/frameset.htm and there are several blogs in SDN on this as well.
I mentioned you could also do it using the BSP runtime as well if you wanted. This just means building a BSP application to receive the HTTP request from your bank, extract the XML payload, and then build a XML response. The code I provided on my previous response shows how to access the HTTP request payload contents.
If you do not have anyone in your organisation who knows how to do this then I suggest you source a suitably experienced programmer to do the development for you.
I have tested the link I sent you and it works fine for me. If you are still having trouble search for "Simple Transformation" in the SAP Online Help.
Cheers
Graham Robbo -
Upload javascript / HTML / CSS/ files to BSP environment
HI,
1. Would there be an easy way to upload (in mass) Javascript files to a BSP environment?
Right now, we have to do it one by one (right click BSP application > create > MIME object > import).
but we will manage a web2.0 AJAX application in this way, so uploading one by one is not an option
2. once uploaded, would there be a way to edit and maintain those files in an easy way?
Right now, we can only edit in notepat, right clicking the file and then "change"
The goal is that we could easily change it in another tool
thanks in advance!
PieterHi Pieter,
you can upload multiple MIME objects by right-clicking on the MIMES filder and selecting "Import MIME Objects".
Many different ways to do editing. It sounds to me like the best way for you is to use the [WebDAV|http://en.wikipedia.org/wiki/Webdav] protocol to expose the BSP application objects as a file system and then you can edit then with whatever tool you want.
[http://help.sap.com/saphelp_nw04/helpdata/en/46/bb184dab4811d4968100a0c94260a5/frameset.htm]
Cheers
Graham Robbo -
Hi Marc,
I am following the July version of how-to. When generating the BSP page, I am told checkbrowser.htm and js.htm are not available. When I create a checkbrowser.htm and point the include to js3.htm, which is one of the page fragment available, there are a few other errors coming out. What am I missing?Do you already know if the flat file upload is possible from a multi planning area? Because I get the error message that my multi planning area does not exist when executing the function.
Thnx. -
Transport data from Javascript file to BSP application
Hi,
How can we transport data from Javascript file that is stored in MIME repository to the BSP application that uses this Javascript?
To elaborate :
I have a BSP application which calls few functions from a Javascript file that is stored in the MIME repository. Now, i need to pass one of the values that is obtained dynamically in the Javascript function to the BSP application inorder to store it in DB.. How can I do this?
Thanks,
VasukiHi,
you must only identify in which variable the javascript function stores the values. So you can enrich
your bsp application with such a function. Then you must transfer the value to a hidden input field.
This field content can be requested via request->get_form_field( 'name_of_the_field' ).
On the other side, check out, if ther is a getter function in this library.
Use firwefox with firbug plugin an set breakpoint in the javascript function to get an overview about the dom modcel.
Best regards, Stefan -
.css file in BSP Application
Hi,
Where can i find the .css file in a BSP application ?
kindly help!
Regards,
Bharath Mohan B.Hi,
Referr to the below link...
This should help you :
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/4e/7feef553415e4fb357e80f7a6223b1/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/4e/7feef553415e4fb357e80f7a6223b1/frameset.htm</a>
<i>Do reward each useful answer..!</i>
Thanks,
Tatvagna. -
Hi,
My requirement is we have to provide one hyperlink and when user click on that one local file should open. The Hyper link contain the path of local file, I Tried with the following option, its working fine in HTML code but not in BSP.
<a href="C:\My File.PDF">here</a>
Any Suggestion.
ThanksHi Ricardo,
Thanks for the quick response, but my requirement is not downloading and uploading files, my requirement is ' I Have to provide one hyperlink in BSP Page, and when user click on this link one local file should open. For exa. try to save this code ( mention in Sub Line ) in text file and save it as HTML Extention.
<a href="C:\My Filel.PDF">Open my File</a> "
when you execute this file as a result on the web page you will get text 'Open my File' and when you click on there than a file which is stored in location C:\My File.PDF will open, same thing I would like to do in BSP.
Thanks and Regards
Ravi -
Download File from BSP-Application
Hello !
i hope i can get some help for my problem.
from my BSP-Application i want to download an internal table to p:\eigenedateien\bv.txt (always the same filename)
the internal table ist type table of string.
i read that gui_download doesn't work in my BSP
so i went through this weblog 756
but it is really hard.
i put some code from the weblog in my application:
concatenate 'attachment; filename='
w_para-pwert = p:\eigenedatieen\bv.txt
w_para-pwert into dl_pathfile.
Download der Datei
Create the cached response object that we will insert our content into
dl_xstring = 'Test'. "nur zum testen
CREATE OBJECT CACHED_RESPONSE TYPE CL_HTTP_RESPONSE
EXPORTING ADD_C_MSG = 1.
set the data and the headers
CACHED_RESPONSE->SET_DATA( DL_XSTRING ).
CACHED_RESPONSE->SET_HEADER_FIELD( NAME =
IF_HTTP_HEADER_FIELDS=>CONTENT_TYPE
VALUE = 'text/html' ).
Set the filename into the response header
CACHED_RESPONSE->SET_HEADER_FIELD( NAME = 'Content-Disposition'
VALUE = DL_PATHFILE ).
Set the Response Status
CACHED_RESPONSE->SET_STATUS( CODE = 200 REASON = 'OK' ).
Set the Cache Timeout - 60 seconds - we only need this in the cache
CACHED_RESPONSE->SERVER_CACHE_EXPIRE_REL( EXPIRES_REL = 60 ).
Create a unique URL for the object
CALL FUNCTION 'GUID_CREATE'
IMPORTING
EV_GUID_32 = GUID.
CONCATENATE RUNTIME->APPLICATION_URL '/' GUID INTO URL.
Cache the URL
CL_HTTP_SERVER=>SERVER_CACHE_UPLOAD( URL = URL
RESPONSE = CACHED_RESPONSE ).
Ende Download
now it should be cached.
but hot can i start the download to p:\eigenedateien... now?
thanks very much for your help
HelmutHi,
Could you try adding at the end:
navigation->response_complete( ).
and/or
data: guid type guid_32,
display_url TYPE string.
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 ).
Best regards,
Guillaume
Message was edited by: Guillaume Garcia -
Hi everybody.
I have a question...if we upload file by using htmlb:fileupload..how can I put a default filename? how?
and is possibile hide the input field?
Thanks...
AndreaHi,
Again, automatic upload is not possible in HTML(B).
For security reason, file upload can NOT be set automatically within the command. This is a restriction of the web browser itself.
If you want to persist, have a look at things like
http://www.motobit.com/tips/detpg_uploadvbsie/
There are downsides:
it works with ASP and Activex only and it's not secure.
See also things like
http://www.iopus.com/imacros/demo/v4/file-upload.htm
Re: To access a table in quality from Dev
Re: APO Cutover - Check lists / Best practices;�
Eddy
Discover the new S(D)N search plugin for Internet Explorer 7 AND Firefox 2 in this <a href="/people/eddy.declercq/blog/2006/11/13/the-beloved-in-sweet-harmony log</a>
Maybe you are looking for
-
How do I put audio memos from an ipad onto icloud?
How do I put audio memos from an ipad onto icloud?
-
Problem with BAPI_DOCUEMENT_CHECKOUTVIEW2 while caliing using JCO
Hi DMS Gurus, The above FM is successfully executing and creating a local copy in temp folder of where the FM running using SAP GUI. But when i call using jco,i am getting some problems. 1. If i execute the FM with default values for http dest and ft
-
B1IF Memory consumption and SQL Release
Hi All, the problem i have at the moment is that SQL does not seem to release any memory of B1IF Transactional/SQL Query related usage. Our 1 client is set on 40gb ram, 28gb of that is used by SQL alone of which about 16 is SAP B1 Relating and the r
-
I want to convert date from Microsoft Access to Oracle.
I want to convert date from Microsoft Access to Oracle. My Oracel date format is 21-Jul-2004 02:24:09 AM I use sqlldr in Oracle 9i Database and I write control file load data infile 'test.txt' into table test fields terminated by "," optionally enclo
-
Problems after re-installing Windows on W520
Hi I'm new to this forum, quite weird as I have been using this W520 for 3 years now... I've recently re-installed Windows 7 64bit on my W520 and having some small problems. 1. I can't have the mute-mic hotkey to work as the mute hotkey (no light) an