Help With Append.....
Hi people, can anybody help with a simple append problem.....i.e. it doesn't append. I've looked at all the books and it seems right what I am doing, but it doesn't append it just overwrites. Here is a small sample of the append and how I'm using it.....
BufferedWriter append = new BufferedWriter(new FileWriter(out));
//BufferedWriter append = new BufferedWriter(new FileWriter(out));
System.out.println("Output 2");
append.write("LABEL \""+item+"_"+item_rev+"_"+label_tmp+".lbl\"\r\n");
//out.println(sb);
System.out.println("Output 3");
if (label_tmp.equals("SB"))
System.out.println("Label Ref SB, use next SFC Number");
if (suffix == null)
sfc = prefix+first_sfc;
append.write("SET SFC = \""+sfc+"\"\r\n");
//StringBuffer sb = new StringBuffer();
//sb.append("SET SFC = \""+sfc+"\"\r\n");
I'm not sure if I need to tell it I'm using append in a private class or anything....... any help please......I think I'm missing something simple...........
Cheers
Mark
Oh right.
What i'm trying to do is currently it creates a file called NICE.JOB and it has label data in it. But because a queuing reasons I need it to keep appending to the one NICE.JOB. so there would be two sets of label data in one file.
Currently once you have created NICE.JOB if you don't remove it and you try and create another if crashed as it constantly tried to write it and gets confused!
I'm fairly new to Java so its all a bit of a blur really!!!!.
Similar Messages
-
I have a table that holds multiple blobs i separate rows.
What i am trying to do is have a procedure that will combine all of these blobs in a certain order and insert into a new table.
I have the procedure below which does seem to work except for one major issue: it adds a null character ("00" in hex) between each append in the final blob.
So i end up with the following
[blob1_data]00[blob2_data]00[blob3_data]
I have been searching for a solution for a while and could use some expert help.
Here is what i have:
PROCEDURE INSERT_ATTACHMENT()
IS
CURSOR curATTACH IS
SELECT T.ATTACHMENT
FROM NEMS.NEMS_INET_ATTACH_TEMP T
WHERE T.ATTACH_KEY = pATTACH_KEY
ORDER BY T.ATTACH_SEQ;
blbATTACH NEMS.NEMS_ATTACHMENTS.ATTACHMENT%TYPE;
BEGIN
--combine blob seqments
dbms_lob.createtemporary(blbATTACH, false);
FOR lATTACH IN curATTACH LOOP
dbms_lob.writeappend(blbATTACH, length(lATTACH.Attachment), lATTACH.Attachment);
--dbms_lob.append(blbATTACH, lATTACH.Attachmnet);
END LOOP;
--insert into attachment table
INSERT INTO NEMS.NEMS_ATTACHMENTS
(ATTACHMENT)
VALUES
(blbATTACH);
END INSERT_ATTACHMENT;Ah yes the version,
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Also, i think i may have found a solution. I am going to test a few different files, but so far this looks promising:
--combine blob seqments
dbms_lob.createtemporary(blbATTACH, false);
FOR lATTACH IN curATTACH LOOP
dbms_lob.writeappend(blbATTACH, length(lATTACH.Attachment)-1, dbms_lob.substr(lATTACH.Attachment,length(lATTACH.Attachment)-1));
END LOOP; -
Hi, could someone help with append message TextArea????
// a program by me
// a class MailOrder
// java core packages
import java.text.NumberFormat;
import java.util.Locale;
// java extension packages
import javax.swing.JTextArea;
import javax.swing.JOptionPane;
public class MailOrder {
public static void main( String args[] )
int product;
double amount, product1 = 2.98, product2 = 4.50, product3 = 9.98, product4 = 4.49, product5 = 6.87;
String input;
// create DecimalFormat to format floating-point numbers
// with two digit to the right of the decimal point
NumberFormat moneyFormat =
NumberFormat.getCurrencyInstance( Locale.US );
JTextArea outputTextArea = new JTextArea();
input = JOptionPane.showInputDialog(
"Enter the product number" );
product = Integer.parseInt( input );
switch ( product ) {
case 1:
amount = product1;
case 2:
amount = product2;
case 3:
amount = product3;
case 4:
amount = product4;
case5:
amount = product5;
case6:
amount = product1 * product2 * product3 * product4 * product5;
break;
outputTextArea.append( product + "\t" +
moneyFormat.format( amount ) + "\n" );
} // end switch structure
JOptionPane.showMessageDialog(null, outputTextArea,
"The total retail prices", JOptionPane.INFORMATION_MESSAGE );
System.exit( 0 );
If anyone can explay why the append code aren't working.
The compiler displays this message.
unreachable statement
outputTextArea.append( product + "\t" +
^
Tnx
regards
giuseppeHi,
You need to put the statement
outputTextArea.append( product + "\t" + moneyFormat.format( amount ) + "\n" );
outside the switch case loop and then initialise amount variable.
-Amol -
Need help with JTextArea and Scrolling
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import javax.swing.*;
public class MORT_RETRY extends JFrame implements ActionListener
private JPanel keypad;
private JPanel buttons;
private JTextField lcdLoanAmt;
private JTextField lcdInterestRate;
private JTextField lcdTerm;
private JTextField lcdMonthlyPmt;
private JTextArea displayArea;
private JButton CalculateBtn;
private JButton ClrBtn;
private JButton CloseBtn;
private JButton Amortize;
private JScrollPane scroll;
private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
private JComboBox rateTermList;
double interest[] = {5.35, 5.5, 5.75};
int term[] = {7, 15, 30};
double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
int termInMonths, month, termLoop, monthLoop;
public MORT_RETRY()
Container pane = getContentPane();
lcdLoanAmt = new JTextField();
lcdMonthlyPmt = new JTextField();
displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
rateTermList = new JComboBox(rateTerm);
scroll = new JScrollPane(displayArea);
scroll.setSize(600,170);
scroll.setLocation(150,270);//DEFINE BUTTONS
CalculateBtn = new JButton("Calculate");
ClrBtn = new JButton("Clear Fields");
CloseBtn = new JButton("Close");
Amortize = new JButton("Amortize");//DEFINE PANEL(S)
keypad = new JPanel();
buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
keypad.add(new JLabel("Loan Amount$ : "));
keypad.add(lcdLoanAmt);
keypad.add(new JLabel("Term of loan and Interest Rate: "));
keypad.add(rateTermList);
keypad.add(new JLabel("Monthly Payment : "));
keypad.add(lcdMonthlyPmt);
lcdMonthlyPmt.setEditable(false);
keypad.add(new JLabel("Amortize Table:"));
keypad.add(displayArea);
displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
buttons.add(CalculateBtn);
buttons.add(Amortize);
buttons.add(ClrBtn);
buttons.add(CloseBtn);//ADD ACTION LISTENER
CalculateBtn.addActionListener(this);
ClrBtn.addActionListener(this);
CloseBtn.addActionListener(this);
Amortize.addActionListener(this);
rateTermList.addActionListener(this);//ADD PANELS
pane.add(keypad, BorderLayout.NORTH);
pane.add(buttons, BorderLayout.SOUTH);
pane.add(scroll, BorderLayout.CENTER);
addWindowListener( new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
public void actionPerformed(ActionEvent e)
String arg = lcdLoanAmt.getText();
int combined = Integer.parseInt(arg);
if (e.getSource() == CalculateBtn)
try
JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
if ((e.getSource() == CalculateBtn) && (arg != null))
try{
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
monthlyInterest = interest[0] / (12 * 100);
termInMonths = term[0] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
monthlyInterest = interest[1] / (12 * 100);
termInMonths = term[1] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
monthlyInterest = interest[2] / (12 * 100);
termInMonths = term[2] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
} //IF STATEMENTS FOR AMORTIZATION
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
loopy(7, 5.35);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
loopy(15, 5.5);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
loopy(30, 5.75);
if (e.getSource() == ClrBtn)
rateTermList.setSelectedIndex(0);
lcdLoanAmt.setText(null);
lcdMonthlyPmt.setText(null);
displayArea.setText(null);
if (e.getSource() == CloseBtn)
System.exit(0);
private void loopy(int lTerm,double lInterest)
double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
int amount, months, termloop, monthloop;
String lcd2 = lcdLoanAmt.getText();
amount = Integer.parseInt(lcd2);
termloop = 1;
paid = 0.00;
monthlyrate = lInterest / (12 * 100);
months = lTerm * 12;
monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
total = months * monthly;
balance = amount;
while (termloop <= lTerm)
displayArea.setCaretPosition(0);
displayArea.append("\n");
displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
displayArea.append("\n");
displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
monthloop = 1;
while (monthloop <= 12)
monthint = balance * monthlyrate;
monthprin = monthly - monthint;
balance -= monthprin;
paid += monthly;
displayArea.setCaretPosition(0);
displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
monthloop ++;
termloop ++;
public static void main(String args[])
MORT_RETRY f = new MORT_RETRY();
f.setTitle("MORTGAGE PAYMENT CALCULATOR");
f.setBounds(600, 600, 500, 500);
f.setLocationRelativeTo(null);
f.setVisible(true);
}need help with displaying the textarea correctly and the scroll bar please.
Message was edited by:
new2this2020What's the problem you're having ???
PS. -
I need help with Creating Key Pairs
Hello,
I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
the class is :
import java.io.*;
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import java.security.interfaces.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import au.net.aba.crypto.provider.ABAProvider;
class CreateKeyPairs {
private static KeyPair keyPair;
private static KeyPairGenerator pairGenerator;
private static PrivateKey privateKey;
private static PublicKey publicKey;
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
return;
createKeys();
saveKey(args[0],publicKey);
saveKey(args[1],privateKey);
private static void createKeys() throws Exception {
Security.addProvider(new ABAProvider());
pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
pairGenerator.initialize(1024, new SecureRandom());
keyPair = pairGenerator.generateKeyPair();
privateKey = keyPair.getPrivate();
publicKey = keyPair.getPublic();
private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
out.writeObject(key);
out.close();
private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
out.writeObject(key);
out.close();
the public key is:
�� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�| xpt Javaur [Ljava.lang.String;��V��{G xp q ~ ur [B���T� xp ��ccR}o���[!#I����lo������
����^"`8�|���Z>������&
d ����"B��
^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
How i can generated the key pairs in base 64 or binary????
Thanxs for help me
Luis Navarro Nu�ez
Santiago.
Chile.
South America.I don't use ABA but BouncyCastle
this could help you :
try
java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
java.security.KeyPair kp = kg.generateKeyPair();
java.security.Key pub = kp.getPublic();
java.security.Key pri = kp.getPrivate();
System.out.println("pub: " + pub);
System.out.println("pri: " + pri);
byte[] pub_e = pub.getEncoded();
byte[] pri_e = pri.getEncoded();
java.io.PrintWriter o;
java.io.DataInputStream i;
java.io.File f;
o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
o.println(new sun.misc.BASE64Encoder().encode(pub_e));
o.close();
o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
o.println(new sun.misc.BASE64Encoder().encode(pri_e));
o.close();
java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
StringBuffer keyBase64 = new StringBuffer();
String line = br.readLine ();
while(line != null)
keyBase64.append (line);
line = br.readLine ();
byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
keyBase64 = new StringBuffer();
line = br.readLine ();
while(line != null)
keyBase64.append (line);
line = br.readLine ();
byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
System.out.println("pub: " + pubKey);
java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
System.out.println("pri: " + priKey);
catch(Exception e)
e.printStackTrace ();
} -
Help with writing and retrieving data from a table field with type "LCHR"
Hi Experts,
I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
Thanks in advance,
C
SAVING THE LIST DATA TO DB
DATA: L_WA(800).
LOOP AT T_TAB into L_WA.
ZDBTAB-DATALEN = STRLEN( L_WA ).
MOVE: L_WA to ZDBTAB-RAWDATA.
ZDBTAB-LINENUM = SY-TABIX.
INSERT ZDBTAB.
READING THE DATA FROM DB
DATA: BEGIN OF T_DATA,
SEQNR type ZDBTAB-LINENUM,
DATA type ZDBTAB-RAWDATA,
END OF T_TAB.
Select the data.
SELECT linenum rawdata from ZDBTAB into table T_DATA
WHERE repid = w_repname
AND rundate = w_rundate
ORDER BY linenum.
Populate calling Internal Table.
LOOP AT T-DATA.
APPEND T_DATA to T_TAB.
ENDLOOP.Hi Anuj,
The unicode flag is active.
When I run our report and then to try and save the list data a dump is happening at the following point
LOOP AT T_TAB into L_WA.
As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
When I try to load a saved list the dump is happening at the following point
APPEND T_DATA-RAWDATA to T_TAB.
T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
Regards
C -
Problem with Append mode in File Receiver
Hello,
I am facing some problem with Append Mode in File Receiver.
In channel config, i have given :
Construction Mode : Append
File Type : Text
Message Protocol : File Content Conversion
The size of the file which i am trying to send is about 9.5MB.
I got this error,
"Recovering from loss of connection to database; message
loaded into queue by recover job: System Job (Failover Recovery)".
So, it would seem that there was a loss of connnection to the database
while the file was being written.
Note - XI successfully recovered from the connection loss and
successfully wrote the file, however since the communication channel
was set to append, it appended to the partial file that was written
before the database connection loss. This is not correct. The file
should have been overwritten after the recovery even though the communication
channel was configured to append.
Can anyone help me on this regard.
Thanks,
Soorya.Hi Venkat,
I would suggest u to split the file in to chunks if u face any problem in processing at a time in append mode and also
Memory Requirements are must 4 processing huge files:
Q: Which memory requirements does the File Adapter have? Is there a restriction on the maximum file size it can process?
A: The maximum file size that can be processed by the File Adapter depends on a number of factors:
o The most important one is the size of the Java heap, which is shared among all messages processed at a certain point in time. In order to be able to process larger messages without an out of memory error (OOM), it is recommended to increase the size of the available Java heap and/or to reduce the concurrency in the system so that fewer messages are processed in parallel.
o Another factor negatively influencing the maximum message size in releases up to and including XI 3.0 SP 13 is an enabled charcter set (encoding) conversion if the message type is set to "Text".
o Using the transport protocol "File Transfer Protocol (FTP)" also uses more memory for processing than the transport protocol "File System (NFS)" (up to and including XI 3.0 SP 13).
o If the Message Protocol "File Content Conversion" is used in a File Sender channel, consider that not only the size of the input file affects the File Adapter's memory usage, but even more the size of the XML resulting from the conversion, which is usually a few factors larger than the original plain text file.
To reduce the memory consumption in this scenario, consider configuring the setting "Maximum Recordsets per Message" for the sender channel. This will cause the input file to be split into multiple smaller mesages.
Plz do refer the following links:
U may plan the availability of ur communication channel using "Planning Availability Times" feature
http://help.sap.com/saphelp_nw04/helpdata/en/45/06bd029da31122e10000000a11466f/frameset.htm
/people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi
hi check the below links for reference
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10748ef7-b2f0-2910-7cb8-c81e7f284af5
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7086f109-aaa7-2a10-0cb5-f69bd2affd2b
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2498bf90-0201-0010-4884-83568752a857
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cc1ec146-0a01-0010-90a9-b1df1d2f346f
Regards,
Vinod. -
A Select statement with Appending table statement in it.
Hi,
How can I use a select statement with a <Appening table> statement in it.
SELECT DISTINCT <field Name>
FROM <DB table name>
APPENDING TABLE <itab>
WHERE <fieldname> EQ <Itab1-fieldname>
AND <fieldname> EQ <itab2-fieldname>.
Can I use the above select statement.If I'm using this...how this works?
Regards
DharmarajuHi, Dharma Raju Kondeti.
I found this in the SAP online help, hope this can help you.
Specifying Internal Tables
When you read several lines of a database table, you can place them in an internal table. To do this, use the following in the INTO clause:
SELECT ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE <itab>
[PACKAGE SIZE <n>] ...
The same applies to the line type of <itab>, the way in which the data for a line of the database table are assigned to a table line, and the CORRESPONDING FIELDS addition as for flat work areas (see above).
The internal table is filled with all of the lines of the selection. When you use INTO, all existing lines in the table are deleted. When you use APPENDING; the new lines are added to the existing internal table <itab>. With APPENDING, the system adds the lines to the internal table appropriately for the table type. Fields in the internal table not affected by the selection are filled with initial values.
If you use the PACKAGE SIZE addition, the lines of the selection are not written into the internal table at once, but in packets. You can define packets of <n> lines that are written one after the other into the internal table. If you use INTO, each packet replaces the preceding one. If you use APPENDING, the packets are inserted one after the other. This is only possible in a loop that ends with ENDSELECT. Outside the SELECT loop, the contents of the internal table are undetermined. You must process the selected lines within the loop.
Regards,
feng.
Edited by: feng zhang on Feb 21, 2008 10:20 AM -
Problem with append += text in Text Field
Hi guys
i have a problem with append text.
I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
Then i have one String and one Text Field.
Using for loop im getting right results. But when im running script again then im getting same text again.
F.ex.
First time:
City name: Name 1
City name: Name 2
Second time:
City name: Name 1
City name: Name 2
City name: Name 1
City name: Name 2
I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
How to avoid this?
Here is script:
for (var i1:int = 0; i1 < CityArea.length; i1++)
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'> "+CityArea[i1]+"</FONT></P>";
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
_CityAreaTF1 = new TextField();
_CityAreaTF1.border = true;
_CityAreaTF1.wordWrap = true;
_CityAreaTF1.multiline = true;
_CityAreaTF1.selectable = false;
_CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
_CityAreaTF1.name = "CityAreaTF1";
_CityAreaTF1.embedFonts = true;
_CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();I think i found why.
There was no problem with TextField.
There was a problem with Array. "CityArea"
So each time I executed script it added new string in Array. And that is because i got like:
TextField
City 1
City 2
City 1
City 2
Running this script is Ok:
for (var i1:int = 0; i1 < CityArea.length; i1++)
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'> "+CityArea[i1]+"</FONT></P>";
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
But outside of this for loop there is another for loop for adding Cities in CityArray.
I fixed it by adding empty array at the start of function
function myFunc():void
CityArea = [ ]; // Empty array fixed this issue
// LOOP FOR ADDING SHOPS IN CITY AREA
for (var j:int = 0; j < _Shops; j++)
CityArea.push(_Shop);
// FOR LOOP TO ADDING SHOPS IN STRING
for (var i1:int = 0; i1 < CityArea.length; i1++)
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'> "+CityArea[i1]+"</FONT></P>";
_CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
Thank you for your help kglad -
Urgent-Need help with code for Master data enhancement
hi Experts,
I have appended YMFRGR field(Table MARC) to 0MAT_PLANT_ATTR datasource.
The key fields in the MARC table are MATNR and WERKS.Can anybody help with the user exit to populate this field,as am pretty new to ABAP.
Thanks in advanceHi,
go through this link which has the similar problem:
https://forums.sdn.sap.com/click.jspa?searchID=1331543&messageID=2794783
hope it helps.
Thanks,
Amith -
Help with MM_editCmd.CreateParameter insert syntax please
In the past (I guess older ASP version maybe?), the
automatically generated code that DW created using the "insert
record" wizard allowed for easy editing and debugging within the
SQL. I just installed CS3 and created a similar page and the code
used to build the insert statement is quite different.
Unfortunately, I'm not versed well enough in it yet!
I can see how the SQL insert is being built:
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_wp_STRING
MM_editCmd.CommandText = "INSERT INTO test (FName, LName,
Company, Email, BPhone, BFax, MPhone, Props, regDate, Password,
MBroker, MBID, Status, ARID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
MM_editCmd.Prepared = true
...and then it appears to uses some scripting functions to
build the values and replace the ?'s in the CommandText line:
MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param1", 202, 1, 255,
Request.Form("FName")) ' adVarWChar
What I'm struggling with is the values inside each Append
line (202, 1, 255) and what the relate to AND more importantly, how
I can insert my own variable here instead of the form field data.
ex:
MM_editCmd.Parameters.Append
MM_editCmd.CreateParameter("param1", 202, 1, 255, StrMyStringValue)
' adVarWChar
I need help with the syntax. Would it be different if the
variable holds a number value vs. text (assuming the field it's
being inserted into hold numbers)
Also, i USED to be able to add a handly little Response.Write
before the execute insert line that would write the SQL insert
statement to the screen and stop so that I could SEE where the
issues were. I've tried:
Response.Write(MM_editCmd.Parameters)
Response.Write(MM_editCmd.CommandText)
Just can't get the SQL text to display. Is the SQL insert
statement not stored as a variable that i can call?
Thanks VERY much for any help!You can use the concatenate() function to build up your string, as you no doubt know.
As far as the wildcard goes ... your intention must be to try to SET the call variable and later on test the call variable with an IF node. Is that right?
You would be able to test parts of the string using the substr() function - which is based on character position. If that is a fixed value that you know, it's easy. If it's not, you can first use the find() function to locate something (like the "_9"), returning the position, and then use the substr() function to pull it off.
Can you write some pseudo-code here to define exactly your intention? You can set up a dummy script and send a dummy call through using Call Tracer and watch the output to see how your code is working.
Regards,
Geoff -
Hi gurus,
I'm trying to create a input value help with the records from my internal table but I woulkd like also to put the short when the popup displays.
Actually I only have the records.
SELECTION-SCREEN BEGIN OF BLOCK ref WITH FRAME TITLE text-t03.
SELECT-OPTIONS:
s_kstar FOR i_cska-kstar.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_kstar-low.
PERFORM search_kstar USING s_kstar-low.
FORM search_kstar
using kstar type cska-kstar.
SELECT * FROM cska
INTO CORRESPONDING FIELDS OF TABLE i_cska
WHERE kstar LIKE '08%'
OR kstar LIKE '008%'
OR kstar LIKE '0008%'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KSTAR'
dynprofield = 's_kstar'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
TABLES
value_tab = i_cska.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'KSTAR'
tabname = 'i_cska'
IMPORTING
SELECT_VALUE = kstar.
ENDFORM. " SEARCH_KSTAR
Anybody would a solution.
Thx in advance for your help.
Mohamed.Hi Mohamed,
Check the Following.
" Implement your own search Help as below
PARAMETERS : carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
fldate TYPE sflight-fldate.
DATA : itab TYPE TABLE OF sflight WITH HEADER LINE.
DATA : fmap TYPE TABLE OF dselc WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid." If it is a selection Screen
else in PROCESS ON VALUE REQUEST
SELECT * FROM sflight INTO TABLE itab.
SORT itab BY carrid connid fldate.
DELETE ADJACENT DUPLICATES FROM itab
COMPARING carrid connid fldate.
fmap-fldname = 'CARRID'.
fmap-dyfldname = 'CARRID'.
APPEND fmap.
fmap-fldname = 'CONNID'.
fmap-dyfldname = 'CONNID'.
APPEND fmap.
fmap-fldname = 'FLDATE'.
fmap-dyfldname = 'FLDATE'.
APPEND fmap.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
ddic_structure = 'SFLIGHT'
retfield = 'CARIID'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
DYNPROFIELD = 'CARRID'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
value_tab = itab
* FIELD_TAB =
* RETURN_TAB =
dynpfld_mapping = fmap
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
." Just Execute this pilot program and verify
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Cheerz
Ram -
Help with mapping the mod_plsql path with Apache
Hi,
I need help with mapping my pl/SQL Handler path.
Currently i have an URL like this :
http://myhost.com/pls/DADUSER/PLSQLPROC?param1=123
But I need something like :
http://myhost.com/d/PLSQLPROC?param1=123
I tried to rename the "Location Handler" from "pls" to "d", works great, but it always appends my Default DAD User to the URL.
And I tried to map my PL/SQL Handler to "/" and create a DAD User called "d" and set it to default. Didn't worked...
Any help is appreciated....
Bye,
Oliver
nullOliver,
try to use the rewrite directive or the
rewrite engine (mod_rewrite).
Please see the Online documentation for how
to do this:
http://technet.oracle.com/docs/products/ias/doc_library/1021doc_otn/comm.102/a87562/apptroub.htm
Hope it helps
-Stefan -
Help with java digital signing code
hello people.
can anybody help me?
i have find a java code to resolve my problem with sending pay in soap envelope with digital signature and attached certificate. i compiled it with jdk jdk1.6.0_37. and it works.
i need it to work in built-in jvm in oracle 9i. in oracle 9i jvm release is 1.3.1. Java code does not work there. there is an error
class import com.sun.org.apache.xerces.internal.impl.dv.util.Base64 not found in import.
i did not find this class in network.
can anybody help with rewriting it for jvm 1.3.1?
thanks in advance.
code below:
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.*;
import java.security.Key;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.cert.Certificate;
public class Sign {
public static void main(String[] args) throws Exception {
// TODO code application logic here
BufferedReader reader = new BufferedReader(new FileReader("c:\\cert.p12"));
StringBuilder fullText = new StringBuilder();
String line = reader.readLine();
while (line != null) {
fullText.append(line);
line = reader.readLine();
KeyStore p12 = KeyStore.getInstance("pkcs12");
p12.load(new FileInputStream("c:\\cert.p12"), "Hfrtnf$5".toCharArray());
//????????? ????????? ????, ??? ????? ????? ???????????? alias ? ??????
//Key key = p12.getKey("my kkb key", "ryba-mech".toCharArray());
Key key = (Key) p12.getKey("my kkb key", "Hfrtnf$5".toCharArray());
Certificate userCert = (Certificate) p12.getCertificate("my kkb key");
String base64Cert = new String(Base64.encode(userCert.getEncoded()));
//signing
Signature signer = Signature.getInstance("SHA1withRSA");
signer.initSign((PrivateKey) key);
signer.update(fullText.toString().getBytes());
byte[] digitalSignature = signer.sign();
String base64sign = new String(Base64.encode(digitalSignature));
String base64Xml = new String(Base64.encode(fullText.toString().getBytes()));
System.out.println("<certificate>" + base64Cert+"</certificate>");
System.out.println("<xmlBody>" + base64Xml+"</xmlBody>");
System.out.println("<signature>" + base64sign+"</signature>");
Edited by: user13622283 on 22.01.2013 22:08My first search is to see if there is an Apache commons project that provides it. Lo and behold:
http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html
commons-codec. -
Need a little help with RAF logic
So Im making a program to give different users, different rights. This is the method that appends them to file and Map
* Writes the players rights to the appendages
* @param playerName Player to update
* @param playerRights Rights to give the player
* @param pointer The lines index in the files
* @throws IOException If a read/write error occours
public void writeRights(String playerName, Rights playerRights, long pointer) throws IOException {
rightsRAF.seek(pointer);
rightsRAF.write(("\n" + playerName + "::" + playerRights).getBytes());
if(rightsRAF.read() != '\n') {
rightsRAF.seek(rightsRAF.getFilePointer()-1);
rightsRAF.write("\n".getBytes());
rightsMap.put(playerName, playerRights);
}1. The RAF goes to the predetermined index in the file, pointer, which is the line the users name starts on. Entries are stored in the file as "name::RIGHTS"
2.It writes out the players name, and rights
3. It checks to see if it accidentally wrote over the \n
My problem now, is that some rights are longer than others. For example, if there was already an entry, "name::MODERATOR" and you overwrite it, with "name::OWNER" then it would turn into "name::OWNERATOR" because the rest of the line wasn't overwritten.
I need some help with logic to determine how to overwrote the entire line, because sometimes you could go from a short one, to a long one, and need to append a new \n character, and sometimes you could go the other way around from long to short and end up with two words fused, I cant figure out how to determine whats a word that got partially overwritten and whats a new line totally.
ThanksAs pointed out you need to have fixed size records, or at least a maximum size.
You also have another problem nobody commented on yet (I don't think) with the getBytes() calls. At that point in your code you will mangle most unicode Strings.
All things being equal here I think your best solution is to use an embedded database like JavaDB with JDBC. I think you will find an XML solution to slow for your purposes.
If you decide to continue the RAF route though here is an example. I know this is not exactly what you are doing but you can extrapolate from this...
public void updatePlayerName(String playerName, int playerIndex){
int recordlength = 200;
byte[] buff = playerName.getBytes("UTF-8");
if(buff.length>recordlength){
//truncate bytes. this is also not great because a character at the end could be mangled
byte[] temp = new byte[recordlength];
System.arraycopy(buff,0,temp,0,temp.length);
buff = temp;
long pointer = playerIndex * (recordlength+4);// plus 4 bytes per record for actual length
raf.seek(pointer);
raf.writeInt(buff.length);
raf.write(buff);
public String getPlayerName(int playerindex){
int recordlength = 200;
long pointer = playerIndex * (recordlength+4);
raf.seek(pointer);
int lengthToRead = raf.readInt();
//length to read should be checked for sanity or bad things will happen next
byte[] buff = new byte[lengthToRead];
raf. readFully(buff);
return new String(buff,"UTF-8");
}And then of course you'd have to add storing the "rights". It gets complicated in a hurry. I do really recommend the JDBC route.
Maybe you are looking for
-
ITunes sees iPod...but songs do not show up in library
Long story short...I gave my son my old iPod mini. When we couldn't connect both it and my new video iPod to our new computer, we took it to his grandmother's house to use. I've downloaded all of the iPod/iTunes updates, and when the iPod mini is con
-
How can i creat a trigger error invalid trigger specification
i have a stored procedure which i want it to be triggered when an insertion is done on table A and that stored procedure accepts values from the insertion performed in table A and inserts into Table B by either updating the table or insertion into Ta
-
Calling Stored Procedure for Multiple records
Hi, I have an use case where I have more than 2000 item and for every item I need to fetch around 70 more values as out parameters. Also i need to show all thoes values on UI. So calling SP in loop is a problem as I can see the rendering the values a
-
Using this code: Inflater inflater = new Inflater(); FileInputStream fis = new FileInputStream("c:\\a\\unzip.zip"); //args[0].toString() BufferedInputStream bis = new BufferedInputStream(fis); ByteArrayOutputStream bos = new ByteArrayOutputStream();
-
I've seen a few questions about this but none actually answer my specific question. Right...... I've created a slideshow of about 350 photos with music in iPhoto which runs perfectly on the Mac. I then share it into iDVD and add a video, fine. If I v