Reading R3 table in JSP Dyn Page...URGENT
Hi All,
I have created an JSP Dynpage Application after reading this thread:
<a href="https://www.sdn.sap.com/irj/sdn/thread?messageID=3417619#3417619">https://www.sdn.sap.com/irj/sdn/thread?messageID=3417619#3417619</a>
<b>My PortalApp.xml file is:</b>
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="InteractiveList">
<component-config>
<property name="ClassName" value="com.abb.InteractiveList"/>
<property name="ComponentType" value="jspnative"/>
<property name="JSP" value="pagelet/InteractiveList.jsp"/>
</component-config>
<component-profile>
<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
</component-profile>
</component>
</components>
<services/>
</application>
My InteractiveList.java file contains:
package com.amit;
import java.util.Vector;
import com.sap.engine.lib.xml.signature.Data;
import com.sap.mw.jco.IFunctionTemplate;
import com.sap.mw.jco.JCO;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.page.PageException;
import com.sapportals.htmlb.table.DefaultTableViewModel;
import com.sapportals.portal.htmlb.page.JSPDynPage;
import com.sapportals.portal.htmlb.page.PageProcessorComponent;
import com.sapportals.portal.prt.component.IPortalComponentProfile;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
public class InteractiveList extends PageProcessorComponent {
public DynPage getPage(){
return new InteractiveListDynPage();
public static class InteractiveListDynPage extends JSPDynPage{
private DataBean DataBean = null;
public void doInitialization(){
IPortalComponentProfile profile = ((IPortalComponentRequest)getRequest()).getComponentContext().getProfile();
Object o = profile.getValue("DataBean");
if(o==null || !(o instanceof DataBean)){
System.out.println("In the IF ");
DataBean = new DataBean();
profile.putValue("DataBean",DataBean);
} else {
DataBean = (DataBean) o;
String name = "Amit ";
DataBean.setname(name);
// fill your bean with data here...
//InteractiveList interactive_list = new InteractiveList();
public void doProcessAfterInput() throws PageException {
public void doProcessBeforeOutput() throws PageException {
this.setJspName("InteractiveList.jsp");
public DefaultTableViewModel getData(String USER, String PWD,String R3ip) {
com.sap.mw.jco.IRepository repository;
JCO.Pool pool = JCO.getClientPoolManager().getPool("R3");
if (pool == null) {
//JCO.removeClientPool("R3");
JCO.addClientPool(
"R3",
10,
"120",
USER,
PWD,
"EN",
"138.223.4.106",
"00");
repository = JCO.createRepository("TTL", "R3");
JCO.Client client = null;
// Get a function template from the repository
IFunctionTemplate ftemplate =
repository.getFunctionTemplate("BAPI_SALESORDER_GETSTATUS");
// Create a function from the template
JCO.Function function = ftemplate.getFunction();
client = JCO.getClient("R3");
JCO.ParameterList input = function.getImportParameterList();
input.setValue("0053100700", "SALESDOCUMENT");
client.execute(function);
JCO.Table sales_orders =
function.getTableParameterList().getTable("STATUSINFO");
Vector row = new Vector();
Vector tbl = new Vector();
Vector colNames = new Vector();
// Loop over all rows
do {
// Loop over all columns in the current row
for (JCO.FieldIterator e = sales_orders.fields();
e.hasMoreElements();
JCO.Field field = e.nextField();
row.add(field.getString());
//System.out.println(field.getName() + ":\t" + field.getString());
} //for
tbl.add(row);
} while (sales_orders.nextRow());
sales_orders = null;
sales_orders =
function.getTableParameterList().getTable("STATUSINFO");
sales_orders.nextRow();
for (JCO.FieldIterator e = sales_orders.fields();
e.hasMoreElements();
JCO.Field field = e.nextField();
colNames.add(field.getName().toString());
DefaultTableViewModel dtvModel =
new DefaultTableViewModel(tbl, colNames);
JCO.releaseClient(client);
return dtvModel;
And my Bean Class contains following code:
package com.amit;
import java.io.Serializable;
import com.sapportals.htmlb.table.DefaultTableViewModel;
public class DataBean implements Serializable {
public DefaultTableViewModel model;
public String name;
public DefaultTableViewModel getModel() {
System.out.println("Hi There ");
return model;
public void setModel(DefaultTableViewModel model) {
this.model = model;
public String getname(){
return name;
public void setname(String name){
this.name = name;
When I try to Run the par file I am getting the Static Text in TextView but Text from myBean.getname() is not coming.
Can you tell me the reason. Is there any problem in the code.
Thanks in Advance,
Amit
Message was edited by:
Amit
Double post http://forum.java.sun.com/thread.jspa?threadID=647550&tstart=0
Similar Messages
-
Where to mention the IP address in a JSP dyn page
Hi ,
I am creating a mail sending system with Javamail.
Created the JSP dyn page,
wrote the event handler in the java file. and all.
now I have to mention the IP address of the SMTP server.
where should I do this....
inside the event handler itself?
Thanks in advance.Hi
The button tag in the jsp looks like this
<hbj:button
id="sendEmail"
text="sendEmail"
width="125px"
tooltip="Click here to send mail"
onClick="sendEmail"
disabled="false"
design="STANDARD"
/>
The function to handle the button eventing occurs in the dynpage . The function looks like
public void sendEmail (Event event) { ..coding.. }
Now when the button is clicked, the control is transferred to this event handler sendEmail and the code with init starts executed.
Hope it is clear...
Regards,
Ganesh N -
Jsp dyn page open form results in new window
Hi everybody,
I have a problem dispaying results in new window.
My portal component is a dyn page that dispay several jsp pages based on a integer switch parameter checked in the
doProcessBeforeOutput method.
One page is a form with a button that call onSearch custom method inside my component; this method process the request,
fill the bean and set the integer switch that doProcessBeforeOutput check then get the right jsp.
All works fine but I want to display the onSearch method results in a new window.
What I have to do?
Thanks,
AndreaHi Andrea,
I am also facing the same issue.
Were you able to call the component method from the JavaScript code.
I have to display the results in a new page.
Will all the methods like doProcessBeforeOutput() be executed when we traverse after the search button is clicked ?
Thanks in advance,
Brian.
Edited by: Brian Fernandes on Mar 30, 2010 12:34 PM -
Opening an Excel File using Excel 97 from a JSP populated page(Urgent)
Hello,
I am using a JSP Page to populate data from the DB.
When I am opening the same as an Excel File the JSP code is coming as the Excel page whenever Excel 97 is being used,but when Excel2000 or 2003 is being used then the data are coming as Excel formatted.I used the following code(JSP) :
<head>
<%
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","inline; filename=ExtractData.xls");
%>
</head>I can't even tell what the difference is between "coming as the Excel page" and "coming as Excel formatted". But then when people make urgent posts they very rarely spend the time to describe the problem accurately. Why bother when it's so damn urgent?
-
JSP Dyn Page want to display "Loading..." img + message
Hi, we have EP6 SP2 environment. I have a JSPDynPage component that does a lot of preprocessing then loads the jsp page. Most of the time it spends in doProcessBeforeOutput() (has to connect to 2 backends and pull some data out). it is very slow loading. Can anybody tell me how we can show a nice loading image and a message WHILE the preprocessing is done? Thank you in advance.
Well, was messing with it for a few hours last night since I got no replies - and that is what I did: I am writing out a <span><loading image> Loading...</span> in my doInitialization() function in Java (before it is doing all the backend connect). Then in a .jsp file I am hiding it with ...display ="none" call. It is a hack, but will do for now till I figure out how to display it sooner.
After deploying this to our dev Portal (which is not slow, the prod is), I realized that most of the "loading" time it spends pregenerating "other" html that is dumped on the page before my code. So will try to figure out how to speed that up. Will keep you posted. -
Sytax highlighiting for Jsp Dyn Pages for portal development.
Hey,
I am doing JSP with the htmlb taglib for portals. When I edit a jsp page in the Developer Studio, I expect syntax highlighting. This is what I see in the documentation for jsp editing as well - you know where the keywords are highlighted.
Sytax highlighiting for jsp in Developer Studio for portal development.
http://help.sap.com/saphelp_nw04s/helpdata/en/ce/e0a341354ca309e10000000a155106/content.htm
OutputSuccess.jsp, OutputSuccessText.jsp are the two jsp's that are syntax highlighted on this page.
In my Developer Studio this is not the case. Is a JSP editor and its highlighting not part of the Developer Studio. If it is, how do I get it to work.
I also know that given the right taglib's, the editor also gives autocomplete for taglibs with its settings. I am hoping to speed up my development with this.
Right now I am using a text editor for this. There are a couple of jsp plugin's such as Exadel or Lomboz which I can integrate if a jsp syntax editor is not there in the Developer Studio. I just wanted to know the right way to go about this.
Thank you for your help.
Sumit.Never mind. I was in the preview mode.
-
While Consuming a WebService in JSP Dyn Page - There is an Error
Hi Friends,
I have a web service created in ASP.NET web Service.
And I have Consumed the Web Service using WSDL URL.
I need to write a code to refer that class in the JSP DynPage
I have created like this in DoIntialization
MyServiceName obj=(MyServiceName) PortalRuntime.getRuntimeResources().getService(MyServiceName.KEY);
int a = 10;
int b = 20;
obj.Add1(a,b);
but it shows an error
"The method Add1 Method(Add1 Method) is the type. MySErviceName is not Applicable for the arguements(int,int)"
Please Help me in this regard.
Thanks in Advance
Thanks & Regards,
PalaniHi Andy,
I will let u know the sequence which i followed to consume the Webservice.
NWDS --> File --> New --> Project --> Portal Application --> Create New Portal App Project.
The Project is created.....
After that i want to consume the Webservice for the same project...
for that...
NWDS --> File --> New --> Other --> Portal Application --> Create New Portal Application Object --> Selecting My Project?(intended prjct) --> Portal Webservice --> Portal Service from WSDL file - Client Side --> My WSDL URL --> Selecting the methods which i need to expose from the Webservice --> I gave unique name for my 1) Service 2) Alias 3) Package....and that was done....(other way is to add from portalapp.xml ??)
After that i created a new JSPDyn page for my application in DoInitialization() method i tried to access the method from that webservice using the following code...
MyServiceName obj=(MyServiceName) PortalRuntime.getRuntimeResources().getService(MyServiceName.KEY);
I am successfully able to access the method from the webservice using the object which i have created but i am not able to pass arguments to that method...???
I tried consuming same webservice created in .NET in .NET itself and i am able to pass arguments successfully.
I tried to consume webservice created in ABAP in .NET and able to implement successfully...
but the same ABAP webservice when i tried to consume its not working with this NWDS.
Is there any thing else i need to follow while consuming a webservice in the EP Perspectice of NWDS ???
Deployable Proxy is required for that ?? if required how to create and use that ??
Thanks in Advance,
Palani -
Pass parameters from JSP Dyn Page to WDJ Application
Hi,
I am trying to pass parameters from my JSPDyn Page to WDJ Application.
I am using NWDS 7.1 EHP1
My code is :
function to_WEBDYNHK()
EPCM.relaxDocumentDomain();
EPCM.doNavigate
('ROLES://pcd:portal_content/Himanshu.Himanshu/TestDynUIApp?DynamicParameter="hkparam%3Dqwertyuio"');
This method is being called on click of a button.
hkparam is the parameter in question.
The JSPDyn page is an iView and the WDJ application is a page and both have been assigned to a role.
In the properties of the WDJ Page, I have removed DymanicParameter from "Do not Forward These Parameters To Web Dynpro" property.
However I am getting null as the value of hkparam in my WDJ application.
The code used is :
IWDRequest request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
String param1= request.getParameter("hkparam");
What seems to be missing here.
Please help.
I went through the documentation on SDN but it does not seem to help.
TIA,
HimanshuHi Himanshu,
Try this code.
EPCM.doNavigate("ROLES:portal_content/Himanshu.Himanshu/TestDynUIApp?hkparam=Dmypass1123")
if the parameter is hkparam and the value to be passed is Dmypass1123. You need not change any design time property of the WD page, and WDProtocolAdapter should retrive the parameter.
Regards,
Vishweshwara P.K.M. -
Response object in JSP Dyn page
Hi SAP EP Gurus,
I want to use response.setStatus() mehtod in jspdynpage but it is not working as expected. I am able to use other methods of response object like response.write().
As per my knowledge if i set response.setStatus(200) is should send error to client but it is not seding error.
It is working as same for both response.setStatus(200) and response.setStatus(500).
Is there any special way to use response.setStatus() in portal? It is working as expected in normal jsp application.I tried but had no luck. Below is my JSPDYNPAGE code...
<%@ page import="javax.servlet.http.HttpServletResponse" %>
<%@ page import="com.sapportals.portal.prt.component.IPortalComponentRequest,com.sapportals.portal.prt.component.IPortalComponentResponse"%>
<HTML>
<head>
</head>
<body>
<%
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
HttpServletResponse servletResponse = request.getServletResponse(true);esss
servletResponse.setStatus(500);
%>
</body>
</HTML>
It is not working showing portal run time error -
Modify MSS with version 60.1.18 ( JSP Dyn Page Concept)
Hi All,
We are working with MSS Business package.Our requirement is to display the custom fields data(infotype P0006) in Emergency contact details in the employee profile details.We were able to track the par file from the business package.
It is com.sap.pct.hcm.eeprofileemergencycontact
Also SAP has not given Source code to modify, can we use de compilers to get the code and modify it as per the requirement.
What needs to be done by us to achieve this.
It is using JCO to connect to SAP.
It is calling the bapi HRWPC_RFC_ADDRESS_GETLIST.
Now if we require those custom fields I think I need to copy the code of the SAP FM and need to change it.And also observed that Class names , data stucture names are hardcoded in the code.
For example Hrwpc_S_AddressType is one of the class used.
How is SAP creating these class files. What I guess there must be standard way to generate the required class files when I need to call a FM in SAP.
Can any one let me know the way to achieve this requirement.
Regards,
ND.Hello Roy,
Did you create two aliases for the R3 system named "SAP_R3_HumanResources" and "SAP_R3_Finanacials".
Just confirm the names (case sensitive)
Hope this helps..
Pradeep -
Access denied when trying to show table in jsp fragment?
I've had one page which has been groving obese over time.
Now I've started to split out parts into jsp fragments using f:subview
<f:subview id="frontStoreSupport">
<jsp:include page="/frontStoreSupport.jsff"/>
</f:subview> The new jsp fragment (frontStoreSupport.jsff in this case) has it's own frontStoreSupportPageDef.xml which contains the binding entries I use in the page.
My problem is that ADF Read Only table's on this page get an "Access denied." where the content is supposed to go, despite the fact that they worked fine
in the original page.
I've been into the Application > Security > Resource grants and added view to my application role, exactly like it was set up in the first page..
Any hints here would be greatly apprichiated
Regards
BaueOk, realized what the problem was - apparently, when using ADF components in a fragment, you need to add the datacontrol to the fragments page-definition file AND to the parent jsp:s page-definition file!
-
Insert data into table from JSP page using Entity Beans(EJB 3.0)
I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
1. I have a table 'FRIENDS', (in Oracle 10g database).
2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
5. I am using JDev as editor.
Please provide me code ASAP or link with similar example.
Thank you.
AnuragHi,
I am also trying that scenario. So u can
Post the jsp form data to a Servlet which will act as a Controller.
In the servlet invoke the business method.
Similar kind of app is in www.roseindia.net
Hope this would help u.
Meanwhile if u get any optimal solution, pls post it.
Thanks,
Happy Java Coding. -
I Have a EO/VO called "Customers" and a EO/VO called "authorized".
Well, in the EO/VO "authorized" I have a attribute "Customer_ID".
I need show this in Read-Only-Table.
Customers_Name | Authorized_Name
AAA xxxx
AAA yyyy
BBB vvvv
1.Structure EO/VO Customers:
Customers_ID
Customers_Name
2. Structure EO/VO Authorized:
Authorized_ID (PK)
Customers_ID (PK)
Authorized_Name
Please, how to do this ?OK,
I made this and show-me the correct results, but in this table I have two links:
-> A edit link
-> A delete link.
When I click in the links, don't synchronizes.
Why ?, because in the edit page I have a second iterator ?
exists a example to this ? -
How to display table in jsp pages
hi all ,
i want to diaplay the table in jsp page...ie,if i click on some option then i need to get the table in jsp page
wiil u plz help me
thanks in advance
chintuhi all..
i didnt ask how to design table in jsp...i am asking how to diaplay the table with data already stored in database...i just want to retrive the values in table and display in jsp.....
thanks in advance...
chintu -
Urgently Need Code for Copy & Paste from Html Table in JSP to Excel file
I am creating a html table in JSP file .
I need code for 'Cut,Copy,Paste' functions ie. if someone wants to copy data from my table to excel file or from excel file to html table he shud be able to do that.
Can someone give me code for 'Cut,Copy and Paste' i.e. some javascript functions which can do cut, copy and paste which i can put in my jsp file
Thanks
Message was edited by:
javatechguru2007package com.chinmayananda
public class Tetris{
// complete here
code]
public abstract class AbstractTetris {
public abstract void start();
public abstract void stop();
}nearly done
Maybe you are looking for
-
Installing RCU 11.1.1.6 Getting error Unknown Master and Work Repository
Hi All, While installing RCU 11.1.1.6 I am getting error "unknown Master and Work Repository" could any one please tell me the solution for this Thanks Kumar
-
Arch 0.7.1 pre1 kernel headers
i have read that the kernel headers are included with the kernel packages, which is very nice because i have a sagem fast 800 modem and i need to compile drivers for it. Except for when i installed arch a few days ago i tried to compile my module and
-
Move account to another forest
Dear. We have two forests with a forest trust between them. Today, our users are in Forest A, their Exchange 2013 mailbox too. We want to move the user accounts to Forest B while their mailbox remains in forest A.The accounts are synced between both
-
How do I create a pattern like this in Illustrator?
Hello, I know how to create a dotted pattern using swatches or brushes but this pattern is benden afterwards. I really need to have the same bended effect. In the middel the dots are aligned perfectly vertically next to one another, at the bottom not
-
Moving pictures form iPhone to my PC
Does anyone knows a way to move pictures taken from iPhone to my PC. It is crazy to email each picture to be able to save on my PC folder. Please let me know if there is a way. Thanks