Upload File thru BSP
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
Similar Messages
-
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> -
Problem with: Upload file thru Web access.
We have configure iFS 1.1 on AIX 4.3. Everything is running fine like ifsstart, ifsmgr. Its showing me all protocols and agents running.
I am able to access iFS through web access program and its accepting login and password. After login in to iFS server when we try to upload any file using Brower option its gives us following error.
Request URI:/ifslogin/jsps/upload2.jsp
Exception:
java.lang.NoClassDefFoundError: java/sql/Blob
at oracle.jdbc.driver.OracleStatement.get_blob_value(Compiled Code)
at oracle.jdbc.driver.OracleStatement.getBLOBValue(Compiled Code)
at oracle.jdbc.driver.OracleStatement.getObjectValue(
Can anybody guide us. We are not having JAVA knowledge.
Thanks
DilipHi,
create an attribute(say ca_fileupload) of type XSTRING under context and bind that attribute with the data property.
For binding the attribute just Click on the element file_up , there you can see data property,click on that and you can see all the nodes and attributes you have created and there click on the attribute(ca_fileupload). -
Upload Files thru Internal ITS of SRM
Hello Gurus,
I need your help, please.
I need to upload a file from a webpage to SAP and then process the information.
I work with SRM 4.0 with ITS Internal.
The page has to be done in SAP. I tried the FM GUI_UPLOAD, but i receive a error.
Is any way to do this?
Thanks in advanced, for your help.
Best Regards.
PauloHello Paulo,
unfortuanatelly I do not know of any other examples, belonging to the SAP_BASIS component
(which is contained in every R/3).
There are two other examples in service bbpstart and bwsp, but I don't know, if you have these
services in your R/3, because they are belonging to another component (bbpstart, I think to srm).
In it00 click on "continue", then on "upload/download", it is template it00/99/sapmitst1_2500.html,
the related abap coding is in the PAI of dynpro 2500 of program sapmitst1.
This is all true, if you are not using the webgui service, but an own IAc service.
If you use the webgui service, then it is better to use function module gui_upload.
The description of the makro mime-upload you find in the sap help library under
http://help.sap.com/saphelp_nw04/helpdata/en/54/4d9993c6592941a407313a6763575c/frameset.htm
Best regards,
Ralf -
Reupload file/change uploaded file
Hi Friends,
I need requirement like to reupload/change the already uploaded file in BSP Application.
A Brief Note:
I got an ITAB(STD),on which through Iterator , I am uploading the file in The application server(The actual path will be stored in one of the database table field<b>(STUD).</b> Presently I uploaded one file for each row of Itab,and made it as display_url, to display the file.It is working fine. But when I want to change the already uploaded file/overwrite the file path & upload again through change file button, it is not working at all.
<b>The code I used as follows</b>:
<u>For file Reupload:</u>
DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD.
fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(
request = request
id = 'STUD'
name = 'fileUpload' ).
if fileUpload->file_name is not initial.
file_name = fileUpload->file_name.
file_mime_type = fileUpload->file_content_type.
file_length = fileUpload->file_length.
file_content = fileUpload->file_content.
DATA: fname type string.
Enter the path to be stored in the server here....
Data : filepath type string,
t1 type string.
filepath = file_name .
while filepath CA '\'.
split filepath at '\' into t1 filepath.
endwhile.
Enter the path to be stored in the server here....
*This location is not shared,
fname = '\default_host\sap\bc\bsp\sap\tmp\' .
concatenate fname filepath into fname.
close dataset path.
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER file_content TO FNAME.
CLOSE DATASET FNAME.
You can generate the URL..display_url shows you URL
REPLACE ALL OCCURRENCES OF '/' IN fname WITH '\'.
concatenate '
by-sap-Bass.com' fname into display_url.
IF <row1> IS ASSIGNED.
<row1>-STUD = fname.
MODIFY STD from <row1>.
endif.
endif.
<u><b>The Iterator code:</b></u>
when 'tv1'.
DATA: tv TYPE REF TO cl_htmlb_tableview.
tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'tv1' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
tv_data = tv->data.
IF tv_data->prevselectedrowindex IS NOT INITIAL.
FIELD-SYMBOLS: <row1> type LINE OF ITABTYPE .
READ TABLE ITAB INDEX tv_data->prevselectedrowindex
ASSIGNING <row1>.
DATA value TYPE string.
if <row1> is assigned.
value = tv_data->get_cell_id( row_index =
tv_data->prevselectedrowindex
column_index = '8' ).
inputfield ?= cl_htmlb_manager=>get_data(
request = request
name = 'inputfield'
id = value ).
<row1>-STUD = inputfield->value.
method
IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
WHEN 'STUD'.
IF p_edit_mode IS INITIAL.
DATA: STUD TYPE STRING.
STUD = m_row_ref->STUD.
p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(
id = p_cell_id
src = '@IT@'
tooltip = 'Please Press this Link for Detail Description'
onClick ='Event1' ).
ELSE.
p_replacement_bee = CL_HTMLB_BUTTON=>FACTORY(
id = p_cell_id
text = 'Click to change File'
tooltip = 'Press this to change the linked file'
onClick = 'Event1' ).
ENDIF.
why this is not working for me?.I look foward your suggestions in this regard.
Regards
CSM ReddyCheck out if this sample application created by me would be helpful:
[code]*----
*ZRK_FILE_TEST/CHANGE_FILES.HTM
local types
types: table1 type table of ZFILE_UPLOAD.
page attributes
display_type TYPE STRING
display_url TYPE STRING
file_content TYPE XSTRING
file_length TYPE STRING
file_mime_type TYPE STRING
file_name TYPE STRING
flag TYPE STRING
path TYPE STRING
paths TYPE TABLE1
result TYPE XSTRING
layout
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2002" >
<htmlb:page title="demo " >
<htmlb:form encodingType="multipart/form-data" >
<htmlb:textView text = "Select a row to change the file"
design = "EMPHASIZED" />
<htmlb:tableView id = "tab01"
table = "<%= paths %>"
selectionMode = "singleselect"
onRowSelection = "myEvent" >
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName = "s_no"
wrapping = "true"
width = "100"
horizontalAlignment = "center"
title = "Serial No." >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "path"
wrapping = "true"
width = "100"
horizontalAlignment = "center"
title = "Path" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "myicon"
type = "user"
title = "Image"
horizontalAlignment = "center" >
<htmlb:link id = "$TVCID$"
text = "Change File"
onClick = "$CARRNAME$" >
</htmlb:link>
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
<%
if flag = 'X'.
%>
<htmlb:fileUpload id = "myUpload"
size = "30" />
<htmlb:button id = "upload"
onClick = "myEvent"
text = "Upload" />
<%
endif.
%>
</htmlb:form>
</htmlb:page>
</htmlb:content>
eventhandler OnCreate
this handler is called once the page is first created (stateful mode)
it performs a once-off data initialization or object creation
select * from ZFILE_UPLOAD into table paths.
eventhandler OnInputProcessing
event handler for checking and processing user input and
for defining navigation
DATA: event TYPE REF TO cl_htmlb_event.
DATA: event_name type string.
DATA: event_type type string.
data: str1 type string.
data: str2 type string,
str3 type string.
data: index type i.
event = cl_htmlb_manager=>get_event( runtime->server->request ).
event_name = event->name.
event_type = event->event_type.
if event_name = 'link' and event_type = 'click'.
split event->id at '_' into str1 str2 str3.
index = str2.
flag = 'X'.
endif.
if event->id = 'upload'.
DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD.
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.
DATA: fname type string.
Enter the path to be stored in the server here....
Data : filepath type string,
t1 type string.
filepath = file_name .
while filepath CA '\'.
split filepath at '\' into t1 filepath.
endwhile.
fname = '\documentation\raj\' .
concatenate fname filepath into fname.
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER file_content TO FNAME.
CLOSE DATASET FNAME.
REPLACE ALL OCCURRENCES OF '/' IN fname WITH '\'.
to update the new path into a data base table
data: s_no type int3.
data: wa type ZFILE_UPLOAD.
read table paths index index into wa.
wa-PATH = fname.
modify ZFILE_UPLOAD from wa.
endif.[/code]
The DB table ZFILE_UPLOAD has the following fields:
S_NO INT3
PATH CHAR100
Hope this helps,
Cheers:)
Ravikiran.
PS: Pls assign points if you find this answer helpful. -
hi marc,
i need a small help from you.i am uploading file into bps web,i followed your pdf guide.it is working fine.in my scenario,i had developed a screen design and in that i wants to incorporate the file upload functinality.when we generate the bps application corrsponding bsp will be generated and in bsp, the page design will be in the views not in the layout,here iam getting the problem,when i write the code in the oninputprocessing the below code is not responding,when i try to do change in the layout my original design is getting disturbed.my code is as follows in the oninputprocessing plz advice me.
iam getting dump at the bolded line below as null value is passed.plz help me out.
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
CONSTANTS:
c_memory_id_file_upload TYPE memory_id VALUE 'Z_SEM_BPS_FILE_UPLOAD'.
DATA:
lv_objname TYPE lxeobjname,
lr_page TYPE REF TO if_http_entity,
l_content_path TYPE string,
l_content TYPE string,
l_subrc TYPE sy-subrc,
ls_bapiret TYPE bapiret2,
lt_bapiret TYPE STANDARD TABLE OF bapiret2,
ls_mesg TYPE upc_ys_mesg,
lt_mesg TYPE upc_yt_mesg,
request1 type ref to IF_HTTP_REQUEST.
DATA: event TYPE REF TO CL_HTMLB_EVENT.
REFRESH lt_mesg.
IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
IF event->name = 'button' AND event->event_type = 'click'.
DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
button_event ?= event.
ENDIF.
endif.
case event->id.
when 'upload'.
lv_objname = request->get_form_field( 'file' ).
lr_page = request1->get_multipart( 1 ).
<b>l_content_path = lr_page->get_header_field( '~content_filename' ).</b>
l_content = lr_page->get_cdata( ).
IF l_content IS NOT INITIAL.
Export file contents to memory
EXPORT content FROM l_content TO MEMORY ID c_memory_id_file_upload.
endif.
endcase.
create statistic node for performance measurements
type-pools: upcst.
cl_upwb=>statistic_open( i_node_name = upcst_c_web_input_proc
i_page = page
i_request = request ).
call input processing here
call method application->inputProcessing(
event_id = event_id
runtime = runtime
page = page
request = request
navigation = navigation
version = 300
close the statistic node
cl_upwb=>statistic_close( i_node_name = upcst_c_web_input_proc ).Hello Bharan,
the file upload must run in its own BSP application. Otherwise the header for the file content is not filled properly. You can use an iframe to embed the upload application into a BPS web interface for example.
Regards,
Marc
SAP NetWeaver RIG -
Upload file to global directory in Dev, Q&A and Prod!
I have an upload application in BSP, that uploads files to for example /usr/sap/BWD/files
this works in Development, but of course this directory is not available in Production, so BSP won't work there.
Isn't it possible to use one global directory?
Right now somebody created for us a directory, that's the same on all 3 systems (Dev, Q, and Production)
this dir is
on Development: DIR_TRANS /usr/sap/transBW
on Quality: DIR_TRANS /usr/sap/transBW
on Production: DIR_TRANS /usr/sap/trans
notice the small difference in path in Production... Is there a way to use the DIR_TRANS instead of the real path?
my application writes data like this:
fname = '/usr/sap/CBD/files/FILE.CSV'.
OPEN DATASET fname FOR OUTPUT in TEXT MODE encoding default.
if sy-subrc gt 0.
WRITE: / 'Error opening file'.
endif.
LOOP AT data_TAB INTO LIN.
TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
thanks a lot, points will be rewarded for usefull answers!
thanks!use transaction FILE to create logical path for the actual file path.
and then use FM
call function 'FILE_GET_NAME'
exporting
client = sy-mandt
logical_filename = pil_file "Input logical file name
operating_system = sy-opsys
importing
file_name = p_i_file "Physical file name
exceptions
file_not_found = 1
others = 2.
Regards
Raja -
To Delete the uploaded file in Application Server
Hi Friends,
I developed an BSP Application displaying the results from ITAB though Iterator, for which , each row there is feature to upload a particular file in the Application Server, where I stored the file path into a database table field. .When I delete the the row, I am successfully get rid of the entire row including the file path.
My Question.
1. How to delete the uploaded file of the Application Server ?
Please mail me in this regard.
Regards
CSM ReddyHi,
you have the keyword and you have the documentation. What is your problem?
Search in the forums with keyword "delete dataset", there are lots of threads about this.
Example
Deletion of dataset in applicaiton server
deleting file from AL11 Tcode
Best regards
Renald -
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( ). -
How to upload file using *cl_gui_frontend_services* method
hi
i want to upload an image file using this method
and i want to save it in MIME Repository (/SAP/BC/BSP/SAP/PRASHANT)
DATA:
itab TYPE TABLE OF sflight.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = 'C:\temp\winter.jpg'
filetype = 'ASC'
has_field_separator = '|'
CHANGING
data_tab = itab
IF sy-subrc = 0.
WRITE:/ 'success'.
ENDIF.
So plz tel me how i set given path to upload file using this method .Hi Prashant,
Go through the [Link|https://forums.sdn.sap.com/click.jspa?searchID=24477690&messageID=6684222].
Hope this is helpful.
Regards,
Abhinav -
Unable to upload files to attach to my hotmail.
I have been un-able to upload files to attach to my email for some time now. I have un-installed and re-installed Internet explorer, disabled all add on's, re-set settings on internet explorer, completely shut down computer and re-stared several times.
changed my security settings, nothing works! Once in a while it does work, but then I will try again, and the screen freezes and when I ctrl-alt-delete it says Internet Explorer has stopped working. I work from home, and need to send PDF files thru email daily
for work.
Please help me figure this out! We use Windows 7, and the newest version of Internet Explorer. Thank you!Hi,
Firstly, please check Event Viewer and it should identify what's the reason cause IE crash.
Secondly, have you tried other browser for test to upload file?
Roger Lu
TechNet Community Support -
I cant able to upload the file size >1 MB its showing error."the remote server returned an error (400) bad request."
any one kindly help to fix the issue.Hi,
Are you trying thru OOB or how..
Please check the "maximum file size for sharepoint".
refer below links for the same.
https://angler.wordpress.com/2012/03/21/increase-the-sharepoint-2010-upload-file-size-limit/
https://msdn.microsoft.com/en-us/library/ff487972.aspx
Don't forget to mark it as an Answer if it resolves your problem or Vote Me if it useful.
Mahesh -
Hi,
i have upload a excel file with BSP-Extension htmlb "fileupload". Now i get the excel-content in XString. How can i convert the Xstring to internal table?
i can convert the xstring to string but i need it in internal table!
can anyone help me!
greetings
markusMarkus,
I know of no functions that will convert a XLS file into an internal table. I suspect that even just converting the XSTRING (binary blob) into a string should be sufficient to completely destroy the XLS file.
Only idea which you might try, is to convert (save as?) the XLS into a CSV file and upload this. This is just a comma separated file and should be easy to parse. This topic (at least writing such files) have been discussed previously a number of times. Maybe you search through the forum.
++bcm -
After uploading file not showing result
Hi All,
I have upload excel file thru BAPI,which was given by client.when I upload the file it is showing empty sheet.
Report is running properly,there is no error in program.Plz help me out.
Thanks and Regards
SANPlease put the code here or provide more details
-
How to "Add" Button to upload file in Notification PG?
I have a question on Extending/Customizing notfn to have "Add" attachment button to upload a document (some stnd template that Our business has) on either NotifDetailsPG or /oracle/apps/fnd/wf/worklist/webui/MoreInfoPG when a Approver opens notification to APPROVE/Reject
I'm wondering why Oracle didn't provide this feature of Uploading a file (along with Response input text area that they provided already) in NotifDetailsPG?
Business Reason: Our Business wants to upload a doc when an approver Rejects the notification (our case: iExpense module filing Exp Report) telling employee to follow some protocals
Question on OAF:
Is it possible to extend NotifDetailsPG or MoreInfoPG to upload a file. So, that when it goes to requestor they can open this file back and read thru. I know we need to insert a record in fnd_documents and fnd_attached_documents and /or fnd_lobs...but i don't know how to retrieve it back....Any hints....
Thanks
Raghu Kulkarnito clarify again....
In the WF notification during the time of "Reject"ion or "Approv"al, we want to upload a file and then perform Reject/Approve action. Can we extend the page to have Add button to upload file? Is that a lot of work?
Please any one give some suggestions...Thanks
Raghu Kulkarni
Maybe you are looking for
-
How to change the default name of new adjustment layers? (and other Q's)
How do I change the default name of new adjustment layers? How can I make it so that adjustment layers don't come with a mask when I create them (unless I have a selection active)? Why isn't the Shadows/Highlights functionality an adjustment layer? I
-
Can't see thumbnails for anything when I doing a spotlight search in Finder
Hello everyone, I am having some trouble with viewing things in my Finder. When I try to do a search in the spotlight within finder, I am not able to see anything. It says that there are many files that come up but all that I see is a grey window tha
-
Guys, take a look at this example: create table ccb as select 'Edinburgh 1' as client_branch, '90000445' as client_number from dual; insert into ccb values('Edinburgh 1',90000445); insert into ccb values('Edinburgh 2',90000452); insert into ccb value
-
Special stock-E in Requirements class 011-Delivery requirement
Dear expert, i want to change the value in filed: special stock from E to other value via OVZG, can i do it and how? please do me a favor,great thanks! David
-
Unable to view supplier list in LOV in PO Form
Hi All, I have defined supplier, supplier site in supplier definition form but same values are not coming in LOV in PO form. I am working on CRP instance and done all steps correctly. If I open ASL screen suppliers are visiable but same LOV suppliers