Using dynpages
hi
i am presently working on both dypages and
jspdynpage and i am using javascript to put the data in the
dropdownbox , is it possible that we access
backend as in using Adaptive RFC in webdynpro
any such way here , this is my first try ,
or any alternative ?
Hi,
u can use jco connection for the same which u can download from http://service.sap.com/connectors.
1.Download the zip file and unpack it into any directory.
2.Copy the file librfc32.dll into the directory C:\WINNT\system32.
3.Add sapjco.jar to the classpath of the
Java project.
4.Required import statement:
import com.sap.mw.jco.*;
Then make two classes and write code as mentioned in example below:
public class JCoTest {
public static void main(String[] args) {
if (JCoSpfliGetDetail
.connectToSAP("xxx", "xxxxxxx", "xxxxxxx", "xx",
"xxxx", "xx")) {
JCoSpfliGetDetail.showConnectionDetails("LH", "400");
JCoSpfliGetDetail.disconnectFromSAP();
public class JCoSpfliGetDetail {
private static JCO.Client mConnection = null;
private static JCO.Function function = null;
private static JCO.Repository mRepository = null;
//Connect to SAP
public static boolean connectToSAP(
String client,
String user,
String passwd,
String lang,
String appServer,
String sysNo) {
try {
mConnection = JCO.createClient(
client, //SAP client
user, //userid
passwd, //password
lang, //language
appServer, //app server host name
sysNo); //system number
mConnection.connect();
mRepository =
new JCO.Repository("JA100", mConnection);
} catch (Exception e) {
e.printStackTrace();
return false;
return true;
//Call Remote Function Module
public static void showConnectionDetails(String carrid,
String connid) {
function =
JCoSpfliGetDetail.createFunction("SPFLI_GETDETAIL");
if (function == null)
throw new RuntimeException(
"Remote Function Module not found");
//Supply the import parameters of the RFM
JCO.ParameterList im_param =
function.getImportParameterList();
im_param.setValue(carrid, "CARRID");
im_param.setValue(connid, "CONNID");
mConnection.execute(function);
//Disconnect from SAP
public static void disconnectFromSAP() {
mConnection.disconnect();
//Create instances of class JCO.Function
private static JCO.Function createFunction(String name) {
IFunctionTemplate ft =
mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
Regards
Priyanka
award if helps
Similar Messages
-
How to display sample text using dynpage ?
Hi All,
I am developing the portal using dynpage technology. I do not know whether I am posting this thread in the right place.
How to display a sample text in the portal using dynpage?
I have written it using HTMLFragment. But it could not recognise the <> tags it seems.
I am getting error in < and in \. Can anyone pls help to resolve this?
I tried with normal html tags. It could not recognise the tags.
Pls suggest.
Regards,
Subashini.
Edited by: Subashini on Sep 16, 2008 7:48 AMDo read through this tutorial.
http://help.sap.com/saphelp_nw70/helpdata/EN/95/cfa441cd47a209e10000000a155106/frameset.htm
Thanks,
GLM -
How to make Finder use a copied .DS_Store file?
Hi,
since the Finder still does not allow applying view options to multiple folders I tried, yet again, to do this manually:
Create folder A and populate with stuff
Create folder B and populate with stuff
Verify that both folders use the system default folder view options
Verify that no Finder window shows the contents of A or B
Change the view options on folder A
Copy the .DS_Store file from folder A to folder B including the extended attributes
Kill the Finder
Open a Finder window in folder B and still it shows the system default view options
Folder A is still fine
Steps 6 and 7 were performed and verified in the shell (Terminal) with cp, xattr and kill etc.
Which process do I need to kill in order for the Finder window of folder B to reflect the copied view options?
Or is the inital approach of copying a .DS_Store file already wrong, where else are these options stored?
ThanksHi Guang!
We faced the same problem with webdynpro. The result of our research was to switch to JSP Dynpage Components to have full control of layout and design. There is no known way to include your own css, since the webdynpro controls use the portal display scheme css classes. You probably can overwrite them with own css, using a combination of css and javascript, but it's a process that will cost you plenty.
Using Dynpages instead of webdynpro may not be an option in your case, though, depending on what other features of webdynpro you are using.
Regards,
Jürgen -
Hi
I have created an application for password change using dynpages.....In that I want to display 4 rules for the password.....But I am having a problem of inserting a blank line in between ..Could some one please help me on how to skip a line
Regards
KrishnaHi,
In that code use line break (br) used in html with angle brackets (<break>)inside the myForm.addRawText( )in double quotes. Actually that is not visible in the previous reply because of some problem in displaying the code.
i am not able to give the exact code clearly due to this problem .so please understand from this.or if u r not able to understand give ur mail id i will give u there.
Regards,
Tamil K
Message was edited by:
Tamil Venthan -
Write to Excel file in KM Folder with DynPage
Hi,
I want to create and read/write to a Excel file in KM Folder using DynPage.
Searched the SDN but could not get any links which will demo on using excel with Dynpage. Lot of links to use excel with WebDynpro are available.
Can anyone give the code or links for this purpose.
Regards
SumantHi,
May be we can expect a blog for this too.. Actually, it is not very different. You can use the same blog for your purpose.
Uploading files to KM repository using Webdynpro APIs
Creating folders in KM dynamically
Here the code can be written in doContent or doProcessBeforeOutput method. Import the required jars. References can be written in SharingReferences in application-config of portalapp.xml. Otherwise, the same code should work in portal application too.
Regards,
Harini S -
hi
iam using dynpage where i have
used DROPDOWNLISTBOX which has mutiple
items , now on i need to fetch the index and text of the
items in the dropdown using java script , how is this possible
can any one help me , its very urgent ?What is "dynpage"?
Armin -
Download a text file to client machine
Hello everyone,
I'm trying to implement a report in EP6 SP2 version using Dynpage. I have it working perfectly, where in it displays the result in a Tree Format. But now the client wants a button, on clicking which it should download everything in a text file. I'm thinking of creating a text file and using FileOutputStream dumping the data into a text file. But I dont know how to open that text file or download it to the client machine ?
Can someone helpme with this ?
Thanks.Another thing you can do is create a table that you can insert the results of the UTL_FILE export. This table will basically track all of your UTL_file exports. You would just have to have three columns in the table. An ID, Filename, Directory. The ID would be your Primary Key, Filename would be the name of the file, and the Directory, would be directory in which the file is in. Then you can build a portal dynamic page that selects the results with a hyperlink. Then everything will work dynamically. Let me know if you have any questions.
Thanks,
Martin -
Urgent !!! Feedback Form Development
Dear all
I was trying to develop the Feedback form. I'm attaching the Source code below. According to the experts ...everybody suggested that..instead of using Service providers for sending mail...everybody using KM Services for sending mails. we already installed KM and collaboration.
Can anyone..pl help me..to achive this feedback development.
Kindly send me the code if anyone developed same kind of form using KM Services for sending mail...
or do correct me my code...what went wrong.
package Com.pradeep.Feedback;
import java.util.GregorianCalendar;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import com.sapportals.htmlb.enum.ButtonDesign;
import com.sapportals.htmlb.enum.DataType;
import com.sapportals.htmlb.enum.GroupDesign;
import com.sapportals.htmlb.enum.TextViewDesign;
import com.sapportals.htmlb.page.DynPage;
import com.sapportals.htmlb.event.Event;
import com.sapportals.htmlb.page.PageException;
import com.sapportals.htmlb.*;
import com.sapportals.portal.htmlb.page.PageProcessorComponent;
public class feedback extends PageProcessorComponent {
public DynPage getPage() {
return new MyDynPage();
public class MyDynPage extends DynPage {
private final static int INITIAL_STATE = 0;
private final static int SENTMAIL_STATE = 1;
private final static int ERROR_STATE = 2;
private final static int NO_FEEDBACK = 3;
private int state = INITIAL_STATE;
private String email_from;
private String txtdescr;
private String error_messg;
Things to initialice once per session.
public void doInitialization() throws PageException {
state = INITIAL_STATE;
Will be called if forms with data was send.
public void doProcessAfterInput() throws PageException {
InputField myInputField = (InputField) getComponentByName("EMAIL_ADDR");
HtmlEdit txtdescr = (HtmlEdit)getComponentByName("Edit_Text");
if (myInputField != null) {
this.email_from = myInputField.getValueAsDataType().toString();
if (txtdescr != null) {
this.txtdescr = txtdescr.getText();
Will always be called before output. So this is the method in which
the components will be placed and set.
public void doProcessBeforeOutput() throws PageException {
System.out.println("doProcessBeforeOutput");
Button myButton;
Form myForm = getForm();
Group myGroup = new Group();
myGroup.setWidth("370");
myGroup.setTitle("Suggestions or Feedback");
myGroup.setDesign(GroupDesign.SAPCOLOR);
myForm.addComponent(myGroup);
GridLayout gl = new GridLayout();
myGroup.addComponent(gl);
switch (state) {
case INITIAL_STATE:
GridLayout g2 = new GridLayout();
g2.setCellSpacing(4);
TextView txtdescr = new TextView("We want to make your opinion count so please provide any relevant suggestions or feedback you may have. We will review all feedback in an effort to provide you with better services and improve the overall portal. Enter your comments below and click send.");
txtdescr.setWrapping(true);
txtdescr.setDesign(TextViewDesign.HEADER3);
g2.addComponent(1, 1, txtdescr);
TextView txtthank = new TextView("Thank you for your feedback!");
txtthank.setDesign(TextViewDesign.HEADER3);
g2.addComponent(2, 1, txtthank);
gl.addComponent(1,1,g2);
GridLayout g3 = new GridLayout();
TextView txtemail = new TextView("Your email address (optional): ");
txtemail.setDesign(TextViewDesign.HEADER3);
g3.addComponent(6, 1, txtemail);
InputField email_addr = new InputField("EMAIL_ADDR");
email_addr.setType(DataType.STRING);
email_addr.setSize(40);
email_addr.setMaxlength(50);
g3.addComponent(6, 2, email_addr);
gl.addComponent(2,1,g3);
HtmlEdit he = new HtmlEdit("Edit_Text");
he.setHeight("300");
he.setWidth("405");
he.setDoPreview(false);
he.setDoPrint(false);
he.setDoCutCopyPaste(true);
he.setDoList(true);
he.setDoAlign(true);
he.setDoInOutdent(true);
he.setDoImage(false);
he.setDoLink(true);
he.setDoLinkKM(false);
gl.addComponent(5, 1, he);
myButton = new Button("submit", "Send");
myButton.setOnClick("onSubmit");
myButton.setWidth("100px");
myButton.setDesign(ButtonDesign.EMPHASIZED );
gl.addComponent(7, 1, myButton);
break;
case SENTMAIL_STATE:
TextView label = new TextView("Thank you for your feedback.");
gl.addComponent(1, 1, label);
break;
case NO_FEEDBACK:
TextView lblnotext = new TextView("Please enter some feedback.");
lblnotext.setDesign(TextViewDesign.HEADER3);
gl.addComponent(1, 1, lblnotext);
myButton = new Button("submit", "Back");
myButton.setOnClick("onBack");
myButton.setWidth("100px");
myButton.setDesign(ButtonDesign.EMPHASIZED );
gl.addComponent(2, 1, myButton);
state = INITIAL_STATE;
break;
case ERROR_STATE:
TextView errortext = new TextView(error_messg);
errortext.setDesign(TextViewDesign.HEADER3);
errortext.setWrapping(true);
gl.addComponent(1, 1, errortext);
myButton = new Button("submit", "Try Again");
myButton.setOnClick("onBack");
myButton.setWidth("100px");
myButton.setDesign(ButtonDesign.EMPHASIZED );
gl.setCellSpacing(4);
gl.addComponent(2, 1, myButton);
state = INITIAL_STATE;
public void onSubmit(Event event) throws PageException {
if (txtdescr.equals("")) {
state = NO_FEEDBACK;
else {
send_mail();
if ( state != ERROR_STATE )
{ state = SENTMAIL_STATE; }
public void onBack(Event event) throws PageException {
public void send_mail ()
try{
// Set the host smtp address
Properties props = new Properties();
//put the smtp server here
props.put("123.12.12.25", "unilever.com");
// create some properties and get the default Session
Session session = Session.getDefaultInstance(props,null);
// create a message
Message msg = new MimeMessage(session);
// set the from and to address
InternetAddress addressFrom;
if (email_from.equals("") )
addressFrom = new InternetAddress("anonymous");
else
addressFrom = new InternetAddress(email_from);
msg.setFrom(addressFrom);
InternetAddress addressTo = new InternetAddress("[email protected]");
msg.setRecipient(Message.RecipientType.TO,addressTo);
msg.setSubject("Portal Feedback");
msg.setContent(txtdescr, "text/html");
msg.setSentDate(new GregorianCalendar().getTime());
Transport.send(msg);
} catch (Exception E){
state = ERROR_STATE;
error_messg = "Error sending mail:";
error_messg = error_messg.concat(E.getMessage());
Kindly pl help me
thx
pradeepHi Pradeep,
Check out the following weblog. It explains sending mail in portal using dynpage.
<b>How to perfom Mailing in portal using Dynpage.>
REgards
Rajeev.
Do award points for helpful answers in SDN. -
Hi all,
I am using DynPage for my development.
I have 6 iViews in a page.1 iView will be in left side,and the other iViews are in right side(same position).
based on the user click the link from left iView,I have to make visible the other iViews in right side.
See my code..
public void doProcessBeforeOutput() throws PageException {
Form form = (Form)this.getForm();
Link link1 = new Link("outfrontnow");
link1.setTarget("_self");
link1.addText("Link to OutFrontNow RSS");
link1.setOnClientClick("doRelativeNavigate()");
form.addRawText("<SCRIPT language ='JavaScript'>"
+"function doRelativeNavigate(){"
+"EPCM.doRelativeNavigate( \"ROLES://portal_content/RSS_BP/com.wipro.Rssuser/com.wipro.RSS/OutFront\");"
+"}"
+"</SCRIPT>"
form.addComponent(link1);
The other iView is opening in a new page in portal.
But as I said I want to open the other iView in right side of the same page.
How do I achieve this?
Could anyone please help me.
Thankx in advance.
Regards,
SwapnaHI Swapna
You can choose a Page layout, say with two columns. Add all your iViews to this page.
You can then edit the <a href="http://help.sap.com/saphelp_erp2005/helpdata/en/85/09e13dc2fd605ae10000000a11405a/frameset.htm">page layout</a> where you can drag and drop the iViews into the desired containers.
Check out the that link and do revert back.
Best Regards
Priya -
I am experiencing a problem where the response from my component is empty.
I have performed tracing and I noticed that the thread simply stops. No exception is raised. Not in my logs and not in any of the portal logs.
I though that this occurs only in a single place in my Component, only it happend in more than one place....
I have thought about timeout but this happend 1, 10,20,27 and other seconds from the initial request.
Anyone has an idea? Because I am realy lost.
Thanks,
A'zHi Darrell,
Not recently, but I have had such a problem (not sure in what area though).
It is as if only the HTML which is produced automatically exists, but my return data is not.
I have implemeneted an IPortalComponent and not using DynPage, if this helps you.
Thanks,
Azriel. -
How to insert/Update date into Dictionary Table?
Dear Experts,
I have created a Dictionary Project and Deployed.I think the table had created in portal database.
now i want to insert some data into that table?
Can you plz tell me how to access the table using Abstract Portal Component using DynPage.
Waiting for ur replies...
Thanks and Regards,
Visweswar.Hi
Can u share the Logic??? -
I am trying to run two xlets with xletRunner in Eclipse IDE with arguments as follows
-name SimpleXletDemo -path D:/workspace/xlet -name SimpleXletDemo -path D:/workspace/xlet
I am getting the first xlet displayed after that it's showing the following runtime error
java.security.AccessControlException: access denied (java.io.FilePermission D:\workspace\xlet read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.exists(Unknown Source)
at com.sun.xlet.XletManager$4.run(XletManager.java:488)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xlet.XletManager.createXlet(XletManager.java:485)
at com.sun.xlet.XletRunner.main(XletRunner.java:118)
Error while loading xlet: java.security.AccessControlException: access denied (java.io.FilePermission D:\workspace\xlet read)
can anybody tell where i am going wrong in running two xlets.
thanks in advance.HI charlotte meunier-despins,
Thaks for the information. i will try using dynpage. if possible Can you please send me one ".par" file which you have created using JSP pages. i can cross check how i am creating.
once again Thanks for the information.
Regards
Sumanth -
Hello all,
I'm developing using DynPage.
using the session to store information.
I'm getting the following error message from Internet Explorer:
"Session management will not work!
Please check the DSM log file for details."
Does anyone knows how to solve that?
where can I find this DSM log file?
Thanks for your time, Adi.Hi Adi,
Are you using the component or HTTP session?
Does the error occur when you are writing to or reading from the session?
Can you post some code?
Best regards,
Patrick.
EDIT:
Another question for you Adi, do you get this error message but storage in the session works or do you get this error message and storage in the session does not work?
Sounds like a strange question I know but a search on the forums returned
<a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=36645">this thread</a> where Roy Cohen says
I was able to disable this message at the "Support Desk" area
So if the stoarge works although you get this error displayed perhaps you can just turn the error off.
Message was edited by: Patrick O'Neill -
1. Is there a way to have a onChange/focus lost event for an InputField? I saw the <bsp> find and replace solution, but I need a jsp version. I need to dynamically calculate field values when a value is entered in the inputfield!
2. How do you handle eventing for dropdownlistboxes (HTMLB using DynPages). how do you get the values for the selected items in your event handler method in DynPage?Hi Siddhartha,
Even I'm unaware of the first issue. But for the second issue, the sol - if you have htmlb dropdownlistbox, use property <b>"onSelect"</b> as given below.
<hbj:dropdownListBox
id="Tbox"
width="400"
selection ="<%=myBean.getSelection() %>"
model="myBean.model"
onSelect="onDDSelect">
<b>In DynPage - call the method </b>
public void onDDSelect(Event event) throws PageException
DropdownListBox sf = (DropdownListBox)
getComponentByName("Tbox");
sel = sf.getSelection();
Hope this helps.
Thanks,
Praveen
PS: Dont forget to award points if you find it useful or solved. -
How to use a portal service in portal component(DynPage)
Hi,
I have made a portal service and i want to use this in my portal component .
Please tell me how can i use it.
also can anyone tell me step wise creation of portal component and portal service and their connectivity by using a smalll example in which connectivity is done in Dynpage and using stored procedure .Hi,
Check this link:
[How to Create a Portal Component and a Portal Service Tutorial|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0b57e590-0201-0010-a29f-abd37a436f54?QuickLink=index&overridelayout=true]
Thanks and Regards,
Shyam
Maybe you are looking for
-
Source code has syntax error in SAP PI7.1 Mapping Test
HI All, IN SAP P7.1 created simple two data types, message types and Message Mapping with only 2 fields. While testing the mapping in Message Mapping it is giving the error as Source text of object Message Mapping: MM_Source_to_Target | http://abc.c
-
Can't connect to router's admin interface (WRT54G v3.1)
Hi. I have problem with my Linksys WRT54G v3.1 router. I can't connect to its admin interface and broadband Internet connection doesn't work. The power LED is flashing. When I restart the router or unplug and plug it again, nothing happens. The power
-
I recently purchased an album on itunes and it keeps saying there is an error downloading?
It keeps saying there was an error when I try and download and to check my network connection. The itunes store works fine and so does my internet, I have restarted my computer and itunes it still won't work. Does anyone know how to fix this or how I
-
Hi. We have a problem with the connection of several CPEs (non-cisco). these CPEs sends a PADR with a size of 129 bytes, then our concentrator (7200) doesn't accept the connection: Jan 7 09:27:25.325: [818]PPPoE 397: Service request sent to SSS Jan
-
How to use Adobe Flash Player with .swf files?
Hey, I have a .swf file that I'am trying to open but it seems that I can't. Is there any way that I can use Flash Player to do so? The .swf I'm trying to open is a game, when i right-click on it and i click on Open With, I don't see Flash Player as o