Picture uopload using BSP
Hello Everyone,
Can any one help me out with this problem please. I have developed a BSP Application for the Picture upload using the code in the Blog
/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
But I am not getting output. when I am clicking buttons no action is taking place.
Thank you very much in advance.
With best regards,
Suneetha
Ya Surly i will.
Here is the code.
%@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: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' AND display_url IS NOT INITIAL. %>
<iframe src="<%=display_url%>" width="100%" height="500px">
</iframe>
<% ENDIF. %>
IF ( display_type = 'html' OR display_type = "window" ) AND
XSTRLEN( file_content ) > 0.
<% IF display_type = 'window' AND display_url IS NOT INITIAL. %>
<script language="Javascript">
window.open("<%=display_url%>").focus();
</script>
<% ENDIF. %>
</htmlb:form>
</htmlb:page>
</htmlb:content>
Oninputprocessing
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: radioButtonGroup TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
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.
DATA: response TYPE REF TO if_http_response.
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 ).
navigation->response_complete( ). " signal that response is complete
RETURN.
ENDIF.
IF display_type = 'html' AND XSTRLEN( file_content ) > 0.
DATA: cached_response TYPE REF TO if_http_response.
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 ).
DATA: guid TYPE guid_32.
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.
With best regards,
Suneetha
Similar Messages
-
Picture uopload in the solution manager using BSP
Hi Everybody I am trying to upload a employee pictures for the each user in the Solution manager using BSP. I have got some coding form the help but its not working. Kindly direct me the way I can go for the upload.
Please help me out.
With best regards,
SuneethaHi Thank you very much for your answer.
I am using for the file upload code is
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
<htmlb:page title = " ">
<htmlb:form>
<html>
<body>
<h2> Form with File Upload and Download </h2>
Choose a file for upload. The file will be echoed to your browser if you
select the checkbox below.
<form method="POST" enctype="multipart/form-data">
<table border=1 width="100%">
<tr>
<td> <input type=checkbox name="doEcho"> </td>
<td> <input type=checkbox name="doEcho" value="X"> (select for echo)
</tr>
<tr>
<td> <input type=file name="echoFile"> </td>
</tr>
<tr>
height = "45".
width = "45".
<td> <input type=submit name="onInputProcessing(upload)" value="Submit"> </td>
</tr>
</table>
</form>
</body>
</html>
</htmlb:form>
</htmlb:page>
</htmlb:content>
Can I use this along with oninput processing that u have given.
With Best regards,
Suneetha -
I have a requirement where I have to display all hierarchies on an infoobject to a user. The user should be able to select a particular hierarchy and download it as a flat file to a location. Can this be done using bsp?
Hi,
You can list the hierarchies of an InfoObject using table RSHIEDIR.
When the user clicks on a hierarchy name, you can get its content in an internal table using Function Module RSSH_HIERARCHY_READ.
Finally, you will have to process the internal table to send it as a flat file in HTTP response at the BSP level, so that the user can download it.
Regards,
Tanguy -
How to Download displayed output to Excel Using Bsp Application
Hi Experts,
please give me some idea because I am New In BSP.
How to Download displayed output to Excel Using Bsp Application.
If any sample code please do send me.
In my condition I am getting data in 2-3 table view formats on one page and i want download that in Excel.
please help me.
Regards & Thanks,
YogeshHi,
This is more a question for the BSP forum.
Anyway, as such it's realy easy since you can use HTML in order to import to Excel. All you need to do is add
runtime->server->response->set_header_field( name = 'Contnet-Type'
value = 'application/vnd.ms-excel' ).
runtime->server->response->delete_header_field( name = 'Cache-Control' ).
runtime->server->response->delete_header_field( name = 'Expires' ).
runtime->server->response->delete_header_field( name = 'Pragma' ).
Also check threads like
Download BSP data into Excel
export bsp-table to excel
Export BSP Table to Excel
Eddy
PS. Reward useful answers and earn points yourself -
I have Photoshop Eleent 12 and use a Windows PC. I hae been using a Canon EOS 50D for several years, which uses a Compact Flash Card. I have always downloaded pictures by using a card reader wich I connect to my computer. I Go to the Organizer, click on "Import" and select "From camera or card reader". Once on the Photo Downloader, I select the pictures, chose the folder and click on "Get Media" and all the photos get downloaded. Today I folled the same procedure as always, but ZI'm gettig an error message that reads"Import Failed" followed by another message that reads "Nothing was imported. The file(s) or folder(s) selected to import did not contain any supported file types, or the files are already in this Catalog." I'm puzzled by this message and don't know what to do o get my photos. Any suggestions?
The organizer doesn't care where you send your photos when you download them via the downloader or where they happen to be when you first bring them in if you use the Get Photos command, but once your pics are in the Organizer, you *must* move them from within organizer or it can't find them. You don't have to use My Pictures at all if you don't want to, but regardless of the folder where you put your photos, if you want them someplace else, you use organizer to do it.
-
Streamloader error in picture gallery using personal domain
I've upgraded my site to iWeb '08 and added a Picture Gallery page to aggregate all my different picture pages. Everything works great when I'm viewing it using my web.mac.com/ URL. However, if I navigate to the page using my personal domain, which I've set up, the gallery doesn't work correctly on either Safari (mac) or IE (pc), I only get the shell page and no pictures galleries.
Works:
http://web.mac.com/ppmolina/main/Pictures/Pictures.html
Doesn't work:
http://www.molinafamily.us/main/Pictures/Pictures.html
Using the domain URL, I get these errors for each of my galleries:
Safari doesn't indicate any type of error.
IE shows these errors:
Line: 507 (it shows one error for each of my galleries)
Char: 1
Error: Permission Denied
Code: 0
URL: http://molinafamily.us/main/Pictures/streamloader.html?scriptURL=Pages/GreenbushPic_Page_files/Greenbush_PicPage.js&id=gridEntry2
Anyone else having this problem? Suggestions on how to fix it?I am having that exact same problem, but it only started recently. I thought it was due to some adsense ads that I placed at the bottom of each page, but after I removed them the pictures still don't work. I have tried everything I can think of, but it only works if I use my web.mac.com instead of my domain.
I have only tried viewing it in Firefox, but I'm assuming the same problem will occur in IE and Safari as well.
Works:
http://web.mac.com/sheazle/SheazleSite/RegularPhotos/RegularPhotos.html
Doesn't Work:
http://www.sheazle.com/SheazleSite/RegularPhotos/RegularPhotos.html -
Hi,
Is it possible to display a pie chart using BSP.The piechart want to viewable in internet (URL)
Can anyone help me with step by step procedure.Dear Ramya,
There is an option to display the Pie chart in BSP. For that please do the following steps,
In layout:
<htmlb:chart
id = "myChart1"
data = "<%=data%>"
width = "300"
height = "300"
titleCategories = "Company"
titleValues = "Turnover"
title = "Washers by Companies!"
chartType = "PIE_3D"
legendPosition = "EAST"
colorOrder = "STRAIGHT"
/>
You can specify the other charttype in the propoerty chartType .
In OnInitialization:
some data to be displayed give your datas to be displayed
DATA: line TYPE igs_data.
line-groupid = 'SAP AG'.
line-x = '1st Quarter'.
line-y = 50.
line-color = 48.
line-extension = 'href="http://www.sap.com" alt="SAP AG"'.
append line to data.
line-x = '2nd Quarter'.
line-y = 35.
line-color = 0.
append line to data.
line-x = '3rd Quarter'.
line-y = 43.
append line to data.
line-groupid = 'Microsoft'.
line-x = '1st Quarter'.
line-y = 46.
line-extension = 'href="http://www.microsoft.com" alt="Microsoft"'.
append line to data.
line-x = '2nd Quarter'.
line-y = 26.
line-color = 64.
append line to data.
line-x = '3rd Quarter'.
line-y = 38.
line-color = 0.
append line to data.
In Page Attributes:
data TYPE IGS_DATA_TAB
Now check in IE you can get ur pie chart.
Appreciate if tis Helpful.
Regards,
Anita Vizhi Arasi B -
Send a picture file using sockets
Hi,
Could someone please tell me how I can send a picture file using sockets across a TCP/IP network? I have managed to do it by converting the file into a byte array and then sending it but I dont see the data back at the client when I recieve the file. I just see the byte array as having size 0 at client.
Byte array size is correct at client side.
//client code
System.out.println("Authenticating client");
localServer = InetAddress.getLocalHost();
AuthConnection = new Socket(localServer,8189);
out = new PrintWriter(AuthConnection.getOutputStream());
InputStream is = AuthConnection.getInputStream();
System.out.println(is.available());
byte[] store = new byte[is.available()];
is.read(store);
ImageIcon image = new ImageIcon(store);
JLabel background = new JLabel(image);
background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
getLayeredPane().add(background, new Integer(Integer.MIN_VALUE));
//extra code here
catch (UnknownHostException e) {
System.err.println("Don't know about host: LocalHost");
System.exit(1);
catch (IOException e) {
System.err.println("Couldn't get I/O for "
+ "the connection to: LocalHost");
System.exit(1);
//server code
DataOutputStream out = new DataOutputStream(incoming.getOutputStream());
FileInputStream fin = new FileInputStream("3trees.gif");
byte[] b = new byte[fin.available()];
int ret = fin.read(b);
out.write(b);i used OutputStream as
OutputStream out = incoming.getOutputStream(); and flushed the stream too.
But I still get the same output on the client side. I tried sending a string and it works , but I cant seem to be able to populate the byte array on the client side. It keeps showing zero. Please advise.
Thank you. -
How to send picture message using J2ME sms APIs?
Hi,
I experiment with SMS APIs, i successfully send simple text message. now i want to send picture message, how to send picture message using J2ME APIs.
please guide me.
guna.I experienced in coding sending and receiving sms in J2ME. Besides, I also esperienced in coding reading a binary file in a applicaition jar. But I never done these both together. Hence Im not sure it works or not. Below is the example to open and read a binary file:
InputStream oInputStream = getClass().getResourceAsStream( "/picture.png" );
if(oInputStream == null) {
//File does not exist;
throw new Exception("File not found");
//Read the binary file and copy it to a byte array
byte[] abyPicture = new byte[oInputStream.available()];
oInputStream.read(abyPicture ); -
How do I send email with pictures attached, using PSE 9 and Windows 7 ?
How do I send email with pictures attached, using PSE 9 and Windows 7 ?
Try email attachment workflow in Organizer. http://tv.adobe.com/watch/learn-photoshop-elements-9/sharing-your-images-via-email/
Thanks
Andaleeb -
I have coloured vertical lines about a quarter of the way from the left of the picture when using my apple tv 2. Anyone got any idea what is causing it. Have done a reset but still same. ATV2 is only a month old.
Just to make sure, try a different set of cables. If the problem persists, have the unit replaced by Apple.
-
Standard Picture Packages using PSE 10 with a Mac.
I am unable to print out a standard picture package using PSE 10 with a Mac. I like to print 3 4" X 6" Pic Package with different images. It is impossible. I had a PC and Elements 8 before with no problem. I followed all the help instructions to no avail. What can I do?
With Mac, I am unable to find a 3 4" X 6" (example) picture package in PSE 10 Edito
File>Picture Package>choose 8x10 for the working area and you should see:
Then go up to the top and choose an image. It will appear in all the zones. Just click a zone in the preview to change to another image. It's actually a more robust package than in organizer--you can save it as a file, for one thing, instead of having to recreate it each time. All printing in the mac version happens from editor, so that's where they put the picture package and contact sheet. You can also create and save custom layouts via the Edit Layout button. This is the same picture package and contact sheet that came for many years in PS, so if you look for PS tutorials (pre-CS6) you should be able to find very detailed instructions. -
Attach the file for purchase requisition using BSP service
Hi All,
I have Requirement Attach the any file like(PDF,TXT,PPT) to Purchase requisition using BSP service.Could please provide me any function module or BAPI for this functionality.
Thanks in advance.
Regards,
Rajesh.Hi All,
REPORT ZTESTJLG3 . .
parameter p_mandt like sy-mandt default '120' .
parameter p_equi type equnr default '1000007' .
parameter p_path like IBIPPARMS-path memory id AD_LOCAL_PATH .
parameter p_name(30) default 'Test attach 100007' lower case .
" nom attachement .
data w_prog like sy-repid .
data w_dynnr like sy-dynnr .
data w_attachement type borident .
initialization .
w_prog = sy-repid .
w_dynnr = sy-dynnr .
" test jean luc recuperer le code de
fucntion module 'GOS_EXECUTE_SERVICE'
data lo_container TYPE REF TO cl_gui_container .
*call method lo_container->get_container_type .
at selection-screen on value-request for p_path .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = w_prog
DYNPRO_NUMBER = w_dynnr
FIELD_NAME = 'P_PATH'
IMPORTING
FILE_NAME = p_path .
start-of-selection .
if sy-mandt ne p_mandt .
write 'Erreur mandt ' .
exit .
endif .
data ws_borident like borident .
ws_borident-OBJKEY = p_equi.
ws_borident-OBJTYPE = 'EQUI'.
data w_document like SOOD4 .
data : begin of wt_files occurs 0 .
data fname(128) .
data end of wt_files.
wt_files-fname = p_path .
append wt_files .
data folder_id like SOODK .
call function 'SO_FOLDER_ROOT_ID_GET'
EXPORTING
region = 'B'
IMPORTING
folder_id = folder_id
EXCEPTIONS
others = 1.
w_document-foltp = folder_id-objtp .
w_document-folyr = folder_id-objyr .
w_document-folno = folder_id-objno .
append document to documents.
w_document-objdes = p_name .
w_document-objnam = p_name .
data w_h_data like sooD2 ..
data w_fol_data like sofm2.
data w_rec_data like soos6 .
w_h_data-objdes = p_name .
CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
EXPORTING
METHOD = 'IMPORTFROMPC'
OFFICE_USER =
REF_DOCUMENT = w_document
NEW_PARENT =
IMPORTING
AUTHORITY =
TABLES
OBJCONT =
OBJHEAD =
OBJPARA =
OBJPARB =
RECIPIENTS =
ATTACHMENTS =
REFERENCES =
FILES = wt_files
CHANGING
DOCUMENT = w_document
HEADER_DATA = w_h_data
FOLMEM_DATA = w_fol_data
RECEIVE_DATA = w_rec_data .
if w_document-okcode = 'CREA' or w_document-okcode = 'CHNG'.
w_attachement-objtype = 'MESSAGE'.
w_attachement-objkey = w_document(34).
CALL FUNCTION 'BINARY_RELATION_CREATE_COMMIT'
EXPORTING
OBJ_ROLEA = ws_borident
OBJ_ROLEB = w_attachement
RELATIONTYPE = 'ATTA'
IMPORTING
BINREL =
TABLES
BINREL_ATTRIB =
EXCEPTIONS
NO_MODEL = 1
INTERNAL_ERROR = 2
UNKNOWN = 3
OTHERS = 4
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif .
For above requirement i am trying like above code.
working fine but which transaction i can find the attach file.I am trying to fine using ME52N transaction but i c't find this file.
Please suggest me how can i find this one
Thanks in advance,
RajeshV. -
Question
When on Facebook (for example), Firefox is not allowing me to open pictures; when using apps, the bottom of the screen is missing so cannot utilize the apps. All working on Safari; just downloaded new Firefox 4, so seems to be a probleCan you attach a screenshot?
*http://en.wikipedia.org/wiki/Screenshot
*https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
Use a compressed image type like PNG or JPG to save the screenshot.
See also "Help About".
*Tap the Alt key or press F10 to show the Menu bar.
In current Firefox releases (29 and later) the orange Firefox menu button has been replaced by the three-bar Firefox Menu button at the far right end of the Navigation Toolbar and this button is always visible, whether you have the menu bar visible or hidden<br>A consequence of this location is that you no longer can hide the Navigation Toolbar
*There is a star like button next to the search bar on the Navigation Toolbar to bookmark the current web page and a "Show your bookmarks" button next to it to open the Bookmarks in a drop down menu.<br>You can find "Show All Bookmarks" to open the Bookmarks Manager (Library) at the bottom of this drop-down list
*If you bookmark a page then "Bookmark This Page" in the Bookmarks menu changes to "Edit This Bookmark"
*You can make the title bar visible via the "Title Bar" button at the bottom left in the Customize palette window
It is still possible to have the menu bar visible via the right-click context menu of a toolbar to have menus like the File menu with Print (Ctrl+P) and Print Preview and the Bookmarks menu available.
See also:
*https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox
*https://support.mozilla.org/kb/common-questions-after-updating-to-new-firefox
*https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox -
Website for free pictures (commercial use allowed)
Hi!
Just a short question:
I'm searching for a website, which lets me download free images even for commercial use. There should be a wide range of pictures, suited for quite many business parts.
Any ideas? Has anyone already made some good experiences somewhere?
Thank you!hm, thank you preran for your answer.
i found now a quite good looking site called morgueFile.com
It offers free pictures - commerical use included without presupposing any account.
But I'm still interested to hear, if anyone already got some experience with one of those sites?
I mean, where do y all get your pictures from?
Maybe you are looking for
-
My phone is stuck in searching
I have rebooted, reset, turned airplane mode off and on, no luck.
-
Touch Smart Web use no longer available?
When did the Touch Smart Web apps stop being supported? It ays the internet isn't connected - but it is.
-
Having issues opening attachments after Mountain Lion Update
Hello, I am having issues opening up attachments with the correct application in mail. For instance, I received an email with a microsoft word attachment, even though, I have microsoft word installed on my mac it's telling me that it can't open
-
Error in persistence(EP)
All, The only user which is left unlocked in EP is j2ee_admin (which has Administrator role). By loggin in using this user when i try to unlock the user 'admin' i get the following error, [631ffffffd6600812]#nvpal145_ERP_103929350#J2EE_ADMIN#0fab39d0
-
Receiving error message "Sim Failure" on iPhone 4S now no service. any advice?
receiving error message "Sim Failure" on new iPhone 4S now no service. any advice?