Java Mail Project HELP Required....URGENT PLZ HELP!!!
hello there!!
i took up a pjct for my engineering on java mail..got the code..and i thought that ill analyse it...the code is submitting the mail to the smtp server but after dat its failing to deliver to the client..as i can see this error in the logs on SMTP server...can anyone help me out in analysing this code!!!
plz help, exams are near...(am new to java)
//java FINAL!
import javax.swing.*;
import java.net.URL;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class EmailProg extends JPanel implements ActionListener {
protected JTextArea textArea;
protected String newline = "\n";
static final private String composemail = "compose";
static final private String sendmail = "send";
static final private String about = "about";
static final private String submit = "submit";
static final private String exit = "exit";
JLabel lSubmit = new JLabel("Submit");
JButton subbutton = new JButton();
JTextArea emailfrom = new JTextArea(1,1);
JTextArea emailto = new JTextArea(1, 1);
JTextArea emailsubject = new JTextArea(1, 1);
JTextArea emailmessage = new JTextArea(25, 1);
//------BAG LAYOUT
JLabel lFrom = new JLabel("From:");
JTextField cFrom = new JTextField(32);
JLabel lTo = new JLabel("To:");
JTextField cTo = new JTextField(32);
JFrame frame2 = new JFrame("Compose New");
JLabel lSubject = new JLabel("Subject");
JTextField cSubject = new JTextField(32);
JLabel lMessage = new JLabel("Body");
JTextArea cMessage = new JTextArea(5,32);
//====================================
public EmailProg() {
super(new BorderLayout());
//Create the toolbar.
JToolBar toolBar = new JToolBar();
addButtons(toolBar);
//Create the text area used for output. Request
//enough space for 5 rows and 30 columns.
textArea = new JTextArea(5, 30);
textArea.setEditable(false);
textArea.setText("Welcome to Jeff's email program! With this program you can compose and send emails. I hope I get a good grade on thise, and marine world finds a good use for it :-D:-D (implements really just testing the scroller!!!)");
JScrollPane scrollPane = new JScrollPane(textArea);
//Lay out the main panel.
setPreferredSize(new Dimension(450, 110));
add(toolBar, BorderLayout.NORTH);
add(scrollPane, BorderLayout.CENTER);
//==================================
protected void addButtons(JToolBar toolBar) {
JButton button = null;
//first button
button = makeNavigationButton("/toolbarButtonGraphics/general/ComposeMail24.gif", composemail ,"Compose new Email", "compose new");
toolBar.add(button);
//second button
button = makeNavigationButton("toolbarButtonGraphics/general/SendMail24.gif", sendmail,"Send The Mail","send");
toolBar.add(button);
//third button
button = makeNavigationButton("toolbarButtonGraphics/general/About24.gif", about,"About","About");
toolBar.add(button);
//exit button
button = makeNavigationButton("toolbarButtonGraphics/general/Stop24.gif", exit, "Exit", "Exit");
toolBar.add(button);
//===================================
protected JButton makeNavigationButton(String imageName, String actionCommand, String toolTipText, String altText) {
//Look for the image.
String imgLocation = imageName;
URL imageURL = EmailProg.class.getResource(imgLocation);
//Create and initialize the button.
JButton button = new JButton();
button.setActionCommand(actionCommand);
button.setToolTipText(toolTipText);
button.addActionListener(this);
if (imageURL != null) { //image found
button.setIcon(new ImageIcon(imageURL));
} else { //no image found
button.setText(altText);
System.err.println("Resource not found: "+ imgLocation);
return button;
//=============================
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
String description = null;
// Handle each button.
if (exit.equals(cmd)){
textArea.setText("");
description = "EXITING";
System.exit(0);
if (composemail.equals(cmd)) { //first button clicked
textArea.setText("");
description = "Write new mail.";
composeWindow();
} else if (sendmail.equals(cmd)) { // second button clicked
textArea.setText("");
description = "This button does'nt do anything yet :x";
} else if (about.equals(cmd)) { // third button clicked
textArea.setText("");
description = "About this program. (See pop-up)";
coolWindow();
else if (submit.equals(cmd))
if (cFrom.getText().equals("")||cTo.getText().equals("")||cSubject.getText().equals("")||cMessage.getText().equals(""))
textArea.setText("One or more of the fields was not filled in.");
else{
try {
String smtpServer="serverhere";
String to=cTo.getText();
String from=cFrom.getText();
String subject=cSubject.getText();
String body=cMessage.getText();
send(smtpServer, to, from, subject, body);
textArea.setText("");
description = "Mail Sent.";
JOptionPane.showMessageDialog(null, "Message Sent.");
catch (Exception ex)
System.out.println("Usage: java com.lotontech.mail.SimpleSender"
+" smtpServer toAddress fromAddress subjectText bodyText");
//CLOSE THE FRAME2 WINDOW IIIIIIIIFFFFFFF SENDING IS SUCCESSFUL!!
}//end of else during send
}//end of if of submit
displayResult(description);
//============================
protected void displayResult(String actionDescription) {
textArea.append(actionDescription + newline);
//=============================
public void coolWindow() {
JFrame frame = new JFrame("About");
JTextArea filecontents = new JTextArea();
filecontents.setText("Use the tool bar to compose\n compose new emails, in which you can\n send to anyone on the\n srvhs email server. \n Fill in all the blanks before pressing send. If you dont\n you will receive an error! \n For more information about this program click on the\n information button.");
frame.getContentPane().add(filecontents, BorderLayout.CENTER);
frame.pack();
frame.setResizable(false);
frame.setSize(300,200);
frame.setVisible(true);
//===============================
public void composeWindow() {
frame2.getContentPane().setLayout(new GridBagLayout());
frame2.setResizable(false);
frame2.setSize(600,500);
frame2.setVisible(true);
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(5, 10, 5, 10);
cMessage.setLineWrap(true);
subbutton = makeNavigationButton("toolbarButtonGraphics/general/SendMail24.gif", submit,"submit","submit");
addRow(gbc, lFrom, cFrom);
addRow(gbc, lTo, cTo);
addRow(gbc, lSubject, cSubject);
addRow(gbc, lMessage, cMessage);
addRow(gbc, lSubmit, subbutton);
//===============================
private void addRow(GridBagConstraints gbc, Component left, Component right) {
gbc.gridx = GridBagConstraints.RELATIVE;
gbc.gridy = GridBagConstraints.RELATIVE;
gbc.gridheight = 1;
gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.EAST;
frame2.getContentPane().add(left, gbc);
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.WEST;
frame2.getContentPane().add(right, gbc);
frame2.pack();
//=======================
public static void send(String smtpServer, String to, String from, String subject, String body) {
try {
Properties props = System.getProperties();
props.put("localhost", smtpServer);
Session session = Session.getDefaultInstance(props, null);
System.out.println(smtpServer);
// -- Create a new message --
Message msg = new MimeMessage(session);
// -- Set the FROM and TO fields --
msg.setFrom(new InternetAddress(from));
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
// -- We could include CC recipients too --
// if (cc != null)
// msg.setRecipients(Message.RecipientType.CC
// ,InternetAddress.parse(cc, false));
// -- Set the subject and body text --
msg.setSubject(subject);
msg.setText(body);
// -- Set some other header information --
msg.setHeader("X-Mailer", "LOTONtechEmail");
msg.setSentDate(new Date());
// -- Send the message --
Transport.send(msg);
System.out.println("Message sent OK.");
catch (Exception ex)
ex.printStackTrace();
public static void main(String[] args) {
JFrame frame = new JFrame("EmailProg");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
EmailProg newContentPane = new EmailProg();
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
}
The code to retrieve the messages from SMTP
finally all working fine...
thanx guys!!!
package EmailProg;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
* A simple email receiver class.
public class SimpleReceiver
* Main method to receive messages from the mail server specified
* as command line arguments.
public static void main(String args[])
try
String popServer=args[0];
String popUser=args[1];
String popPassword=args[2];
receive(popServer, popUser, popPassword);
catch (Exception ex)
System.out.println("Usage: java com.mail.SimpleReceiver" +" popServer popUser popPassword");
System.exit(0);
* "receive" method to fetch messages and process them.
public static void receive(String popServer, String popUser, String popPassword)
Store store=null;
Folder folder=null;
try
// -- Get hold of the default session --
Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props, null);
// -- Get hold of a POP3 message store, and connect to it --
store = session.getStore("pop3");
store.connect(popServer, popUser, popPassword);
// -- Try to get hold of the default folder --
folder = store.getDefaultFolder();
if (folder == null) throw new Exception("No default folder");
// -- ...and its INBOX --
folder = folder.getFolder("INBOX");
if (folder == null) throw new Exception("No POP3 INBOX");
// -- Open the folder for read only --
folder.open(Folder.READ_ONLY);
// -- Get the message wrappers and process them --
Message[] msgs = folder.getMessages();
for (int msgNum = 0; msgNum < msgs.length; msgNum++)
System.out.println(msgs[msgNum]);
catch (Exception ex)
ex.printStackTrace();
finally
// -- Close down nicely --
try
if (folder!=null) folder.close(false);
if (store!=null) store.close();
catch (Exception ex2) {ex2.printStackTrace();
}
Similar Messages
-
Help required urgently please help
i am facing problem on oracle 9i platform the problem is
ORA-00379: no free buffers available in buffer pool DEFAULT for block size 16K
WHILE I AM EXECUTING THIS SQL COMMAND
SELECT * FROM PR_RMRDDATA_M
PR_RMRDDATA_M IS ONE OF MY VERY BIG TABLEBPeasland wrote:
I guess a response after 4.5 months means the help was not required urgently. ;)
Cheers,
BrianGlance at the timestamps again...
It wasn't 4.5 months. It was a year and 4.5 months.
<insert smiley emoticon here>
Additionally, the original poster abandoned the thread after they stopped shouting at everyone.
Their username profile shows they almost never return to mark anything "resolved".
This thread is now locked to prevent more "me too" resurrection posts. -
How to install adapters in pi 7.0 ex(tibco adapter) its urgent plz help
hi friends
can any one help me how to insatlll the tibco adapter in pi 7.0 its urgent plz help
thanks in advance
bye
rajaHi Raj,
Is your Sender System Tibco If so Use JMS Adapter to get the Data from tibco and Use IDOC Adapter to Post in R3. For this you no need to Install any Adapter in XI System.
Similar discussions ,
XI integration with Tibco
XI Integration with Tibco EMS (Using JMS Adapter)
Regards
Agasthuri Doss -
I found an IPhone and tried to return it but we couldnt. I thought if make good use of it. It say Activate Phone Connect to ITunes. everytime I try it say Activation required. Plz help?!?
Mla1234 wrote:
I found an IPhone and tried to return it but we couldnt.
Try harder. It is useless to you.
Mla1234 wrote:
It say Activate Phone Connect to ITunes. everytime I try it say Activation required.
The Apple ID and Password that was Originally used to Activate the iDevice is required
If you do not have that information you will not be able to use the Device.
Activation Lock in iOS 7 > http://support.apple.com/kb/HT5818 -
HI
i like playing fifa and i wanted to start a fifa 14 ultimate team but th problem is that i know some things about fifa but not too much and i was wondering if you guys/girls can helpl me out
you see the problem is that i dont know how to start off fifa 14 ultimate team lke what should i do when i start off and what should i should i do after
i tried fifa ultimate team before and was no good because i always had no money left and my players were bronze and had no more contracts so can you guys/girls help m out plz
plz help me out and reply back to me by this post plz need your help a lot plz help me plz
thanksIt's best to Google for answers. Here's one.
http://www.fifauteam.com/fifa-14-mobile-ios-android/
Cheers, Tom -
Java Mail,SMTP server not starting,help required urgently
Hi i have been working on java mail .Yesterday it was working ok but today suddenely i am getting this thing.its not starting the smtp server i guess,just exiting and get the command prompt ..dont know what to do.help required how to go about this error
am pasting the debug information.please check and let me know
the compilation ,smtp server and others are all valid
thanks
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Pavan>cd C:\Program Files\Java\jdk1.5.0_07\bin
C:\Program Files\Java\jdk1.5.0_07\bin>javac jdbcExample3.java
C:\Program Files\Java\jdk1.5.0_07\bin>java jdbcExample3 smtpserver address
DEBUG: JavaMail version 1.4ea
DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.5.0_07\jre\lib\
javamail.providers (The system cannot find the file specified)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax
.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsyste
ms, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com
.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLSt
ore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsyst
ems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.su
n.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=jav
ax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc],
com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP
3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.
sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STOR
E,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Prov
ider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc],
pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems
, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun
Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.S
MTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.5.0_07\jre\lib\
javamail.address.map (The system cannot find the file specified)
C:\Program Files\Java\jdk1.5.0_07\bin>The debug output doesn't show an obvious problem. You're
going to have to actually debug your program. A debugger
might be helpful. -
I m doing my application using JPanel which contains labels, textfields and buttons.
Now I want to print this panel. Is it possible to print a JPanel. IF yes, then plz help me as I m stuck up into this big problem and due to which I m not able to complete my project.
I tried many codes of printing, but I wasn�t able to print it. One of the code is given below which gives me an error in MouseListener and MouseEvent.
//*********** Main User Interface Class ************
public class ComponentPrintingTestUI extends JFrame implements MouseListener {
//private static MyTextPane myTextPane;
private static MyJPanel myJPanel;
public ComponentPrintingTestUI() {
initComponents();
private void initComponents() {
JFrame frame = new JFrame("ComponentPrintingTest");
//JPanel contentPanel1 = new JPanel();
//JPanel contentPanel2 = new JPanel();
JPanel contentPanel3 = new JPanel();
JPanel contentPanel4 = new JPanel();
contentPanel3.setMaximumSize(new Dimension(270,170));
contentPanel3.setMinimumSize(new Dimension(270,170));
contentPanel3.setPreferredSize(new Dimension(270,170));
//JButton textPrint = new JButton("Print TextPane");
//textPrint.addMouseListener(this);
JButton panelPrint = new JButton("Print JPanel");
panelPrint.addMouseListener(this);
//myTextPane = new MyTextPane();
//myTextPane.setEditable(false);
myJPanel = new MyJPanel();
//contentPanel1.add(myTextPane, BorderLayout.CENTER);
//contentPanel2.add(textPrint, BorderLayout.CENTER);
contentPanel3.add(myJPanel, BorderLayout.CENTER);
contentPanel4.add(panelPrint, BorderLayout.CENTER);
//frame.add(contentPanel1, BorderLayout.NORTH);
//frame.add(contentPanel2, BorderLayout.CENTER);
frame.add(contentPanel3, BorderLayout.NORTH);
frame.add(contentPanel4, BorderLayout.SOUTH);
frame.setSize(1280,1024);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void mouseClicked(MouseEvent arg0) {
// EditorFrame extends JFrame and has all the, well, editing stuff
//EditorFrame frame = ClerkUtilities.getEventSourceFrame(e); // method simply grabs the source frame
//PrintableTextPane tp = frame.getTextPane();
PrinterJob printJob = PrinterJob.getPrinterJob();
//PageFormat pf = printJob.defaultPage();
//pf.setOrientation(PageFormat.LANDSCAPE);
printJob.setPrintable(myJPanel);
if (printJob.printDialog())
try
printJob.print();
} // end try
catch (Exception ex)
ex.printStackTrace();
} // end Exception catch
} // end if
//*********** Custom JPanel Class *************
public class MyJPanel extends JPanel implements Printable {
public MyJPanel() {
initComponents();
private void initComponents() {
this.setMaximumSize(new Dimension(270,170));
this.setMinimumSize(new Dimension(270,170));
this.setPreferredSize(new Dimension(270,170));
this.setBackground(Color.GRAY);
public void paint(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.drawString("Sample drawstring", 20, 20);
g2.drawString("Bottom line", 20, 150);
public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException
/* get component width and table height */
Dimension dimension = this.getSize();
double compWidth = dimension.width;
double compHeight = dimension.height;
System.out.println("Comp width: " + compWidth);
System.out.println("Comp height: " + compHeight);
Paper card = pageFormat.getPaper();
card.setImageableArea(0, 0, 153, 243);
card.setSize(153,243);
pageFormat.setPaper(card);
pageFormat.setOrientation(PageFormat.LANDSCAPE);
/* get page width and page height */
//double pageWidth = pageFormat.getImageableWidth();
//double pageHeight = pageFormat.getImageableHeight();
//double scale = pageWidth / compWidth;
//double scale = compWidth / pageWidth;
//System.out.println("Page width: " + pageWidth);
//System.out.println("Page height: " + pageHeight);
//System.out.println("Scale: " + scale);
/* calculate the no. of pages to print */
//final int totalNumPages= (int)Math.ceil((scale * compHeight) / pageHeight);
if (pageIndex > 3)
System.out.println("Total pages: " + pageIndex);
return(NO_SUCH_PAGE);
} // end if
else
Graphics2D g2d = (Graphics2D)g;
g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
System.out.println("Coords: " + pageFormat.getImageableX() + ", " + pageFormat.getImageableY());
g2d.translate( 0f, 0f );
//g2d.translate( 0f, -pageIndex * pageHeight );
//g2d.scale( scale, scale );
this.paint(g2d);
return(PAGE_EXISTS);
} // end else
} // end print()
//*********** Starter Class **********
//public class ComponentPrintingTest {
* @param args
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
ComponentPrintingTestUI ui = new ComponentPrintingTestUI();
//ui.setVisible(true);
I m a newbie to java and don�t have any idea abt printing of Panel. Plz Plz Plz help me.
Thanks in advance.mansi_b85, next time when you post a question:
- please use code tags (http://forum.java.sun.com/help.jspa?sec=formatting);
- don't flag your question as urgent which you have done in 3 of your 4 posts here. This implies that your question is more important than other people's questions and/or your time is more valuable than ours (ours as in people who (try to) answer your question). This is considered rude;
- try writing whole words instead of that horrible sms-speak (plz and abt)
- post swing related questions in the swing forum.
Thanks. -
Refreshing JEditorPane (Urgent) plz help
hello programmers,
i'm building an html editor:
My html editor has a split pane, the 2 pane got of the split pane are JEditorPanes, one on which i write tag and the other i display them,... thankfully all's working great, my syntax is highlighting and the html is displayed well but i've got the following problem:
when i save a html page , i wanna my browser (on the right side of the slipt pane) to display the html page... it's ok .. it displays it with the method JHTMLEditorPane.setPage(file:/// directory/ file) but the problem is that when i save the page again using the same filename... my html page on the JHTMLEditorPane stays the same... it does not update...
is their a refresh function for the JEditorPane? how can i update my JHTMLPane to reflect the changes i've brought to it? ONe thing , the page changes when i save it by aother file name..... PLz help it's very urgent!!!!!!!
BernardHave you tried to close and then re-open the file in your editorpane after you've saved?
It will work when you change the name because it has to open the file as new. Java can't dynamically update values upon files like C does with pointers. -
Urgent plz help me......plz
Am very nem to jsp.
am doing my final year project in jsp.
I want to retreive value in the textbox depending on the selectino made in the dropdown.
in the dropdown menu i retrieve employee id frm backend. n in the textbox i shuld get employee name depending on the selection made in the dropdown list. that is data in the textbox shuld change depending on the selectin made in dropdown.
here is my code which i tired but in the textbox the value is alwys remaning the last record value n it is not changing depending on slectino made in dropdwon list
<%@ page import="java.util.*" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<HTML>
FAQ
Category choice
<FORM ACTION="selection.jsp" METHOD="POST">
<%
String nameselection = null;%>
<SELECT NAME="Category" id= Category >
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection("jdbc:odbc:man","scott","tiger");
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery("SELECT DISTinCT empid FROM employee" );%>
<OPTION VALUE='nochoice'>Please choose a category</OPTION>";
<%while(rs.next()) {
nameselection = rs.getString("empid");%>
<OPTION value ="optcategory"><%out.println(nameselection);%>
</OPTION>
<% } %>
</SELECT>
Question selection
<%
String password = null;%>
<%ResultSet m1 = statement.executeQuery("SELECT * FROM employee WHERE empid = ( '" + nameselection + "')");
String mm1;
while(m1.next()){%>
<input type =text name=mm value="<%= m1.getString(2) %>">
<%}%>
</FORM>
</HTML>
plz help me....
am very new to it.
Thanx in advancehi manisha
good try & sorry for late reply
To say the truth i'm too new to jsp
i'll give u my code see it for reference.. if u have any doubts in that pls don't forget to ask me
function display()
var index=document.form1.drug.value;
document.form1.hid.value=index;
form1.submit();
function refresh()
var indexOfcombobox = document.form1.drughid.value;
sel = document.form1.drug;
for (i=0; i<sel.options.length; i++) {
if (sel.options.text ==indexOfcombobox ) {
sel.selectedIndex = i;
<form name="form1" method="post" action="">
<body onload="refresh() ">
<select name="drug" id="drug" value="hid" onChange="display()">
<option value="" selected> </option>
<%
while(rs.next())
%>
<OPTION VALUE="<%=rs.getString("DrugName")%>"><%=rs.getString("DrugName") %></OPTION>
<%
%>
</select>
<input type="hidden" name="hid">
</div></td>
</tr>
<tr>
<td>NDC code #</td>
<td>
<%
//query for selecting the values from the database
String sql1 = "SELECT ProductCode,DrugName,Dosageform from ProductMaster where DrugName='"+request.getParameter("hid")+"' ";
rs=stm.executeQuery(sql1);
%>
<% while (rs.next())
String val1=rs.getString("ProductCode");
String val2=rs.getString("DrugName");
String val3=rs.getString("Dosageform");
out.println (val1 +"</td>");
out.println ("<input type=hidden name=ndc value='" + val1 + "'>");
out.println ("<input type=hidden name=drughid value='" + val2 + "'>");
out.println("<td>Dosageform : "+val3);
}Regards
kalai -
RECORDING WITH F-32 .......ITS URGENT PLZ HELP ME
HI GUYS
HERE IS MY REQUIREMENT
I WANT TO DO A RECORDING USING F-32 AND I HAVE TO DO THE FOLLOWING WAYS
1- ENTER ACCOUNT
2-COMPANY CODE
3-CLEARING DATE
4-OPENITEM SELETION
5-I HAVE TO SELECT THE REFERENCE RADIO BUTTON
HERE IS MY ERROR , I DONT KNOW WHAT ARE THE VALUE I HAVE TO ENTER IN THE REFERENCE FIELD AND HOW TO PROCEED ,PLZ HELP ME IT IS VERY VERY URGENT FOR ME.
THANKS A LOT
MRUTYUNThis should get you started:
FORM clearing USING p_purch_order
p_cus
p_ven.
DATA: okcode(3).
CLEAR bdcdata.
CLEAR messtab.
REFRESH bdcdata.
REFRESH messtab.
MESSAGE s205 WITH 'Clearing A/R Invoice to Invoice Receipt.'.
PERFORM dynpro USING:
'X' 'SAPMF05A' '0131', "Clear Customer: Header Data
' ' 'RF05A-AGKON' bill_to,
' ' 'BKPF-BUDAT' today_ch,
' ' 'BKPF-BUKRS' 'UOFT',
' ' 'BKPF-WAERS' 'CAD',
' ' 'RF05A-XNOPS' 'X',
' ' 'RF05A-XPOS1(2)' 'X',
' ' 'BDC_OKCODE' '/16'. "Process Open Items
PERFORM dynpro USING:
'X' 'SAPMF05A' '0730', "Amount popup
' ' 'BDC_OKCODE' '/16'. "Process Open Items
PERFORM dynpro USING:
'X' 'SAPMF05A' '0730'. "Press enter
PERFORM dynpro USING:
'X' 'SAPMF05A' '0710',"Clear Customer: Enter selection criteri
' ' 'RF05A-AGBUK' 'UOFT',
' ' 'RF05A-AGKON' bill_to,
' ' 'RF05A-AGKOA' 'D',
' ' 'RF05A-XNOPS' 'X',
' ' 'RF05A-XMULK' 'X',
' ' 'RF05A-XPOS1(1)' 'X',
' ' 'BDC_OKCODE' '/16'. "Process Open Items
PERFORM dynpro USING:
'X' 'SAPMF05A' '0609', "Additional Accounts popup
' ' 'RF05A-AGKON(1)' p_ven,
' ' 'RF05A-AGKOA(1)' 'K',
' ' 'RF05A-XNOPS(1)' 'X'.
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102', "Clear Customer: Select open item
' ' 'BDC_OKCODE' 'OMX'. "Select all
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102', "Clear Customer: Select open item
' ' 'BDC_OKCODE' '/6'. "Inactive
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102', "Clear Customer: Select open item
' ' 'BDC_OKCODE' '/6'. "Find
PERFORM dynpro USING:
'X' 'SAPDF05X' '2000', "Select search criteria popup
' ' 'BDC_OKCODE' '/24'. "Next page
PERFORM dynpro USING:
'X' 'SAPDF05X' '2000', "Select search criteria popup
' ' 'RF05A-XPOS1(10)' 'X'. "Allocation
PERFORM dynpro USING:
'X' 'SAPDF05X' '0731', "Search for Allocation
' ' 'RF05A-SEL01(1)' p_purch_order. "PO
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102', "Clear Customer: Select open item
' ' 'BDC_OKCODE' 'OMX'. "Select all
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102', "Clear Customer: Select open item
' ' 'BDC_OKCODE' '/05'. "Active
IF p_test = space.
okcode = '/11'. "save
ELSE.
okcode = 'BS'. "simulate
ENDIF.
PERFORM dynpro USING:
'X' 'SAPDF05X' '1102',
' ' 'BDC_OKCODE' okcode. " save or check
IF p_test NE space. "exit from screen after check
PERFORM dynpro USING:
'X' 'SAPMF05A' '0700',
' ' 'BDC_OKCODE' '/15'. "Save or check
PERFORM dynpro USING: "popup
'X' 'SAPLSPO1' '0200',
' ' 'BDC_CURSOR' 'SPOP-OPTION1'. "choose yes
ENDIF.
CALL TRANSACTION 'F-32' USING bdcdata MODE u_mode UPDATE 'S'
MESSAGES INTO messtab.
PERFORM get_message TABLES messtab USING text 'CL'.
IF text IS INITIAL.
PERFORM batch_input USING 'F-32'.
ENDIF.
ENDFORM. " CLEARING
Rob -
... PPL Help required Urgent for Viewing Data
Hi . sorry for such simple question..
I have displayed 3 different blocks on a same canvas1 and one block on tab canvas placed on the canvas1
Now i made a menu bar where one of my menu is
view data.
behind that menu i m writing the code.
select st_id from Site where st_id = :txtstid;
but when i compile it says bad bind variable :txtstid;
when i remove the colon, it says identifier required txtstid...
Now what to do..
Then i wrote..
go_block('Site');
go_item('item1')
and now it compiled properly but when i run it .. it is not giong to that item..
may b i m doing something wrong.. how to interact with menu s..
cant i put the same functionality behind them as we do behind button press triggers..
I need to do it urgent so kindly asses what is happening ..
cant we place more than one block on same canvas and then access thier items
with the block name.
like Site.stid.
stid by the way is the text item.. that contains the site ids.. at run time..
Kindly gimme some advices. the form is so large that it is not easier me making it again..
BROne more thing ppl...
the same fucntionality is working behind the Button i have created..
so plz help it out.. BR -
hi
actually my problem is that i have to print the page which is not in the brouser
i,e a html page which cannnot be viewed but has to printed.
normlly a page opened in any brouser can be given to the printer but how to give the unseen page to a printer .I dont know if it can be done through java but if it can it has to be done using jdk1.3.
plz help me in this..First of all , Wrong forum!! This is a client side issue(unless you are trying to print the page in a server side printer). Anyway, to print in client side put the unseenable data in a hidden frame and use javascript window.print(). If you are using DHTML enabled browser(IE 5+) , you will be able to use CSS to specify alternate document for printing <link rel=alternate media=print href="printversion.doc"> .See http://www.pageresource.com/dhtml/d_a_01.htm
-
DMS-Object link to business partner (ISU-Module) required. Plz help.
Hi all,
I require to give an object link from DMS to Business partner of ISU module t code BP.
So checked up in SPRO- Control data- maintain key feilds, & i found that BUT001 is the transparent table which is used here. so i inserted the same in object link for my document type, but there was no screen no defined to it so i gave the screen no as 500, the tab has appeared under the objectlink tab in DIR, but the screen is not appearing, it is blank, also in the business partner Transaction the DIR table is not appearing.
What should i do? is there any other setting required, or the table which i have found is wrong. Plz help.
Regards
Tushar.Hi,
Have you solved your issue? I want to have the same link. If you have please give me a step by step description.
I saw the screen number for general business partner is 1249, maybe you can use this.
Regards Camilla -
Maitaining of AP Datasource (Urgent) plz help ...
hi Edwin ,
This is prakash,
My requirement is to design the Account Payables (line item) cube for that one i am using business content datasource is 0FIAP_3 this is the line item details ,in intial stage i want to add the some more fields like (allocation number,business area,material,purchase order date) these fields are not avilable for predefined structure.i want these fields also so, how can i add the fields ? ,is it going to enhancement or to add the extract structure ?
iam confusued so plz help me
advanced thanks
prakash
Message was edited by:
Prakash V
Message was edited by:
Prakash VHi,
Follow the information given in the below help;
http://help.sap.com/saphelp_bw32/helpdata/en/af/16533bbb15b762e10000000a114084/frameset.htm
That means if the required field is available either in BSIK or in BSAK, then just add the field to CI_BSIK and no code in CMOD.
With rgds,
Anil Kumar Sharma .P -
Html form-jsp retrieval problem..very urgent plz help
i have created the following html form.
<form method="POST" action="b.jsp" >
Insert Feed URL <input type="text" name=""></br></br>
<input type="submit" value="Search"> <input type ="reset" value ="Reset">now when i click search i should be able to get that url which i inserted in the text box through b.jsp which has the code for retrieving it. it is basically a .xml url. hence i have used
object.put("1", " ");
in the b.jsp(just a part of the code)
what value should i put in between the quotes(" ") so that i retrieve the info as per the url input in the html form.
kindly help
very urgent
cheersok i tried but i got the following error:
symbol : variable request
location: class org.apache.jsp.b_jsp.FeedServer
object.put("1",request.getParameter("feedURL"));
^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:246)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)i also tried this
String feedURL = request.getParameter("feedURL");
object.put("1","feedURL");
but still errors
Generated servlet error:
.java:30: feedURL is already defined in org.apache.jsp.b_jsp.FeedServer
String feedURL = request.getParameter("feedURL");
^
Generated servlet error:
java:30: cannot find symbol
symbol : variable request
location: class org.apache.jsp.b_jsp.FeedServer
String feedURL = request.getParameter("feedURL");
^
2 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:246)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
Maybe you are looking for
-
Do I need to use a Collection/VArray or ...?
Hi, all. Here's what I'm trying to do on an Oracle 9i database: I've got some 4 dates coming in from a table; I need to verify that they're valid by checking them against the person's birthdate, and then use only the valid dates in my package. So the
-
Error when use User-Defined Function
I just create User defined function "getfilename" and I put there: "DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key = Dyn
-
I have a all in one HP 6700 printer and I can't print a pdf file
-
Inv. receipt field for stock transport order
guyz, when we are creating a normal PO(from me21n), in 'Invoice' tab of item overview screen, we can find following three fields inv. receipt GR. based IV final invoice however when i'm creating a stock transport order from ME21N, i'm not able to see
-
Attention All Windows Phone Gurus! Time to SPRING Into Action!
April fools out of the way, now let's find an April genius! The name "April" is derived from the Latin verb "aperire", meaning "to open", as it is the season when trees, flowers AND MINDS start to open! And.. I can't wait to OPEN and read this month'