How to include Text file in Web Dynpro structure
Hi Guys,
I know that you can add a "File" object against a Java project (right click on project: New -> File).
Is this possible with WebDynpro? In other words, can I add a Text file "object" against my DC? I need such a File because I need to store text values in it that I read in my View Contoller.
Any suggestions?
Christiaan
Hi
Yes
Select the Navigator view --select the dc --right click --new --other --general --- here u will get the option .
Note : put your file only under src--make one folder say util and then put your file here.
Best Regards
Satish Kumar
Similar Messages
-
How to call PDF file in Web Dynpro Appl?
How to call PDF file in Web Dynpro Appl?
Hi Gobinath,
1. Create a value attribute of type byte called pdfSource.
2. Insert an UI element called Interactive Form in your layout
3. Set the source property of this Interactive From UI element to the context pdfSource.
4. Insert a button which would open your pdf file.
public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionsubmit(ServerEvent)
IPrivate<viewname>.IContextElement contextElement = wdContext.currentContextElement();
byte[] bytes = contextElement.getPdfSource();
try
File file = new File("C:
temp
example.pdf");
FileOutputStream os = new FileOutputStream(file);
os.write(bytes);
os.close();
catch (IOException e)
// do something
e.printStackTrace();
//@@end
Warm Regards,
Murtuza -
How to browse local file using web dynpro
hi everyone
How can I browse local file using Web Dynpro?And read file names into Context or array. I have tried the following code but its not working
String resourcePath = WDURLGenerator.getResourcePath();
String depObjResourcePath = WDURLGenerator.getResourcePath(Test);
WDDeployableObjectPart appPart = WDDeployableObject.getPart(Test, TestApp, WDDeployableObjectPart.APPLICATION);
help required urgently
Thanks & Regards
Jaspreet KaurReply in
how to browse local file using web dynpro
Regards,
Ashwani Kr Sharma -
How to include text file in classes directory of war file.
I have a project that uses a text file called cache.ccf (JCS configuration file) when debugging the webservices, I have to dig into the inflated war file directory and manually place the cache.ccf file in the WEB-INF/classes/ directory/
How can i have JDeveloper wrap the file up in the war file in the WEB-INF/classes directory. both for debugging and when the war file is actually built for deployment.
Thanks,
BartNevermind, I figured it out using the Project Properties->Deployment and include it in the WEB-INF/classes
-
How to include source code in web dynpro java deployment
Hi,
We dont have NWDI.
We are creating ear files out of web dynpro applications packaging them as sca files and deploying them in server.
But the source code is not included in ear.
How to include source code with your ear/sca , so that when anyone downloads the sca file later, they are build the Project in the studio.
How would they typically download? Do they require NWDI ,
Right now we dont have NWDI in place, but we want to do is parcel the applications such that the source code should be available at a later time for download.
This is possible with .par files , but what about web dynpro?
Thanks,
DebIf you are not using NWDI use the _comp file.
-
How do we scan for viruses of uploaded excel file in Web Dynpro for JAVA
Hi All,
Please let me know "How do we scan for viruses of uploaded excel file in Web Dynpro for JAVA"
Regards,
Ganga.Hi ,
pl go through this note "Integrating a virus scan into SAP applications 817623 "
SAP Virus Scan Interface
http://help.sap.com/saphelp_nw2004s/helpdata/en/30/42c13a38b44d5e8d1b140794e8e850/frameset.htm
Sample Application
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6e1c4221-0901-0010-63ba-b1f9459d6e74
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f2681486-0a01-0010-8497-c778eac80da5
Regards
Ayyappparaj -
How to develop a rich text editor using Web-Dynpro?
Hello Everyone,
I am new hire,
today I got a task from leader to develop a rich text editor using Web-Dynpro,
Because I just finished the BC400 and NET310 training and lack of expericen in ABAP,
Can anyone tell me the main idea to accomplish the task?
Thank you very much.
Best Regards,
DerekHave you looked at the standard UI Element
[FormattedTextEdit|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/2772f505605447e10000000a422035/frameset.htm] it's not perfect, but it does allow some simple formatting.
Anything beyond this - you're going to need to use an Island.
[Thomas Jung's Demo of using an Island to provide a rich text editor|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0c91fc0-932d-2c10-4ca7-f5774950c8e3]
Cheers,
Chris -
How to add many lines in the Text View in Web Dynpro
Hi friends,
I have one Text Edit in Web Dynpro. I need to show the result of FM READ_TEXT in Text Edit View element, without lose the text format.
Cardinality of my node is 0:n and attribute datatype is string_table. after assigning the values using bind_table method, I am getting only the first row of the read_text returns...
By
devaHi Deva,
Text View is not meant to be bound to string_table. Create a string instead and convert that string table into that string with
<br>
between each row of string table. TextView component will make <br> into new lines. Code will be similar to following.
DATA: ROWS TYPE string_table,
top type string,
result type string.
loop at rows into top.
concatenate result top into result separated by '<br>'.
endloop.
Now bind this result string to the text view component. It ll work. Hope it will be helpful for you.
Regards,
Fareez -
Import data from excel/csv file in web dynpro
Hi All,
I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
How can I read/import data from excel / csv file in web dynpro table context?
Any help is appreciated.
Thanks a lot
AakashHi,
Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
Create a workbook from a file on the local file system, as illustrated in the following code fragment:
import java.io.File;
import java.util.Date;
import jxl.*;
Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
On getting access to the worksheet, once can use the following code piece to access individual sheets. These are zero indexed - the first sheet being 0, the second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
Sheet sheet = workbook.getSheet(0);
After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
Cell a1 = sheet.getCell(0,0);
Cell b2 = sheet.getCell(1,1);
Cell c2 = sheet.getCell(2,1);
String a1 = a1.getContents();
String b2 = b2.getContents();
String c2 = c2.getContents();
// perform operations on strings
However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
String a1 = null;
Double b2 = 0;
Date c2 = null;
Cell a1 = sheet.getCell(0,0);
Cell b2 = sheet.getCell(1,1);
Cell c2 = sheet.getCell(2,1);
if (a1.getType() == CellType.LABEL)
LabelCell lc = (LabelCell) a1;
stringa1 = lc.getString();
if (b2.getType() == CellType.NUMBER)
NumberCell nc = (NumberCell) b2;
numberb2 = nc.getValue();
if (c2.getType() == CellType.DATE)
DateCell dc = (DateCell) c2;
datec2 = dc.getDate();
// operate on dates and doubles
It is recommended to, use the close() method (as in the code piece below) when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.
// Finished - close the workbook and free up memory
workbook.close();
The API class files are availble in the 'jxl.jar', which is available for download.
Regards
Raghu -
Integrating Help files in Web Dynpro Application
The requirement is : To give context specific help for each fields..
Description:The requirement is to provide context specific help..for each field that would appear on dynpro screen..
Now what that means is.. for each field on the screen...there will be a "?" icon next to it..when the user clicks on that "?" icon...a small pop-up type of information. box should come up...displaying the text corresponding to that field..this u might of seen on some of the web sites...or microsoft applications..
No we have to store the help files..in some proper place either KM...or anywhere...and maintaining the relationship between the field and it's corresponding help file.One of the option for this is to use microsoft help tool which creates files in the .chm format and then use these files for our purpose.
So can anyone please guide me what's will be the best way to achieve my purpose .chm files where i the help files will be stored and how they can be accessed in Web Dynpro Application.If u have any good suggestion apart from using .chm files then please suggest me.Please try to give a detailed solution.
Any direction will be appreciated even if just to the proper place for a forum post of this nature or documentation
that will send me down the right path.Hi Candace, thanks for your time!
Nothing is "clickable".... as in, nothing will is hyperlinked to each individual file....
In my settings for items in this region, I have chosen mime type image, Image or Display Name Link, and when updated as attributes....
All that appears for each item/file is Image or Display Name and item updated info, though neither of which is clickable, or hyperlinked.....
Arrrrrghhhh.......... -
Hi,
I am getting an error while uploading an excel file in web Dynpro application. i am using the HR_KR_XSTRING_TO_STRING this function. I am getting the following error message 'Unable to interpret as a number'.First of all, are you sure you know what you are working with here. If this is standard Excel file in the Microsoft binary/propriatery format there is not function module or class in ABAP that can magically just transform this to a character string. You should search the forums as this has been discussed extensively. On that topic, please also do not post duplicate threads. I have already locked your other thread with the same basic question.
Instead of the binary/propriatery format of Excel, the file should be saved on the client as a text based format - like XML or Text Tab Delimited. You can then use several different options on the server to convert the XSTRING to STRING and process the content (becuase it was text based to begin with). You could use CL_BCS_CONVERT, the function modules in the function group SCMS_CONV, or the class CL_ABAP_CONV_IN_CE. -
Reading contents of uploaded excel file in web dynpro java
Hi All.
I am aware how to provide facility to upload files in web dynpro java. But my requirement is that on uploading a particular file (for eg. an excel file having 10 columns), I need to read the contents of that file and store it in a table in R/3.Can anyone suggest a way how I can read the contents of the uploaded file?
Thanks and Regards,
Saurabh.Hi.
I am having the following requirement : I have a FileUpload UI element where user clicks Browse button, selects a file from the local system and presses a Upload button. Upon pressing Upload, the name of the selected file and the contents of the file should be shown.
In the View context, I have two value attributes: FileName of type String and FileResource of type binary.
This is the code that I have in the Upload button action handler :
public void onActionUpload(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload(ServerEvent)
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(
IPrivateReadExcelView.IContextElement.FILE_RESOURCE);
IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType)attributeInfo.
getModifiableSimpleType();
IPrivateReadExcelView.IContextElement element = wdContext.createContextElement();
String fname = binaryType.getFileName();
wdComponentAPI.getMessageManager().reportSuccess("File selected - "+fname); //Statement 1
try {
wdComponentAPI.getMessageManager().reportSuccess("Successful"); // Statement 2
InputStream in = new FileInputStream(fname);
HSSFWorkbook wb = new HSSFWorkbook(in);
wdComponentAPI.getMessageManager().reportSuccess("Successful"); //Statement 3
int sheetsNo = wb.getNumberOfSheets();
for (int i=0;i<sheetsNo;i++) {
HSSFSheet sheet = wb.getSheetAt(i);
Iterator rowsNo = sheet.rowIterator();
while(rowsNo.hasNext()) {
HSSFRow rows = (HSSFRow)rowsNo.next();
Iterator colsNo = rows.cellIterator();
while(colsNo.hasNext()) {
HSSFCell cell = (HSSFCell)colsNo.next();
wdComponentAPI.getMessageManager().reportSuccess("File uploaded" +
"successfully");
if(cell.getCellType()==1) {
wdComponentAPI.getMessageManager().reportSuccess("00000"+
cell.getStringCellValue());
else if(cell.getCellType()==0) {
String str=""+cell.getNumericCellValue();
wdComponentAPI.getMessageManager().reportSuccess("11111"+str);
catch(Exception e) { wdComponentAPI.getMessageManager().raisePendingException();
//@@end
On pressing Upload button, name of selected file is being shown(Statement 1). I am also getting Statement 2 in the output. However I am not getting Statement 3 onwards.
Where am I going wrong? Can anyone shed some light on this? -
Uploading excel file in Web Dynpro for ABAP
Hello Gurus,
I need to upload a excel file in my Web Dynpro (ABAP) program. Can anyone please tell me how do i do this. Kindly help.
Regards,
Aditya.Hi Aditya,
Please search the forum...
Please check this link
Uploading Data from Excel File To Dynpro
Excel Upload via Web dynpro ABAP
Upload and Reading Excel File in Web Dynpro
Best regards,
raam -
Font size of text view in Web Dynpro ABAP
Hi Experts,
How to increase the font size of a text view in Web Dynpro layout. I have tried the 'Design' property of the text view and made it 'Group Title', But i want even bigger font size.
Pls suggest.
Thanks,>
Naresh Kumar Malik wrote:
> Hi
>
>
>
>
> You can use <h1> HTML tag. Here
> concatenate '<h1>' item_eform_reqno '</h1>' into head.
> wd_context->set_attribute( exporting name = 'EFORM_HEAD' value = head ).
>
>
> Here attribute EFORM_HEAD is bounded to the text view element.
>
> Regards
> Naresh
This should NOT work! The UI elements should safe encode all input values - thereby eliminating the value of any HTML tags. If you system isn't doing this already then it is a bug and if you rely on such a thing it will stop working at some point in the future.
You are basically restricted to different values available via the design parameter. The overall font sizes come from the underlying themes and the client applications (browser or NetWeaver Business Client) that host the Web Dynpro Application. Therefore no direct specification of the font size is possible in order to stay within the controls of theme. If you don't like any of the designs available, you might consider altering the Portal Theme you are using - but that is a rather drastic approach. -
How to include external files in JSP
hi,
How to include external files like image or javascript in to jsp pages.
I am using MVC frame work. So i have to use request dispatcher. While calling the pages trough dispatcher the external files are missing from the output. Also am using tomcat as server,web.xml(deployment descriptor ) is also configured.
regards
sreeWhen you use the request dispatcher, the relative path for all your ressources becomes the relative path of your calling serlvet and not the JSP/servlet that you call. Make sure to use the full relative path such as:
/PATH_TO_YOUR_DIRECTORY/myRessource.ext
NOT
SOME_DIRECTORY/myRessource.ext
Jeff
Maybe you are looking for
-
Error in MIRO posting for credit memo in return PO
Dear Sir, I have made a return PO for Vendor rejection.Then made a good return for the same with 161.Then post the excise return through JV J1IS. But when I am posting the Credit Memo for vendor system showing the Error - RG23D Part 2 has no
-
Any Adobe file that I want to download causes Firefox to open multiple tabs in rapid succession. I can not stop the multiple tabs from opening except by CTRL-ALT-DEL to then manually close Firefox. Even then Firefox immediately re-opens on its own an
-
Cannot start weblogic 8.1 User is not permitted to boot the server
Hi, Sorry to cross-post, but I didn't seem to get any feedback on this in the 'security' newsgroup. I have installed Weblogic 8.1SP3 on two identical workstations as well as deployed our application. On one server WL8.1 starts up fine. On another, it
-
Playlist always starts at the begiing after turning on iPod.
I originally posted this in the iPod classic section but thought U might get an answer here too: So I've had a 5.5 Pod loaded with many playlists for a year or so. I Just got my 160GB Classic, has about 100GB of music loaded now and the latest iTunes
-
HT5824 how do i restore the touch chat app with my vocab page on it
How do you restore my touch chat with the vobab i created?