How to store serval char variables into a string variable?
I have serval char variables, but i don't know how to put them together (without using arrays). I am thinking to store these char variables into a string variable but i don't know how to do it. For example,
char letter1 = 'a', letter2 = 'b', letter3 = 'c';
String letters;
then how can i do to make letters = "abc" from using letter1,2,3?
I am just a beginner of Java, if anyone can help me, i will appreciate that very much!!!
String letters=""+leter1+letter2+letter3;is fine and dandy. What it actually compiles to is
String letters = new StringBuffer().append(letter1).append(letter2).append(letter3).toString();Which ofcourse is much more code to write, but still good to know.
So do see the API for java.lang.StringBuffer.
Heikki
Similar Messages
-
How to store output of SQ01 into internal table.
Hello Experts
How to store output of SQ01 into internal table.
Thanks,
UmeshYou can't store the sq01 output into internal table.
Once you create the query it will generate the abap program, in that program you can see the contents.
Regards
Sasi -
How to store JcomboBox n textfield into textfile? Urgent!!!
How to store JcomboBox n textfield into textfile?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.text.DecimalFormat;
import java.io.*;
public class RecordMenu extends JPanel implements ActionListener {
private JComboBox monthSelection;
private JButton buttonOk;
double amtToTrack;
private JTextField amtField;
private static final String[] Months =
new String[] {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
public RecordMenu() {
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new GridLayout(4,2));
mainPanel.setBorder(new TitledBorder("Record Expenses"));
JLabel monthLabel = new JLabel("Select month");
monthSelection = new JComboBox(Months);
monthSelection.addActionListener(this);
JLabel label2 = new JLabel("Amount to track:");
JTextField amtField = new JTextField(5);
amtField.addActionListener(this);
JLabel nothing1 = new JLabel("nothing");
nothing1.setVisible(false);
JLabel nothing2 = new JLabel("nothing");
nothing2.setVisible(false);
JLabel nothing3 = new JLabel("nothing");
nothing3.setVisible(false);
JLabel nothing4 = new JLabel("nothing");
nothing4.setVisible(false);
JLabel nothing5 = new JLabel("nothing");
nothing5.setVisible(false);
JLabel nothing6 = new JLabel("nothing");
nothing6.setVisible(false);
JLabel nothing7 = new JLabel("nothing");
nothing7.setVisible(false);
JLabel nothing8 = new JLabel("nothing");
nothing8.setVisible(false);
mainPanel.add(monthLabel);
mainPanel.add(monthSelection);
mainPanel.add(nothing1);
mainPanel.add(label2);
mainPanel.add(amtField);
mainPanel.add(nothing2);
mainPanel.add(nothing3);
mainPanel.add(nothing4);
mainPanel.add(nothing5);
mainPanel.add(nothing6);
mainPanel.add(nothing7);
JButton buttonOk = new JButton("OK");
buttonOk.addActionListener(this);
mainPanel.add(buttonOk);
add(mainPanel);
setSize(400,300);
setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == buttonOk) {
double amtToTrack = 0.0;
try {
if (!amtField.getText().equals(""))
amtToTrack = Double.parseDouble(amtField.getText());
catch (NumberFormatException numberFormatException) {
JOptionPane.showMessageDialog(this, "You must enter numbers","Invalid Number Format", JOptionPane.ERROR_MESSAGE);
try{
BufferedWriter out = new BufferedWriter(new FileWriter("mySaved.txt",true));
out.write("For Month "+Months);
out.newLine();
if (!amtField.getText().equals("")) {
amtToTrack = Double.parseDouble(amtField.getText());
out.write("Amount to track = "+amtToTrack);
out.newLine();
out.close();
JOptionPane.showMessageDialog(this, "Saved!");
catch(IOException ex) {
ex.printStackTrace(System.err);
public static void main(String[] args) {
JPanel p = new RecordMenu();
JFrame f = new JFrame();
Container c = f.getContentPane();
c.add(p);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setVisible(true);
}i had save e month at mySavedTotal
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.text.DecimalFormat;
import java.io.*;
public class RecordMenu extends JPanel implements ActionListener {
private JComboBox monthSelection;
private JButton buttonOk;
double amtToTrack;
private JTextField amtField;
private static final String[] Months =
new String[] {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
public RecordMenu() {
JPanel mainPanel = new JPanel();
mainPanel.setLayout(new GridLayout(4,2));
mainPanel.setBorder(new TitledBorder("Record Expenses"));
JLabel monthLabel = new JLabel("Select month");
monthSelection = new JComboBox(Months);
monthSelection.addActionListener(this);
JLabel label2 = new JLabel("Amount to track:");
amtField = new JTextField(5);
amtField.addActionListener(this);
JLabel nothing1 = new JLabel("nothing");
nothing1.setVisible(false);
JLabel nothing2 = new JLabel("nothing");
nothing2.setVisible(false);
JLabel nothing3 = new JLabel("nothing");
nothing3.setVisible(false);
JLabel nothing4 = new JLabel("nothing");
nothing4.setVisible(false);
JLabel nothing5 = new JLabel("nothing");
nothing5.setVisible(false);
JLabel nothing6 = new JLabel("nothing");
nothing6.setVisible(false);
JLabel nothing7 = new JLabel("nothing");
nothing7.setVisible(false);
JLabel nothing8 = new JLabel("nothing");
nothing8.setVisible(false);
mainPanel.add(monthLabel);
mainPanel.add(monthSelection);
mainPanel.add(nothing1);
mainPanel.add(label2);
mainPanel.add(amtField);
mainPanel.add(nothing2);
mainPanel.add(nothing3);
mainPanel.add(nothing4);
mainPanel.add(nothing5);
mainPanel.add(nothing6);
mainPanel.add(nothing7);
buttonOk = new JButton("OK");
buttonOk.addActionListener(this);
mainPanel.add(buttonOk);
add(mainPanel);
setSize(400,300);
setVisible(true);
public void actionPerformed(ActionEvent e) {
if (e.getSource() == buttonOk) {
double amtToTrack = 0.0;
try {
if (!amtField.getText().equals(""))
amtToTrack = Double.parseDouble(amtField.getText());
catch (NumberFormatException numberFormatException) {
JOptionPane.showMessageDialog(this, "You must enter numbers","Invalid Number Format", JOptionPane.ERROR_MESSAGE);
try{
BufferedWriter out = new BufferedWriter(new FileWriter("mySavedTotal.txt",true));
out.write("For Month "+monthSelection.getSelectedItem());
out.newLine();
if (!amtField.getText().equals("")) {
amtToTrack = Double.parseDouble(amtField.getText());
out.write("Amount to track = "+amtToTrack);
out.newLine();
out.close();
JOptionPane.showMessageDialog(this, "Saved!");
JPanel p = new CheckBox();
JFrame f = new JFrame();
Container c = f.getContentPane();
c.add(p);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setVisible(true);
catch(IOException ex) {
ex.printStackTrace(System.err);
public static void main(String[] args) {
JPanel p = new RecordMenu();
JFrame f = new JFrame();
Container c = f.getContentPane();
c.add(p);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setVisible(true);
}then i save data from other file in mySavedTotal again
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.text.DecimalFormat;
import java.io.*;
public class CheckBox extends JPanel implements ItemListener, ActionListener {
private JPanel checkPanel, buttonPanel;
private JCheckBox transport, bills, food, gifts, leisure, others;
private JTextField transportField, billsField, foodField, giftsField,leisureField,
othersField, totalField;
double transportAmt, billsAmt, foodAmt, giftsAmt, leisureAmt, othersAmt, totalAmt;
private JButton buttonTotal, saveButton, dontSaveButton;
private JLabel showTotal;
public CheckBox() {
//create a panel for diaplaying the checkboxs and buttons
checkPanel = new JPanel();
checkPanel.setLayout(new GridLayout(7,3));
//Create the check boxes.
transport = new JCheckBox("Transport");
transport.setSelected(false);
transport.setBounds(10,30,80,30);
transportField = new JTextField();
transportField.setEditable(false);
transportField.setBounds(100,35,45,20);
bills = new JCheckBox("Bills");
bills.setSelected(false);
bills.setBounds(10,60,80,30);
billsField = new JTextField(5);
billsField.setEditable(false);
billsField.setBounds(100,65,45,20);
food = new JCheckBox("Food");
food.setSelected(false);
food.setBounds(10,90,80,30);
foodField = new JTextField(5);
foodField.setEditable(false);
foodField.setBounds(100,95,45,20);
gifts = new JCheckBox("Gifts");
gifts.setSelected(false);
gifts.setBounds(200,30,80,30);
giftsField = new JTextField(5);
giftsField.setEditable(false);
giftsField.setBounds(300,35,45,20);
leisure = new JCheckBox("Leisure");
leisure.setSelected(false);
leisure.setBounds(200,60,80,30);
leisureField = new JTextField(5);
leisureField.setEditable(false);
leisureField.setBounds(300,65,45,20);
others = new JCheckBox("Others");
others.setSelected(false);
others.setBounds(200,90,80,30);
othersField = new JTextField(5);
othersField.setEditable(false);
othersField.setBounds(300,95,45,20);
JLabel nothing1 = new JLabel("nothing");
nothing1.setVisible(false);
JLabel nothing2 = new JLabel("nothing");
nothing2.setVisible(false);
JLabel nothing3 = new JLabel("nothing");
nothing3.setVisible(false);
JLabel nothing4 = new JLabel("nothing");
nothing4.setVisible(false);
JLabel nothing5 = new JLabel("nothing");
nothing5.setVisible(false);
JLabel nothing6 = new JLabel("nothing");
nothing6.setVisible(false);
JLabel nothing7 = new JLabel("nothing");
nothing7.setVisible(false);
JLabel nothing8 = new JLabel("nothing");
nothing8.setVisible(false);
JLabel nothing9 = new JLabel("nothing");
nothing9.setVisible(false);
JLabel nothing10 = new JLabel("nothing");
nothing10.setVisible(false);
JLabel nothing11 = new JLabel("nothing");
nothing11.setVisible(false);
//Register a listener for the check boxes.
transport.addItemListener(this);
bills.addItemListener(this);
food.addItemListener(this);
gifts.addItemListener(this);
leisure.addItemListener(this);
others.addItemListener(this);
transportField.addActionListener(this);
billsField.addActionListener(this);
foodField.addActionListener(this);
giftsField.addActionListener(this);
leisureField.addActionListener(this);
othersField.addActionListener(this);
checkPanel.add(transport);
checkPanel.add(transportField);
checkPanel.add(bills);
checkPanel.add(billsField);
checkPanel.add(food);
checkPanel.add(foodField);
checkPanel.add(gifts);
checkPanel.add(giftsField);
checkPanel.add(leisure);
checkPanel.add(leisureField);
checkPanel.add(others);
checkPanel.add(othersField);
checkPanel.setBounds(1,1,390,180);
checkPanel.setBorder(new TitledBorder("Check the amount you want to track"));
buttonTotal = new JButton("Calculate Total");
buttonTotal.setBounds(150,140,130,30);
buttonTotal.addActionListener(this);
showTotal = new JLabel(" = __");
showTotal.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
showTotal.setBounds(290,140,100,30);
checkPanel.add(nothing1);
checkPanel.add(nothing2);
checkPanel.add(nothing3);
checkPanel.add(nothing4);
checkPanel.add(nothing5);
checkPanel.add(nothing6);
checkPanel.add(buttonTotal);
checkPanel.add(showTotal);
checkPanel.add(nothing7);
checkPanel.add(nothing8);
checkPanel.add(nothing9);
checkPanel.add(nothing10);
checkPanel.add(nothing11);
saveButton = new JButton("Save");
saveButton.setBounds(90,190,100,30);
saveButton.addActionListener(this);
dontSaveButton = new JButton("Don't Save");
dontSaveButton.setBounds(200,190,100,30);
dontSaveButton.addActionListener(this);
checkPanel.add(saveButton);
checkPanel.add(dontSaveButton);
add(checkPanel);
setSize(400,260);
setVisible(true);
/** Listens to the check boxes. */
public void itemStateChanged(ItemEvent e) {
if (e.getSource() == transport)
if (e.getStateChange() == ItemEvent.SELECTED)
transportField.setEditable(true);
else
transportField.setEditable(false);
if (e.getSource() == bills)
if (e.getStateChange() == ItemEvent.SELECTED)
billsField.setEditable(true);
else
billsField.setEditable(false);
if (e.getSource() == food)
if (e.getStateChange() == ItemEvent.SELECTED)
foodField.setEditable(true);
else
foodField.setEditable(false);
if (e.getSource() == gifts)
if (e.getStateChange() == ItemEvent.SELECTED)
giftsField.setEditable(true);
else
giftsField.setEditable(false);
if (e.getSource() == leisure)
if (e.getStateChange() == ItemEvent.SELECTED)
leisureField.setEditable(true);
else
leisureField.setEditable(false);
if (e.getSource() == others)
if (e.getStateChange() == ItemEvent.SELECTED)
othersField.setEditable(true);
else
othersField.setEditable(false);
public void actionPerformed(ActionEvent event) {
try {
if (event.getSource() == buttonTotal) {
double transportAmt=0.0, billsAmt=0.0, foodAmt=0.0, giftsAmt=0.0,leisureAmt=0.0, othersAmt=0.0, totalAmt=0.0;
if (!transportField.getText().equals(""))
transportAmt = Double.parseDouble(transportField.getText());
if(!billsField.getText().equals(""))
billsAmt = Double.parseDouble(billsField.getText());
if(!foodField.getText().equals(""))
foodAmt = Double.parseDouble(foodField.getText());
if(!giftsField.getText().equals(""))
giftsAmt = Double.parseDouble(giftsField.getText());
if(!leisureField.getText().equals(""))
leisureAmt = Double.parseDouble(leisureField.getText());
if(!othersField.getText().equals(""))
othersAmt = Double.parseDouble(othersField.getText());
totalAmt = transportAmt + billsAmt + foodAmt + giftsAmt + leisureAmt + othersAmt;
showTotal.setText("= $" + totalAmt);
catch (NumberFormatException numberFormatException ) {
JOptionPane.showMessageDialog(this, "You must enter numbers!","Invalid Number Format", JOptionPane.ERROR_MESSAGE);
if (event.getSource() == dontSaveButton) {
System.exit(0);
if(event.getSource() ==saveButton){
double transportAmt=0.0, billsAmt=0.0, foodAmt=0.0, giftsAmt=0.0,leisureAmt=0.0, othersAmt=0.0, totalAmt=0.0;
try{
BufferedWriter out = new BufferedWriter(new FileWriter("mySavedTotal.txt",true));
if (!transportField.getText().equals("")) {
transportAmt = Double.parseDouble(transportField.getText());
out.write("Transport = "+transportAmt);
out.newLine();
if(!billsField.getText().equals("")) {
billsAmt = Double.parseDouble(billsField.getText());
out.write("Bills = "+billsAmt);
out.newLine();
if(!foodField.getText().equals("")) {
foodAmt = Double.parseDouble(foodField.getText());
out.write("Food = "+foodAmt);
out.newLine();
if(!giftsField.getText().equals("")){
giftsAmt = Double.parseDouble(giftsField.getText());
out.write("Gifts = "+giftsAmt);
out.newLine();
if(!leisureField.getText().equals("")){
leisureAmt = Double.parseDouble(leisureField.getText());
out.write("Leisure = "+leisureAmt);
out.newLine();
if(!othersField.getText().equals("")) {
othersAmt = Double.parseDouble(othersField.getText());
out.write("Others = "+othersAmt);
out.newLine();
out.write("Total amount "+showTotal.getText());
out.newLine();
out.close();
JOptionPane.showMessageDialog(this, "Everything is saved!");
catch(IOException e){
JOptionPane.showMessageDialog(this, "You must enter integers!","Invalid Number Format",JOptionPane.ERROR_MESSAGE);
public static void main(String[] args) {
JPanel p = new CheckBox();
JFrame f = new JFrame();
Container c = f.getContentPane();
c.add(p);
f.pack();
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setVisible(true);
}urgent... how to rerieve saved data? i got try b4 but didnt work out -
How to replace the char values into numeric in my string?
Hi Friends,
I would like to Replace the Charecter values with numeric value in my string.
Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
I mean How to replace the char values into numeric in my string?
Thanks,
SridharHi Sridhar,
I would like to Replace the Charecter values with numeric value in my string.
Exp : first in my string I am having the value like this : 'ABCD1234' ( may be any char and num values ), and I want too get it by '99991234'.
So, if i understand you correctly, you want to replace all characters in a string with 9 as in the above example, irrespective of position of the character, if so try with the below code.
DATA: l_str TYPE string.
l_str = 'ASKHSIUDNSBDKJSDH124312431243124saasdfsf'.
REPLACE ALL OCCURRENCES OF REGEX '\D' IN l_str WITH '9'.
IF sy-subrc EQ 0.
WRITE: l_str. "Result will be 9999999999999999912431243124312499999999
ENDIF.
Regards,
Chen
Edited by: Chen K V on Jun 13, 2011 12:36 PM -
How to store array of data into a single row of table ,using any of Stmts
HI Friends,
Based on my requirements ,i have retrived a set of data from a XXX.jsp page using a request.getParameter() and stored into single dimenssional array . Now i am paassing that array to JAVA class to store a into some table .
In JSP page users can add text boxes dynamically based on his intrest then those attributes will store in table .it means table attributes are not conatant , it table attributes may change at any time when user adds any textboxs or any fields on JSP page ....thats my module ..
Now i wanted to store all array of data into Table in a single row .......thats is my requirements .
How can we use prepareStatement and Statement to store array of results intoo table row ...on each iteration i wanted to store array of results into table atributes ..It means entire array of results should to into table row at time .....coule any one write sytax ,how we do this...
could any one suggest me stps that i can impliment ......?....please reply ASAPWell ..you code can be works for constant number of attributes in table .oopss here my requirement is table attributes not fixed ,we cant put constant number of place holder(? ) in a statement ,because those are not fixed ,
Let me explain here :
i am doing in that way only. As i mentioned you Table attributes are not constant .It may very if users add any fields dynamically on JSP page .If users have option to add any text box on Jsp page ,then that attribute will store in table as a attribute .
Now i amable fetching the all dyamic form data and stored in a Result Array below ...in this iteration all form result data are from jsp page as suggestion form ,it should stored in table in single row on corrsponding attribtes ......next time when users fills FROM ,then those data i am fetching and storing in a Result Array as below and need to store in corrsponding table attributes in a single row ....
for(int i=0;i<result.length;i++)
System.out.println(result);
pst3=connection.prepareStatement("insert into *emprecord* values(?)");
if(!result[i].equals(""))
System.out.println(result[i]);
pst3.setString(1,result[i]);
pst3.executeUpdate();
Thnks in advance ....let me know the the way we can store dynamic form data into dyanamic table ... -
How do I pass single quotes into a string variable?
Thanks for any help?
Example
Select xdat, yday
from foo
where
xdat = to_char(sysdate, 'mm/dd/yyyy')
How do I pass the single quoted stuff above into a string variable?Thank you but that is not the same thing. I am building a dynamic sql statement and need to pass the quoted material into a statement that is quoted Is that not what my example above shows?
My example above has a quoted string inside a string. I think this is exactly what you were asking for. -
How to get a "char variable" with presentation variable???
I want to pass a char variable with presentation variable, I don't have problems if I pass "int".
For example in answers page I add a column that contains years of my dimension. 2000 until 2012 and prompted my presentation variable "year" (from my dashboard prompt) and when I go to dashboard if I choose in my prompt 2006 in my report appear 2006...any problem and easy. But my problem is if I would pass a char variable, in my prompt also I have months but not numbers else names: January, February, March...and a presentation variable that name is "month". If I do the same report but change column year to month (name) I don't have any results and I have an error.
How can I solucionate this???
Thank you!!Alex,
Do you have separate columns for Year and Month Name. If Yes, Then why it is so confusing?
1. create a dashboard prompt with month name column
2. Assign it to monthname variable
3. In your report use above variable any where.., but what ever you are doing should be logical and valid to get some data.
In general above approach will work.
You said, "No! I don't want to do a filter with month! I would like to pass this variable, in this example don't make sense but I need to pass a char variable with presentation variable to do another things..."
what does that mean, what you are trying to do with the variable in your report. If you give a example that would be better.
- Madan -
How do you store input from keyboard into a string array
I am trying to learn java and one of the programs I am trying to write needs to be able to accept a machine hostname at the keyboard and stuff it into a string array element. I am sure I will be using something along the lines of:
BufferedReader in = new BufferedReader(new InputStreamReader(
System.in));
String str = "";
System.out.print("Enter a FQDN to look up: ");
str = in.readLine();
but how do I get the input stuffed into hostname[ ].
Any hints or assistance will be appreciated.
MichaelWell part of. I need to be able to take a random number of hostnames (ie. mblack.mkblack.com, fred.mblack.com, joe.mblack.com, ...) and after the user presses the enter key between each entry, the inputted information is stored in an array element. for example with the three shown above the array would look like this after the user finished.
hostname {"mblack.mblack.com","fred.mblack.com","joe.mblack.com"};
the algorithm would be
Prompt for hostname
get user input and press enter
store hostname into array element
prompt for next hostname or enter with no input to complete entry and execute lookup.class methods.
I have the program written and working fine if I use a static array where I put the hostnames in the list, but cannot figure out how to get the information from the keyboard to the array element.
Thanks for the help though, the response is very much appreciated.
Michael -
How to store Multiple Ec\xcels into Table Using sql loder
Plese guide me to store Multiple Ec\xcels into Table Using sql loder
I am not clear with your question. Do you want to load multipel Excel Files into a table. If so you can follow this link.
http://www.orafaq.com/wiki/SQL*Loader_FAQ#Can_one_load_data_from_multiple_files.2F_into_multiple_tables_at_once.3F
Thanks,
Karthick. -
How do you turn a List into a String?
Hi,
Have a simple question for all of you out there, hope you can help:
How do you turn a list of words into a string?
For example:
List matchList = new ArrayList();
matchList.add(word 1);
matchList.add(word 2);
matchList.add(word 3);
String s = matchList(all of the words)How is this possible?but how would i go about doing that? Thats what i am
askingIf you don't know how to iterate over a list, see this tutorial: http://java.sun.com/docs/books/tutorial/collections/If you don't know how to use StringBuffer, it should be somewhere in one of the links under Resources for Beginners at http://www.thejword.com/3.html#beginner_resources -
How to store BDC error messages into oracle database table?
Hello Experts,
I have a peculier requirement wherein I need to store the error messages occured while executing the transaction using BDC (Call Transaction Method) in an Oracle Database table format. Is that possible, if yes, how?
Thanks in advance.Hi,
Structure of BDCMSGCOLL.
TCODE -> BDC Transaction code
DYNAME -> Batch input module name
DYNUMB -> Batch input screen number
MSGTYP ->Batch input message type
MSGSPRA -> Language ID of a message
MSGID -> Batch input message ID
MSGNR -> Batch input message number
MSGV1 -> Variable part of a message
MSGV2 -> Variable part of a message
MSGV3 -> Variable part of a message
MSGV4 -> Variable part of a message
FLDNAME -> Field name
Ex :
DATA : BDCMSGCOLL TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE,
BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
CALL TRANSACTION 'MM01' USING BDCDATA MODE N UPDATE S MESSAGES INTO BDCMSGCOLL.
IF SY-SUBRC 0.
PERFORM ERR.
CLEAR I_MSG.
REFRESH I_MSG.
ENDIF.
*& Form ERR
text
--> p1 text
<-- p2 text
form ERR .
DATA V_MSG(255) TYPE C.
READ TABLE I_MSG WITH KEY MSGTYP = 'E'.
IF SY-SUBRC = 0.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = I_MSG-MSGID
LANG = 'E'
NO = I_MSG-MSGNR
V1 = I_MSG-MSGV1
V2 = I_MSG-MSGV2
V3 = I_MSG-MSGV3
V4 = I_MSG-MSGV4
IMPORTING
MSG = V_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE V_MSG. " Error Message Displayed Here.
CLEAR V_MSG.
ENDIF.
endform. " ERR
hope this will help you.
Reward if found helpfull,
Cheers,
Chaitanya. -
How to store my mp3 files into my database
Hello,
I am having some trouble with a database i am creating to store my mp3 files. I have created the following sql statement so far using what research i did on the subject.
CREATE TABLE music
( Artist CHAR(30),
NameOfSong CHAR(30),
Song BLOB);
But i have no idea how to do a INSERT statement for the BLOB datatype. I am trying to use a location on my hard drive to upload the song to the table. All help is welcomed.
Thank you,http://forums.oracle.com/forums/search.jspa?threadID=&q=insert+blob&objID=f75&dateRange=all&userID=&numResults=15
Message was edited by:
jeneesh -
How to store the webdynpro variable in broser's cookie
Hi,
I have the requirement like that I need to store the customer number in the browser's session such that this customer number is available to other aplications in the portal. other aplications are not only the the webdynpro aplications but also other aplications like crystal reports. I came to know that this can be done by storing the customer in the browser's cookies.
Please reply if any one know how to do this thing.
Thanks in advance.If i understand you correctly you want to store the values of the local variable whenever you read from it? If you want to do this then simply run a wire from the local variable (in read mode) to the edge of the while loop, right-click on the terminal and select 'enable indexing', and this will create an array of these values at this point.
I hope this helps you..
Kim -
How to Store an XML Data into Table?
Hi All,
My Requirement is "I Have an XML File (or) XML Data as CLOB, now I should decode this XML Data and find the equivalent data for columns in a table and then store that in a relational table",
Would be greatful if any one can provide me a feasible solution (or) good link where I can get this information with examples.
Thanks in advance,
Sunil NOr,
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Elapsed: 00:00:00.03
satyaki>
satyaki>
satyaki>drop table dump_tab;
Table dropped.
Elapsed: 00:00:01.08
satyaki>
satyaki>create table dump_tab
2 (
3 raw_xml clob
4 );
Table created.
Elapsed: 00:00:00.00
satyaki>
satyaki>
satyaki>desc dump_tab;
Name Null? Type
RAW_XML CLOB
satyaki>
satyaki>
satyaki>insert into dump_tab
2 select yy.rxml
3 from (
4 select (' <data>
5 <var name="document">
6 <string>Sales Order</string>
7 </var>
8 <var name="results">
9 <recordset rowcount="2">
10 <field name="sales_num">
11 <string>12345</string>
12 <string>60192</string>
13 </field>
14 <field name="ord_qty">
15 <string>10</string>
16 <string>50</string>
17 </field>
18 </recordset>
19 </var>
20 </data>'
21 ) rxml from dual
22 ) yy;
1 row created.
Elapsed: 00:00:00.00
satyaki>
satyaki>commit;
Commit complete.
Elapsed: 00:00:00.00
satyaki>
satyaki>create table results
2 (
3 serial_no number(5),
4 sales_num number(7),
5 ord_qty number(10)
6 );
Table created.
Elapsed: 00:00:00.00
satyaki>
satyaki>desc results;
Name Null? Type
SERIAL_NO NUMBER(5)
SALES_NUM NUMBER(7)
ORD_QTY NUMBER(10)
satyaki>
satyaki>select * from dump_tab;
RAW_XML
<data>
<var name="document">
<string>Sales Order</string>
</var>
<var name="results">
<recordset rowcount="2">
<field name="sales_num">
<string>12345</string>
<string>60192</string>
</field>
<field name="ord_qty">
RAW_XML
<string>10</string>
<string>50</string>
</field>
</recordset>
</var>
</data>
Elapsed: 00:00:00.01
satyaki>
satyaki>
satyaki>ed
Wrote file afiedt.buf
1 insert into results(serial_no,sales_num,ord_qty)
2 with t
3 as (
4 select xmltype(raw_xml) xml from dump_tab
5 ),
6 t1 as (select rownum rn, t1.column_value.extract('*/text()') sales_num from t t, table(xmlsequence(t.xml.extract('//field[@name="sales_num"]/string'))) t1),
7 t2 as (select rownum rn, t2.column_value.extract('*/text()') ord_qty from t t, table(xmlsequence(t.xml.extract('//field[@name="ord_qty"]/string'))) t2)
8 select t1.rn x,
9 to_number(regexp_replace(xmlelement("e",sales_num).getstringval(),'<(|/)e>','')) sales_num
10 to_number(regexp_replace(xmlelement("d",ord_qty).getstringval(),'<(|/)d>','')) ord_qty
11 from t1,t2
12* where t1.rn = t2.rn
satyaki>/
2 rows created.
Elapsed: 00:00:00.00
satyaki>
satyaki>select * from results;
SERIAL_NO SALES_NUM ORD_QTY
1 12345 10
2 60192 50
Elapsed: 00:00:00.00
satyaki>Regards.
Satyaki De. -
How to store data from channels into constants
Hi
I currently have a six channel data acquisition system for LVDTs. The way the process works is we do a calibration run on the LVDTs and store the values we get and then use these baseline values during actual measurement. My question is how do I acquire these values and store them in constants within the program itself ? I know we can write these values to an external excel file or text file but can we store them within the program so that I have them available even if I close and open the program again?Perhaps this will work for you.
Attachments:
Set_and_Save_Defaults.zip 26 KB
Maybe you are looking for
-
Deletion of Delivery after confirm of Pick and WM TO, should not be allowe
The system will allow a delivery to be deleted after confirmation of Picking and WM TO. This creates all kinds of issues in WM for tracebility. Is there any way to prevent this from happening through config in WM or SD? Edited by: Daryl Dellinger on
-
Why does my php export feature work in IE and not firefox?
Why does my php export feature work in IE and not Firefox? I've written a web application which contains a SigmaGrid. The grid controls reload, add update delete, print and export to csv all work in IE8. The export feature does not work in Firefox.
-
PowerPc MS Word document in Pages
How do I open in Pages an MS Word document originally written for a PowerPc?
-
Principal Propagation Using Sender SOAP adapter in PI7.1
Hi, I am trying to configure principal propagation using SOAP sender adapter. In that, I am trying to generate the assertion ticket in SAP only but it is using PIAFUSER as the user that is being passed and not the user which we are using to logon. Pl
-
Move mailbox to another database failed with MapiExceptionNoSupport
I am getting a failure when I try to move certain mailboxes from one database to another on my Exchange 2010 environment. Everything I find on the web shows something about permissions and seems to all be related to a Exchange 2003 to 2010 migration.