Help with small logic
Hi all,
I have an internal with more than 10000 records.
I have data like this
id matnr test
A M1
B M2
C M3
D M4
D M5
C M6
A M7
B M8
NOW I WANT TO SECT TEST A VALUE BASED ON ID
IF ID = A then test = 1
IF ID = B then test = 2
IF ID = C then test = 3
IF ID = D then test = 4
NOW MY OUTPUT SHOULD LIKE THIS
id matnr test
A M1 1
B M2 2
C M3 3
D M4 4
D M5 4
C M6 3
A M7 1
B M8 2
i DON'T WANT TO LOOP AND MODIFY EACH RECORD BY CHECKING.
Is there any statment that would single attempt i.e set test = 1 for all id = A in a single step and another single step for id = B
i did like this
teMP = 1.
modify table itab transporting teMP where id = 'A'.
teMP = 2.
modify table itab transporting temp where id = 'B'.
I know its wrong but iam looking something like this
Thanks
Hi
Please check the following code
Regards
MD
TYPES : begin of TAB,
id(10),
matnr type matnr,
id1 type I,
end of TAB.
DATA : ITAB1 TYPE TABLE OF TAB.
DATA : WA_ITAB1 TYPE TAB.
WA_itab1-id = 'A'.
WA_ITAB1-matnr = 'Matnr1'.
append WA_ITAB1 TO itab1.
WA_ITAB1-id = 'B'.
WA_ITAB1-matnr = 'Matnr2'.
append WA_ITAB1 TO itab1.
WA_ITAB1-id = 'A'.
WA_ITAB1-matnr = 'Matnr3'.
append WA_ITAB1 TO itab1.
WA_ITAB1-id = 'C'.
WA_ITAB1-matnr = 'Matnr1'.
append WA_ITAB1 TO itab1.
CLEAR WA_ITAB1.
WA_ITAB1-ID1 = '1'.
MODIFY ITAB1 FROM WA_ITAB1 TRANSPORTING ID1 WHERE ID = 'A'.
WA_ITAB1-ID1 = '2'.
MODIFY ITAB1 FROM WA_ITAB1 TRANSPORTING ID1 WHERE ID = 'B'.
WA_ITAB1-ID1 = '3'.
MODIFY ITAB1 FROM WA_ITAB1 TRANSPORTING ID1 WHERE ID = 'C'.
LOOP AT ITAB1 INTO WA_ITAB1.
WRITE : / WA_ITAB1-ID,
WA_ITAB1-MATNR,
WA_ITAB1-ID1.
ENDLOOP.
Similar Messages
-
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. -
Help with pnpce logic data base
Hallow I doing a program that use logic data base pnpce(my first time) and in the program I use get peras to bring the employee num and in the loop the name of employee
Something I doing wrong because its not working what?
I just wont to bring to my table person_tab employee num and name.
thankes
Tables :pernr
Nodes:persa
Infotypes:0000 like t_oooo,
00002 like t_0002.
START-OF-SELECTION.
GET peras.
LOOP AT t_0000.
MOVE t_0000-pernr TO person_tab-objid.
APPEND person_tab.
Endloop.
Loop at t0002.
MOVE t_0002-nachn TO person_tab-lastname.
MOVE t_0002-vorna TO person_tab-firstname.
APPEND person_tab.
ENDLOOP.
END-OF-SELECTION.Hi there. I'm not sure what version you are on, but in ERP 2005 this is an obsolete statement. Here's an alternate way to get the information you're looking for:
TABLES: PERNR.
INFOTYPES: 0002.
DATA: BEGIN OF person_tab OCCURS 0,
objid LIKE PERNR-PERNR,
lastname LIKE P0002-NACHN,
firstname LIKE P0002-VORNA,
END OF person_tab.
START-OF-SELECTION.
GET pernr.
person_tab-objid = pernr-pernr.
RP-PROVIDE-FROM-LAST P0002 space sy-datum sy-datum.
person_tab-lastname = p0002-nachn.
person_tab-firstname = p0002-vorna.
APPEND person_tab.
CLEAR person_tab.
END-OF-SELECTION.
Even if you don't end up using this code, you would need to change yours so that you aren't appending to your person_tab table until you have moved all of the data for the fields of your record. By appending twice like you currently are doing, you are creating two separate records (one with just the pernr and another with the first and last name). I hope this helps.
- April King -
Help with Jsp: logic:iterate Cannot create iterator for this collection
Hello,
I am developing a jsp with struts. This is the snap of the code:
<logic:iterate id="prod" collection="productList" >
<tr align="center">
<td><html:text property="prodDesc" size="50" indexed="true"/></td>
<td>
<html:select property="prodUnit" indexed="true">
<option selected>-</option>
<OPTION VALUE='NMB'>NMB
<OPTION VALUE='TEN'>TEN
<OPTION VALUE='TPR'>TPR
<OPTION VALUE='GWH'>GWH
</html:select>
</td>
<td><html:text property="prodQty" size="20" indexed="true"/></td>
<td><html:text property="prodVal" size="20" indexed="true"/></td>
</tr>
</logic:iterate>"productList" is defined as an array of Product[], "prod" is defined as a single Product object in the form. But when i run the page, it gives me this errors:
"javax.servlet.jsp.JspException: Cannot create iterator for this collection".
I also tried to make "productList" an ArrayList type, but it game me this same error.
We are using Websphere 4.0 with Struts 1.1.
Anyone can help?
Thanks a lot.
All the best,
warrenHi , I have similar problem. wonder anyone can help me. I have a datastructure. ArrayList contains list of Hashtable; each Hashtable has two key-value sets ; for each key-value set , value is a ValueObject.
My jsp works ok. but when I click on the radio butten for one radio group, it sets not only the porperty on that row, but the rows belows ,which suppose to be another radio group , because I am using indexed="true". each row should be a individual group seperated by the name poDisplayVO[i] , as show in the html generated .
<!-- JSP -->
<logic:iterate id="poDisplayVO"
name="testForm"
property="poDisplayVOList"
type="java.util.Hashtable">
<tr>
<td>
<bean:write name="poDisplayVO" property="name"/>
</td>
<td>
<% String val = ((java.util.Hashtable)poDisplayVO).get("subjAreaName").toString();%>
<html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="<%=val %>" />
<bean:write name="poDisplayVO" property="subjAreaName"/>
</td>
<td>
<html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="no" /> NO
</td>
<td>
<html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="yes" /> YES
</td>
</tr>
</logic:iterate>
<! ------------------------ html genterated ------------------------------------------------>
the HTML generated as folllows:
<tr>
<td>
Accounting Studies
</td>
<td>
<input type="radio" name="poDisplayVO[0].fosVO.select" value="Accounting">
Accounting
</td>
<td>
<input type="radio" name="poDisplayVO[0].fosVO.select" value="no"> NO
</td>
<td>
<input type="radio" name="poDisplayVO[0].fosVO.select" value="yes"> YES
</td>
</tr>
<tr>
<td>
Accounting Studies
</td>
<td>
<input type="radio" name="poDisplayVO[1].fosVO.select" value="Bookkeeping">
Bookkeeping
</td>
<td>
<input type="radio" name="poDisplayVO[1].fosVO.select" value="no"> NO
</td>
<td>
<input type="radio" name="poDisplayVO[1].fosVO.select" value="yes"> YES
</td>
</tr>
<tr>
<td>
Accounting Studies
</td>
<td>
<input type="radio" name="poDisplayVO[2].fosVO.select" value="Computerized Accounting(Duplicate)">
Computerized Accounting(Duplicate)
</td>
<td>
<input type="radio" name="poDisplayVO[2].fosVO.select" value="no"> NO
</td>
<td>
<input type="radio" name="poDisplayVO[2].fosVO.select" value="yes"> YES
</td>
</tr>
<! ------------------------ action form-----------------------------------------------
public ArrayList getPoDisplayVOList() {
return poDisplayVOList;
public void setPoDisplayVOList(ArrayList list) {
poDisplayVOList = list;
public Hashtable getPoDisplayVO(int i) {
Object obj = poDisplayVOList.get(i);
if (obj == null)
obj = new Hashtable();
poDisplayVOList.add(obj);
return (Hashtable)poDisplayVOList.get(i);
public void setPoDisplayVO(Hashtable programDisplayVO, int i) {
poDisplayVOList.add(i, programDisplayVO);
} -
Dear experts;
I have two tables similar to this below
create table t1
place varchar(1000),
start_time date,
end_time date
insert into t1 values ('NewYork', to_date('2013-01-01', 'YYYY-DD-MM'));
create table t2
date_list date,
week_description varchar(1000)
insert into t2 values (to_date('2013-01-01', 'YYYY-DD-MM'), 'week 1('2013-01-01' - '2013-02-01)')
insert into t2 values (to_date('2013-02-01', 'YYYY-DD-MM'), 'week 1('2013-01-01' - '2013-02-01)')
insert into t2 values (to_date('2013-03-01', 'YYYY-DD-MM'), 'week 2('2013-03-01' - '2013-04-01)')
insert into t2 values (to_date('2013-04-01', 'YYYY-DD-MM'), 'week 2('2013-03-01' - '2013-04-01)')I would like a simple logic that will give me an opportunity to insert new values in my t1 table for a particular given week_description
So take for instance, we have only one row right now in t1, which is NewYork, 2013-01-01
I want a case where I can get week 2 information from t2, so that t1 will end up with the following result.
NewYork, 2013-01-01
NewYork, 2013-03-01
NewYork, 2013-04-01
Kindly note, the week 2 will always be a user input. All help is appreciated.
Edited by: user13328581 on May 17, 2013 5:46 AM
Edited by: user13328581 on May 17, 2013 5:46 AMuser13328581 wrote:
The place will always be gotten from t1 unfortunatelyHow?
Does T1 always have only 1 place?
ie
select distinct place from T1??
What happens when we add:
insert into t1 values ( 'Boston', sysdate );??
How do I derive the Place? -
Help with small wired network?
My office has 7 iMacs and 3 MacBooks using ethernet cables to connect via a hub. I'm trying to establish a wired network between these, so as to allow full browsing and read/write access among them while preventing access to any computer not physically connected.
I understand I can set the home folders to shared, but a few problems present:
1. This seems to establish wireless sharing, whereas we need a wired-only network.
2. I understand how to share between accounts on a single computer, say, accounts A and B on computer X. But how to add permissions for accounts on other computers (e.g. account Y on computer Z)?Yep, I realize that, and it's where I'm stuck at. I'm only seeing two possibilities, neither of which is helpful...
A. allow permissions for "Users & Groups" on the same computer, which ignores the goal of networking users from other computers.
B. allow "Everyone" with a wireless connection, which ignores the goal of creating a network between only the office computers.
So the Receptionist computer wants to allow access to users from the Front Office computer, Technicians computer, and Back Office computer. Back office wants to allow users from the Technicians computer, Front Office computer, and so forth.
But for example, all I can figure out now is how to allow users on the Receptionist computer to allow other users on the Receptionist computer, or else to allow all users from any computer with a wireless connection... -
hey every time i compile i get errors with the JOptionPane.showMessageDialog(s) in the switch statement any help would be great
""incompatible types
found : void""
here is the code
import java.util.Random;
import javax.swing.*;
public class Fish{
String size;
String type;
String location;
public String Fish(String type, String location, String size){
String input = JOptionPane.showInputDialog("Press:" + "\n" + "1 for Bass" + "\n" + "2 for White perch" + "\n" + "3 for Yellow cat fish"
+ "\n" + "4 for Spec Trout" + "\n" + "5 for Red fish" + "\n" + "6 for Grouper");
int choice = Integer.parseInt(input);
switch (choice){
case 1: String input1 = JOptionPane.showInputDialog("what is the size(length) of your bass?");
String input2 = JOptionPane.showInputDialog("where did you catch your bass?");
double siz = Double.parseDouble(input1);
double loc = Double.parseDouble(input2);
String output = JOptionPane.showMessageDialog(null, "Sorry but you bass is not big enough to keep so through it back or i will tell on you");
String output1 = JOptionPane.showMessageDialog(null, "You caught a fresh water bass that is " + siz + "inches long and you caught it in " + loc);
if (siz <= 13)
return output;
else
return output1;
break;
case 2: String input3 = JOptionPane.showInputDialog("what is the size(length) of your White perch?");
String input4 = JOptionPane.showInputDialog("where did you catch your White perch?");
double siz1 = Double.parseDouble(input3);
double loc1 = Double.parseDouble(input4);
String output2 = JOptionPane.showMessageDialog(null, "Sorry but you White perch is not big enough to keep so through it back or i will tell on you");
String output3 = JOptionPane.showMessageDialog(null, "You caught a fresh water White perch that is " + siz1 + "inches long and you caught it in " + loc1);
if (siz1 <= 0)
return output2;
else
return output3;
break;
case 3:String input5 = JOptionPane.showInputDialog("what is the size(length) of your Yellow cat fish?");
String input6 = JOptionPane.showInputDialog("where did you catch your Yellow cat fish?");
double siz2 = Double.parseDouble(input5);
double loc2 = Double.parseDouble(input6);
String output4 = JOptionPane.showMessageDialog(null, "Sorry but you Yellow cat fish is not big enough to keep so through it back or i will tell on you");
String output5 = JOptionPane.showMessageDialog(null, "You caught a fresh water Yellow cat fish that is " + siz2 + "inches long and you caught it in " + loc2);
if (siz1 <= 10)
return output4;
else
return output5;
break;
case 4:String input7 = JOptionPane.showInputDialog("what is the size(length) of your Spec Trout?");
String input8 = JOptionPane.showInputDialog("where did you catch your Spec Trout?");
double siz3 = Double.parseDouble(input7);
double loc3 = Double.parseDouble(input8);
String output6 = JOptionPane.showMessageDialog(null, "Sorry but you Spec Trout is not big enough to keep so through it back or i will tell on you");
String output7 = JOptionPane.showMessageDialog(null, "You caught a salt water Spec Trout that is " + siz3 + "inches long and you caught it in " + loc3);
if (siz1 <= 0)
return output6;
else
return output7;
break;
case 5:String input9 = JOptionPane.showInputDialog("what is the size(length) of your Red fish?");
String input10 = JOptionPane.showInputDialog("where did you catch your Red fish?");
double siz4 = Double.parseDouble(input9);
double loc4 = Double.parseDouble(input10);
String output8 = JOptionPane.showMessageDialog(null, "Sorry but you Red fish is not big enough to keep so through it back or i will tell on you");
String output9 = JOptionPane.showMessageDialog(null, "You caught a salt water Red fish that is " + siz4 + "inches long and you caught it in " + loc4);
if (siz1 <= 0)
return output8;
else
return output9;
break;
case 6:String input11 = JOptionPane.showInputDialog("what is the size(length) of your Grouper?");
String input12 = JOptionPane.showInputDialog("where did you catch your Grouper?");
double siz5 = Double.parseDouble(input11);
double loc5 = Double.parseDouble(input12);
String output10 = JOptionPane.showMessageDialog(null, "Sorry but you Grouper is not big enough to keep so through it back or i will tell on you");
String output11 = JOptionPane.showMessageDialog(null, "You caught a salt water Grouper that is " + siz4 + "inches long and you caught it in " + loc4);
if (siz1 <= 0)
return output10;
else
return output11;
break;
public boolean caught(){
if (Math.random()*(2)+(1)==1){
return true;
else
return false;
public int hooked(String lure, String time){
String input = JOptionPane.showInputDialog("What lure did you use?");
String input1 = JOptionPane.showInputDialog("What time did you catch your fish at? include P.M or A.M");
double lur = Double.parseDouble(input);
double tim = Double.parseDouble(input1);
JOptionPane.showMessageDialog(null, "You hooked you fish with a " + lur + "at " + tim);
Message was edited by:
skullker232i get errors on all the String outputs in the switch it says
"incompatible types
found : void"
<code>
import java.util.Random;
import javax.swing.*;
public class Fish{
String size;
String type;
String location;
public String Fish(String type, String location, String size){
String input = JOptionPane.showInputDialog("Press:" + "\n" + "1 for Bass" + "\n" + "2 for White perch" + "\n" + "3 for Yellow cat fish"
+ "\n" + "4 for Spec Trout" + "\n" + "5 for Red fish" + "\n" + "6 for Grouper");
int choice = Integer.parseInt(input);
switch (choice){
case 1: String input1 = JOptionPane.showInputDialog("what is the size(length) of your bass?");
String input2 = JOptionPane.showInputDialog("where did you catch your bass?");
double siz = Double.parseDouble(input1);
double loc = Double.parseDouble(input2);
String output = JOptionPane.showMessageDialog(null, "Sorry but you bass is not big enough to keep so through it back or i will tell on you");
String output1 = JOptionPane.showMessageDialog(null, "You caught a fresh water bass that is " + siz + "inches long and you caught it in " + loc);
if (siz <= 13)
return output;
else
return output1;
break;
case 2: String input3 = JOptionPane.showInputDialog("what is the size(length) of your White perch?");
String input4 = JOptionPane.showInputDialog("where did you catch your White perch?");
double siz1 = Double.parseDouble(input3);
double loc1 = Double.parseDouble(input4);
String output2 = JOptionPane.showMessageDialog(null, "Sorry but you White perch is not big enough to keep so through it back or i will tell on you");
String output3 = JOptionPane.showMessageDialog(null, "You caught a fresh water White perch that is " + siz1 + "inches long and you caught it in " + loc1);
if (siz1 <= 0)
return output2;
else
return output3;
break;
case 3:String input5 = JOptionPane.showInputDialog("what is the size(length) of your Yellow cat fish?");
String input6 = JOptionPane.showInputDialog("where did you catch your Yellow cat fish?");
double siz2 = Double.parseDouble(input5);
double loc2 = Double.parseDouble(input6);
String output4 = JOptionPane.showMessageDialog(null, "Sorry but you Yellow cat fish is not big enough to keep so through it back or i will tell on you");
String output5 = JOptionPane.showMessageDialog(null, "You caught a fresh water Yellow cat fish that is " + siz2 + "inches long and you caught it in " + loc2);
if (siz1 <= 10)
return output4;
else
return output5;
break;
case 4:String input7 = JOptionPane.showInputDialog("what is the size(length) of your Spec Trout?");
String input8 = JOptionPane.showInputDialog("where did you catch your Spec Trout?");
double siz3 = Double.parseDouble(input7);
double loc3 = Double.parseDouble(input8);
String output6 = JOptionPane.showMessageDialog(null, "Sorry but you Spec Trout is not big enough to keep so through it back or i will tell on you");
String output7 = JOptionPane.showMessageDialog(null, "You caught a salt water Spec Trout that is " + siz3 + "inches long and you caught it in " + loc3);
if (siz1 <= 0)
return output6;
else
return output7;
break;
case 5:String input9 = JOptionPane.showInputDialog("what is the size(length) of your Red fish?");
String input10 = JOptionPane.showInputDialog("where did you catch your Red fish?");
double siz4 = Double.parseDouble(input9);
double loc4 = Double.parseDouble(input10);
String output8 = JOptionPane.showMessageDialog(null, "Sorry but you Red fish is not big enough to keep so through it back or i will tell on you");
String output9 = JOptionPane.showMessageDialog(null, "You caught a salt water Red fish that is " + siz4 + "inches long and you caught it in " + loc4);
if (siz1 <= 0)
return output8;
else
return output9;
break;
case 6:String input11 = JOptionPane.showInputDialog("what is the size(length) of your Grouper?");
String input12 = JOptionPane.showInputDialog("where did you catch your Grouper?");
double siz5 = Double.parseDouble(input11);
double loc5 = Double.parseDouble(input12);
String output10 = JOptionPane.showMessageDialog(null, "Sorry but you Grouper is not big enough to keep so through it back or i will tell on you");
String output11 = JOptionPane.showMessageDialog(null, "You caught a salt water Grouper that is " + siz4 + "inches long and you caught it in " + loc4);
if (siz1 <= 0)
return output10;
else
return output11;
break;
public boolean caught(){
if (Math.random()*(2)+(1)==1){
return true;
else
return false;
public int hooked(String lure, String time){
String input = JOptionPane.showInputDialog("What lure did you use?");
String input1 = JOptionPane.showInputDialog("What time did you catch your fish at? include P.M or A.M");
double lur = Double.parseDouble(input);
double tim = Double.parseDouble(input1);
JOptionPane.showMessageDialog(null, "You hooked you fish with a " + lur + "at " + tim);
</code> -
Help with small office PBX system.
Hello all,
I'm looking for any help or advice here.
We have an old Panasonic PABX, 3 external CO lines and 16 extension lines (only 8 in use).
Question 1.
We have CO1 connected to the fax/broadband number. C02 and CO3 connected to our other number. How is it possible that CO2 and C03 use the same line number but are in fact 2 separate usable lines? I am going to check with BT but is it possible this is a 'feature line' or similar?
Question 2.
An issue has arisen where C03 will not hang up a call. People keep saying they are not able to disconnect the call from the other end either.
Any clarification or clues on this would be greatly appreciated.
Olly.Hi
It is possible to have a business number with more than one line (aux working). Most large business's have this set up, the designation would normally have line 1 line 2 line 3 etc etc.
You would need to talk to who ever supplied the system to you, to get them to check the settings for line 2 (of your main number, which is line 3 on the system. You could contact BT Business Fault reception on 154 to get them to test the line
(If I have helped you in any way to say "Thank You" please click on the star next to the message. Thank You)
If I have solved your Issue please click the "Mark as accepted solution" button. -
Hi there, hope someone can help. Ive been trying to do
something which should be really simple. All I want is to have a
link from a page that opens a small browser window, just big enough
for a table of sizes of something, this will only be about 200px by
50px or something. How do I make a new page in Dreamweaver that is
really nice and small??????
Thanks, RemyWhatadegwaan wrote:
> Hi there, hope someone can help. Ive been trying to do
something which should
> be really simple. All I want is to have a link from a
page that opens a small
> browser window, just big enough for a table of sizes of
something, this will
> only be about 200px by 50px or something. How do I make
a new page in
> Dreamweaver that is really nice and small??????
> Thanks, Remy
>
Add a link the built-ins Open Browser Window behavior - found
in the
Behaviors window.
E. Michael Brandt
www.divahtml.com
www.divahtml.com/products/scripts_dreamweaver_extensions.php
Standards-compliant scripts and Dreamweaver Extensions
www.valleywebdesigns.com/vwd_Vdw.asp
JustSo PictureWindow
JustSo PhotoAlbum, et alia -
Need help with small bit of code
Hello I am using JBuilder 9 and it cannot resolve getHeader() and getSOAPBody() any help will be appreciated to fix the problem or any suggestions
SOAPHeader header = message.getHeader();
SOAPBody body = message.getSOAPBody();
header.detachNode();The jar files are added it reads all the imports but it just doesnt read the lines marked by stars and its coming out with errors
cannot resolve symbol:method getSOAPHeader() in class javax.xml.soap.SOAPMessage (for the 1st 1)
cannot resolve symbol:method getSOAPBody() in class javax.xml.soap.SOAPMessage (for the 2nd 1)
cannot resolve symbol:method getSOAPBody() in class javax.xml.soap.SOAPMessage (for the 3rd 1)
import javax.xml.soap.*;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPHeader;
SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
SOAPBody soapBody = response.getSOAPBody();
//First create the connection
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
//Create the actual message
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
//Create objects for the message parts
SOAPHeader header = message.getSOAPHeader();*******************
SOAPBody body = message.getSOAPBody();***********************
header.detachNode();
//Populate the message
Name bodyName = soapFactory.createName("GetLastTradePrice", "m",
"http://wombats.ztrade.com");
SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
Name name = soapFactory.createName("symbol");
SOAPElement symbol = bodyElement.addChildElement(name);
symbol.addTextNode("SUNW");
URL endpoint = new URL("http://wombat.ztrade.com/quotes");
SOAPMessage response = connection.call(message, endpoint);
connection.close();
SOAPBody soapBody = response.getSOAPBody(); ********************* -
I have two tables some_table1 and some_table2
desc some_table1
Name Type
ID NOT NULL VARCHAR2(16)
NAME VARCHAR2(25)
desc some_table2
Name Type
ID NOT NULL VARCHAR2(16)
STATUS VARCHAR(20);
The requirement is to concatenate INATIVE status value to ID with status = 'INACTIVE' in some_table2.
eg if id in some_table1 and some_table2 = 1 and status in some_table2 = 'INACTIVE', I will have to append
'INACTIVE' || some_table1 name, the question is some_table1 have a lots of names that the length is already 25
characters, the requirement want Inative||' '||name inrespective of the name length, I am not allow to increase the name datatype length , but can reduce name to allow for the Inactive||' '||
declare
cursor c1 IS
select cst1.id,cst1.name,cst2.status
from some_table1 cst1, some_table2 cst2
where cst1.orgid = cst2.orgid
and cst2.status = 'INACTIVE';
c1_data c1%rowTYpe;
BEGIN
OPEN c1;
LOOP
FETCH C INTO c1_data ;
EXIT WHEN C1%NOTFOUND;
UPDATE some_table1
SET NAME = c1_data.status||' '|| c1_data.name
where id = c1_data.id;
END LOOP;
CLOSE;
END;
ORA-12899: value too large for column "TEST"."ID"."NAME" (actual: 34, maximum: 25)
I want to be able to fit the update in inrespctive of the name length, I need a logic to truncate the name so as not to exceed the maximum size.
Thank you.I found the solution. sometable2.status||' '||substr(sometable1.name,1,25-9) since inactive with a space is 9 xters.
Thank you everyone.
Edited by: Ade2 on Feb 11, 2009 5:26 PM -
Hi All
I am trying to write the following script
*INCLUDE ..\finance\system_constants.lgl
*XDIM_MEMBERSET RATE=AVG,END
*SELECT(%IP_Currencies%, "[ID]", "INPUTCURRENCYDIM", "[MD] = 'D' OR [MD]= 'M'") )
*XDIM_MEMBERSET INPUTCURRENCY= %IP_Currencies%
*XDIM_MEMBER RATESRC=RATEINPUT
*WHEN INPUTCURRENCY.MD
*IS "D"
*REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
*ELSE
*REC(RATESRC="RATECALC")
*ENDWHEN
*CLEAR_DESTINATION
*DESTINATION RATESRC=RATECALC
My LGX file looks like this.
*XDIM_MEMBERSET RATE=AVG,END
*XDIM_MEMBERSET INPUTCURRENCY= DZD,USD,ARS,AUD,ATS,BSD,BBD,BEF,BMD,BRL,GBP,BGN,CAD,CLP,CNY,CYP,CZK,DKK,XCD,EGP,EUR,FJD,FIM,FRF,DEM,XAU,GRD,HKD,HUF,ISK,INR,IDR,IEP,ILS,ITL,JMD,JPY,JOD,LBP,LUF,MYR,MXN,NZD,NOK,NLG,PKR,PHP,XPT,PLN,PTE,ROL,RUR,SAR,XAG,SGD,SKK,ZAR,KRW,ESP,XDR,SDD,SEK,CHF,TWD,THB,TTD,TRL,VEB,ZMK
*XDIM_MEMBER RATESRC=RATEINPUT
*WHEN INPUTCURRENCY.MD
*IS "D"
*REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
*ELSE
*REC(RATESRC="RATECALC")
*ENDWHEN
*CLEAR_DESTINATION
*DESTINATION RATESRC=RATECALC
It gets validated fine and it also runs successfully through DPM. But the problem i am facing is that the above script is only running and posting data for USD in RATECALC where as I have lot many currencies listed in "INPUTCURRENCYDIM". It does not execute for any other currency except for USD. I want to run it for all the currencies.
Please suggest.
Diksha.
Edited by: Diksha Chopra on Jun 3, 2010 9:23 PMHi Diksha,
Please check in your inputcurrency dimension, how many members are there with the property MD as D?
I would suggest you to change your scritp to
*INCLUDE ..\finance\system_constants.lgl
*XDIM_MEMBERSET RATE=AVG,END
*XDIM_MEMBER RATESRC=RATEINPUT
*WHEN INPUTCURRENCY.MD
*IS "D"
*REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
*IS "M"
*REC(RATESRC="RATECALC")
*ENDWHEN
*COMMIT
*CLEAR_DESTINATION
*DESTINATION RATESRC=RATECALC
Hope this helps. -
Need help with special logic...
Hi,
i have a query which selects all status changes for tasks. For every NEW status a record is inserted where the new status TYPE and ENTRY_DATE are stored.
A task can have several statuses based on this information (unlimited number of status changes is allowed):
1.) Open (the last inserted status record has type: 'Open')
2.) Closed (the last inserted status record has type 'Closed')
I need to get the following result:
TASK_ID START_TIME STOP_TIME
333450 09-01-09 10:00 09-01-09 11:00
333450 12-01-09 10:00 12-01-09 15:00
333450 12-01-09 16:00 12-01-09 16:00
333450 12-01-09 16:00 CURRENT_DATE
Scenarios:
- Multiple 'Close' records after each other: The START_TIME in the 3d tuple should be copied from the STOP_TIME in the real data.
- No 'Close' record: The STOP_TIME in the 4th tuple should be the CURRENT_DATE.
- Multiple 'Open' records after each other: The STOP_TIME of the previous 'Open' record in the realdata should be the ENTRY_DATE of the 'current' record in the realdata. (THIS ONE ISN'T PRESENT IN THE DATA EXAMPLE!!!)
From this data:
with REALDATA as (
select 104993 PLAN_ID, to_date('09-01-09 10:00','dd-MM-yy HH24:MI') ENTRY_DATE, 'Open' STATUS_DESCRIPTION, 'Open' STATUS_TYPE, 333450 TASK_ID, 'Assembly' TASK_DESCRIPTION from dual
union
select 104993, to_date('09-01-09 11:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union
select 104993, to_date('12-01-09 10:00','dd-MM-yy HH24:MI'), 'Open', 'Open', 333450, 'Assembly' from dual
union
select 104993, to_date('12-01-09 15:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union
select 104993, to_date('12-01-09 16:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union
select 104993, to_date('13-01-09 15:00','dd-MM-yy HH24:MI'), 'Open', 'Open', 333450, 'Assembly' from dual
select TASK_ID, TO_CHAR(ENTRY_DATE,'dd-MM-yy HH24:MI'), STATUS_DESCRIPTION, STATUS_TYPE, TASK_DESCRIPTION from realdata order by ENTRY_DATE
Extra abstraction:_
So the data should be sorted by ENTRY_DATE:
then it should be 'grouped' like this (very abstract: tuples split by comma, between (brackets) is which ENTRY_DATE the data should come from)):
- normal pair
OPEN, CLOSED
result: START_TIME (OPEN) | STOP_TIME (CLOSED)
- multiple open records
OPEN, OPEN, OPEN, CLOSED
result: START_TIME (OPEN) | STOP_TIME (next OPEN), START_TIME (OPEN) | STOP_TIME (next OPEN), START_TIME (OPEN) | STOP_TIME (CLOSED)
- multiple closed records
OPEN, CLOSED, CLOSED
result: START_TIME (OPEN) | STOP_TIME (CLOSED), START_TIME (CLOSED) | STOP_TIME (CLOSED)
- no open record
CLOSED[,CLOSED]
result: START_TIME (CLOSED) | STOP_TIME (CLOSED)[,START_TIME (CLOSED) | STOP_TIME (CLOSED)]
- no closed record
OPEN
result: START_TIME (OPEN) | STOP_TIME (CURRENT_DATE)
- no closed record with multiple open records
OPEN, OPEN
result: START_TIME (OPEN) | STOP_TIME (next OPEN), START_TIME (OPEN) | STOP_TIME (CURRENT_DATE)Edited by: user574699 on Jan 14, 2009 5:09 AM
Edited by: user574699 on Jan 14, 2009 5:30 AM - Extra abstraction at the bottom!Based on your original data, I'd go with something like:
with REALDATA as (select 104993 PLAN_ID, to_date('09-01-09 10:00','dd-MM-yy HH24:MI') ENTRY_DATE, 'Open' STATUS_DESCRIPTION, 'Open' STATUS_TYPE, 333450 TASK_ID, 'Assembly' TASK_DESCRIPTION from dual
union all
select 104993, to_date('09-01-09 11:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union all
select 104993, to_date('12-01-09 10:00','dd-MM-yy HH24:MI'), 'Open', 'Open', 333450, 'Assembly' from dual
union all
select 104993, to_date('12-01-09 15:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union all
select 104993, to_date('12-01-09 16:00','dd-MM-yy HH24:MI'), 'Completed', 'Closed', 333450, 'Assembly' from dual
union all
select 104993, to_date('13-01-09 15:00','dd-MM-yy HH24:MI'), 'Open', 'Open', 333450, 'Assembly' from dual),
trans_data as (select task_id,
task_description,
plan_id,
entry_date,
nvl(lead(entry_date) over (partition by task_id, task_description, plan_id
order by entry_date), sysdate) stop_date,
status_type status,
lag(status_type) over (partition by task_id, task_description, plan_id
order by entry_date) prev_status,
lead(status_type) over (partition by task_id, task_description, plan_id
order by entry_date) next_status
from realdata)
select task_id,
task_description,
plan_id,
entry_date,
case when status = 'Closed' and next_status != 'Closed' then
entry_date
else stop_date
end
from trans_data
where case when status = 'Closed' and prev_status = 'Open' then
1
else 0
end != 1But it looks like your actual data is more complicated than the original set of data (extra statuses for one). Also, you haven't said what should happen (I don't think) in the case of "Open, Close, Open Close" - I've taken it that the 2nd Open should have a start time of the 2nd Open, rather than the stop time of the 1st close. -
Please help with small but annoying 'Open With' finder problem
hello, when I CTRL click a file in finder and select 'Open With' a huge list of apps appear and the same app apperars multiple times. e.g toast appears about 7 times Please have a look at the image below as a picture can say a 1000 words.
[img]http://xs62.xs.to/pics/06016/toomanyapps.jpg.xs.jpg[/img]
iMac G4 1.25ghz 20 Mac OS X (10.4.2)You should be able to fix that by rebuilding the LaunchServices database.
I use OnyX (Maintenance tab, Reset section).
http://www.macupdate.com/info.php/id/11582 -
Hi,
The matnr exists in the table and it should pull something in, however, the following code is not pulling the matrn:
SELECT SINGLE MATNR FROM MARC
INTO LV_MATNR
WHERE MATNR = XVBAP-MATNR
AND WERKS = XVBAP-WERKS
AND ZZLIFNR = LV_ZZLIFNR.
LV_MATNR is type MARC-MATNR.
The other variables exist and i checked in the table for a record, but it does pull it up.
Thanks,
JohnJust looking at ZZLIFNR i assume that it must be a 10 chracter field, to which you should pass a 10 character value(Padded with enouh 0s).
on a side note, you do not need to restrict based on ZZLIFNR at all because, the key for mara is MATNR and WERKS only..
select * from marc into lv_matnr where
matnr = <material> and werks = <Plant>.
if marc-zzlifnr <> <Value you want to compare>.
do some thing.
else.
do something else.
endif.
Maybe you are looking for
-
The ''' character cannot be used in a path.
I am trying to import HTML files from a previous version of online help into a newer version, but am getting the following error: "The filename is invalid. The ''' character cannot be used in a path." I have checked filenames of all HTML topics but I
-
Sun IDM gives "Net Charts error for Process Diagram
My test environment has started to show a strange error. IdM 7.1.1.10 running on Windows 2003. In the admin pages, when I performed a regular server task, I get the following instead of the usual process diagram: {color:#999999}Net{color} Charts vers
-
Install Java JRE 1.4.2 plugin on Phoenix on Windows
How can I install Java JRE 1.42 on Phoenix on Window 2000? In the Java Plugin-in control panel, it only has Mozilla 1.1 and if I click it, it said I don't have mozilla 1.1 install. Thank for your help.
-
Hi I have bought a nokia E51 phone, it is great phone for me , I haven't chance to work with Symbian OS until now, when I want to install any symbian application package (sis file) the phone reject me and show certification error or certification exp
-
Lenovo Vibe Z Bricked :(
Hi, On Thursday last I wanted to re-rooting my smartphone, because previously I had rooted and from one moment to another was un-rooted (I had no idea why) Between trying and trying, no tool served me for root (even I tried and nothing GeniusRoot) Th