Small code
The determination of the Fiscal Year/Period in which the Payment took place, is based upon two InfoObjects: 0CLEAR_DATE and 0AC_DOC_TYPE. A routine has to be created in which ABAP code performs the following activities:
- check for every record in the Data package if 0CLEAR_DATE is not equal to blank
o if 0CLEAR_DATE is blank;
 nothing to be done, continue with next line
o if 0CLEAR_DATE is not equal to blank
 find the document number in 0CLR_DOC_NO
 find the line in the Data package* for which the value of 0AC_DOC_NO equals the value of 0CLR_DOC_NO
 from this line, determine the value for 0AC_DOC_TYP
if 0ACDOC_TYP equals any one of the following values: <insert>:
o determine the Fiscal Year/Period based upon 0CLEAR_DATE
o provide the derived value to ZPMTFPER
 otherwise; nothing to be done, continue with next line
NB assumption is that both lines are within the same Data Package; to be determined if this is correct
~Sureh
myArr[] = {1,2,3,5,5}
k = 3
The array has five elements before the method call and will have five elements after the call.
Similar Messages
-
What this small code does? And how do I do it in Unicode.
Hi.
I got the following code and I really don't know what it does or even why. All I know It's not UC enabled ( since it's uxinf the type x).
I was thinking I might be converting from ascii representation to text or something like that but I'm not that sure.
FORM TRANSLATE_FIELD USING STRING_TRAN
CHANGING STRING1.
DATA: STRING(255),
len1(3) type i,
LEN(3) TYPE I,
NUM(3) TYPE I,
I(3) TYPE I.
DATA: C VALUE 'A',
X TYPE X.
FIELD-SYMBOLS:<fc> type c.
STRING = STRING_TRAN.
len1 = strlen( STRING ).
LEN = 0.
NUM = 0.
while len < len1.
i = STRING+len(3).
move i to x.
assign x to <fc> casting type c.
move <fc> to c.
MOVE C TO STRING1+NUM.
len = len + 3.
NUM = NUM + 1.
endwhile.
ENDFORM. " TRANSLATE_FIELD
Thanks
ArielHi.
I want to make this small code UC enabled. Since there is a move of TYPE x into char this is not OK at the mopment.
the problem is I don't really know or understand how to convert itr to UC enabled program.
You can notice it takes clusters of 3 chars (bytes ?) long and convert them to char.
For example 101 = e 100 = d 099 = c.... :-> 101099101 -> ece .
Thanks
Ariel -
How to create multi node /data Tree by using few loops or small code
HI.
I WANT TO CREATE A TREE WHICH IS HAVING MULTI NUMBER OF NODE LEVEL (USER HAVE THE ABILITY TO CREATE AS MANY AS REQUIRED NODE LEVEL OR SUBLEVEL). HOW CAN I POPULATE THE TREE WITH SMALL CODE. AS EVERY NODE LEVEL NEED ON NESTED LOOP. SO HOW CAN I MANAGE TO POPULATE THE NODE WITH FEW LOOPS. OR THERE IS ANY OTHER WAY TO MANAGE THIS PROBLEM.
THANKSHi ,
I am trying to do the job , but i do not understand where
is the problem with my loop , i am sending it , could you
see it , and sujjest me , what to do. or if you have time
can you write the code for me. as i am very much needy for
this job.
The Table is as:-
CREATE TABLE TREE_01(
RECORD_NO NUMBER(10), --
OWN_CODE VARCHAR2(10),
PARENT_NO NUMBER(10),
PARENT_CODE VARCHAR2(10),
LEVELL NUMBER(4),
DEPT NUMBER(6),
CONSTRAINT RNO_PK PRIMARY KEY(RECORD_NO));
INSERT INTO TREE_01 VALUES(1,'1',0,'0',2,8540);
INSERT INTO TREE_01 VALUES(2,'2',0,'0',2,8540);
INSERT INTO TREE_01 VALUES(3,'3',0,'0',2,8540);
INSERT INTO TREE_01 VALUES(4,'4',0,'0',2,8540);
INSERT INTO TREE_01 VALUES(5,'1',1,'0',3,8540);
INSERT INTO TREE_01 VALUES(6,'2',1,'0',3,8540);
INSERT INTO TREE_01 VALUES(7,'3',1,'0',3,8540);
INSERT INTO TREE_01 VALUES(8,'1',3,'0',3,8540);
INSERT INTO TREE_01 VALUES(9,'2',3,'0',3,8540);
the loop shoud look like
|_DataProcessing
| |+Work_orders
| |_Programmers File
| | |_James
| | | |+Requests
| | | |+Leves
| | | |_Projects
| | | |_Projects001
| | |+Steven
|+HealthCare
|+Transportation
So the loop should be such that it can be go to any level of any node.
the Code i writter is As follows.
The Following Procedure is called in form leve
When new forms instance.
PROCEDURE REFRESH_TREE2 IS
CURSOR CUR_DEPT IS
SELECT DEPT
FROM TREE_01 GROUP BY DEPT;
CURSOR CUR_LOOP1(PARENT1 NUMBER,LEVEL1 NUMBER) IS
SELECT RECORD_NO,
OWN_CODE,
PARENT_NO,
DEPT ,
PARENT_CODE,
LEVELL
FROM TREE_01
WHERE LEVELL=LEVEL1
AND RECORD_NO=PARENT1;
CURSOR CUR_LOOP2(PARENT2 NUMBER,LEVEL2 NUMBER) IS
SELECT RECORD_NO,
OWN_CODE,
PARENT_NO,
DEPT ,
PARENT_CODE,
LEVELL
FROM TREE_01
WHERE LEVELL=LEVEL2
AND RECORD_NO=PARENT2;
CURSOR LEVEL(PARENTNO NUMBER) IS
SELECT LEVELL FROM TREE_01 WHERE PARENT_NO=PARENTNO
ORDER BY RECORD_NO;
V_I NUMBER;
V_IGNORE NUMBER;
RG_DEPT RECORDGROUP;
RG_CABI RECORDGROUP;
V_INIT_STATE GROUPCOLUMN;
V_LEVEL GROUPCOLUMN;
V_LABEL GROUPCOLUMN;
V_ICON GROUPCOLUMN;
V_VALUE GROUPCOLUMN;
V_CHANGE_VALUE VARCHAR2(20);
V_CHANGE_VALUE1 NUMBER(3);
V_CHANGE_VALUE2 NUMBER(3);
V_LEVEL_COUNT NUMBER;
BEGIN
SELECT MAX(LEVELL) INTO V_LEVEL_COUNT FROM TREE_01;
RG_DEPT:=FIND_GROUP('DEPT');
if not id_null(RG_DEPT) then
delete_group(RG_DEPT);
end if;
RG_DEPT:=create_group('DEPT');
V_INIT_STATE := add_group_column(RG_DEPT, 'INIT_STATE', NUMBER_COLUMN);
V_LEVEL :=ADD_GROUP_COLUMN(RG_DEPT,'LEVEL',NUMBER_COLUMN);
V_LABEL :=ADD_GROUP_COLUMN(RG_DEPT,'LABEL',CHAR_COLUMN,40);
V_ICON :=ADD_GROUP_COLUMN(RG_DEPT,'ICON',CHAR_COLUMN,20);
V_VALUE :=ADD_GROUP_COLUMN(RG_DEPT,'VALUE',CHAR_COLUMN,15);
V_I :=1;
FOR DEPTREC IN CUR_DEPT LOOP
ADD_GROUP_ROW(RG_DEPT,V_I);
SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,1);
SET_GROUP_CHAR_CELL(V_LABEL ,V_I,FILING.ELOOK_IT(11,0,DEPTREC.DEPT));--MAIN_MINOR));
SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
SET_GROUP_CHAR_CELL(V_VALUE ,V_I,TO_CHAR(DEPTREC.DEPT)); --MAIN_MINOR));
V_I:= V_I +1;
V_CHANGE_VALUE := DEPTREC.DEPT;
FOR I IN 1..V_LEVEL_COUNT LOOP
FOR DEPTREC1 IN CUR_LOOP1(V_CHANGE_VALUE,I) LOOP --MAIN_MINOR,I) LOOP
ADD_GROUP_ROW(RG_DEPT,V_I);
SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,I);
SET_GROUP_CHAR_CELL(V_LABEL ,V_I,DEPTREC1.RECORD_NO);
SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
SET_GROUP_CHAR_CELL(V_VALUE ,V_I,DEPTREC1.RECORD_NO);
V_I:= V_I +1;
SELECT count(LEVELL) INTO V_CHANGE_VALUE1
FROM TREE_01
WHERE RECORD_NO=DEPTREC1.RECORD_NO
AND PARENT_NO=DEPTREC1.PARENT_NO
AND LEVELL=DEPTREC1.LEVELL;
SELECT MAX(LEVELL) INTO V_CHANGE_VALUE2
FROM TREE_01
WHERE RECORD_NO=DEPTREC1.RECORD_NO
AND PARENT_NO=DEPTREC1.PARENT_NO
AND LEVELL=DEPTREC1.LEVELL;
FOR j IN 1..V_CHANGE_VALUE1 loop
FOR LVL IN LEVEL(DEPTREC1.RECORD_NO) LOOP
FOR DEPTREC2 IN CUR_LOOP2(DEPTREC1.RECORD_NO, LVL.LEVELL) LOOP
ADD_GROUP_ROW(RG_DEPT,V_I);
SET_GROUP_NUMBER_CELL(V_INIT_STATE,V_I,1);
SET_GROUP_NUMBER_CELL(V_LEVEL ,V_I,LVL.LEVELL);
SET_GROUP_CHAR_CELL(V_LABEL ,V_I,DEPTREC2.RECORD_NO);
SET_GROUP_CHAR_CELL(V_ICON ,V_I,NULL);
SET_GROUP_CHAR_CELL(V_VALUE ,V_I,DEPTREC2.RECORD_NO);
V_I:= V_I +1;
V_CHANGE_VALUE := DEPTREC2.RECORD_NO;
end loop;
end loop;
END LOOP;
END LOOP;
END LOOP;
END LOOP;
ftree.set_tree_property('NAVIGATOR.NAV_DISPLAY',ftree.record_Group, rg_dept);
end; -
Hi,
I am interested in HANA ..I am totally new to this side ..
I read all papers on HANA .Theoretically I know HANA mostly but wants to taste by practically .
Please can somebody tell me the steps to write a small code on this ??
What tool is required...whether tool is free ...how can I use this tool ...
Please do the needful and guide me .
-AshwiniHi Aswinin,
You can get 30 days free HANA trail . There you can try the theory part you learned .. Welcome to HANA , Enjoy it
scn.sap.com/docs/DOC-28191
Sreehari -
I am new in Java, I need help for small correction of applet code(I'm not confident how to make this correctly)- I need clean a popup banner at applet loading. The about part , which appears by click on 'about' button, can be left without changes, it does not prevent me.
Part of a code containing a popup:
import a.*;
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
public final class dbView extends Applet
implements Runnable, ActionListener, o, ItemListener
public void stop()
if(A != null)
A.dispose();
if(t != null)
t.dispose();
private void _mthvoid()
B = a.i.a(getClass(), "Begin.gif");
e = a.i.a(getClass(), "Right.gif");
z = a.i.a(getClass(), "Left.gif");
u = a.i.a(getClass(), "End.gif");
b = a.i.a(getClass(), "Redo.gif");
J = a.i.a(getClass(), "Binocular.gif");
m = a.i.a(getClass(), "Home.gif");
MediaTracker mediatracker = new MediaTracker(this);
mediatracker.addImage(B, 0);
mediatracker.addImage(e, 0);
mediatracker.addImage(z, 0);
mediatracker.addImage(u, 0);
mediatracker.addImage(b, 0);
mediatracker.addImage(J, 0);
mediatracker.addImage(m, 0);
try
mediatracker.waitForAll();
catch(InterruptedException interruptedexception) { }
private int _mthdo(String s1, String s2)
return s1.indexOf(s2);
public String getAppletInfo()
return "Name: Beer Viewer.java\r\nLager Beer: 1.01\r\nPromouter: Best Beer\r\nBest Beer in the world!\r\nFamous light brand.\r\nLegendary Lager Beer\r\ne-mail: [email protected]";
private void a(Graphics g1)
g1.setColor(Color.white);
g1.drawString("Best Beer in the world!", 125, 260);
g1.drawString("Famous light brand.", 125, 270);
g1.drawString("Legendary Lager Beer", 125, 280);
g1.drawString("e-mail: [email protected]", 125, 290);
private final void _mthfor(String s1)
if(s1 == null || s1.length() == 0)
d = false;
StringBuffer stringbuffer = new StringBuffer();
stringbuffer.append("Beer Viewer\n");
if(d)
stringbuffer.append("Ask for beer: ").append(s1).append("\n");
stringbuffer.append("Best Beer in the world!, Famous light brand\n");
stringbuffer.append("Legendary Lager Beer\n");
stringbuffer.append("Codebase: ").append(getCodeBase().toString()).append("\n");
stringbuffer.append("Documentbase: ").append(getDocumentBase().toString()).append("\n");
k = stringbuffer.toString();
if(d)
o = new c(this, k);
private void f()
remove(q);
q.invalidate();
_mthvoid();yes
-
Good ideas for pattern design to achieve small code size?
Hi there,
i am developing a benchmark set for testing Java performance on J2ME. As this is for resource-constrained devices (PDA, cellphone), the code's size should be as small as possible.
Here is the funny question: for example i have a class with name "LoopBenchmark", it has its own configuration such as "loop times", "operationType". The main program, running on a desktop could judge the configuration and load the class, Say with following snippet:
switch(operationType) {
case: ASSIGNMENT
for (int i = 0; i < loopTimes; i++)
int test = 123;
break;
case: ADDITION
for (int i = 0; i < loopTimes; i++)
int test = 3+7;
break;
case: MULTIPLICATION
for (int i = 0; i < loopTimes; i++)
int test = 3*7;
break;
default:
System.out.println("unknown operation type");
I want to create a JAR which could be load to a PDA and running there later. Of course, i hope the JAR could be as small as possible. How can i get just for example:
for (int i = 0; i < loopTimes; i++)
int test = 3+7;
if i know already from the configuration that user wants to run addtion only? I don't want to pack all such SWITCH-CASE handling into the JAR file. Any ideas?
cheers,
eedychi think that what YATArchivist said goes further than that..
int switchSelector=2;
switch(switchSelector){
case: 0
//effectively not compiled
case: 1
//effectively not compiled
case: 2
//yeah you will get this bit
.....its a guess bassed on faith in the compiler, i admit, but worth a look
very possible to do, and even 20 year old compilers did this, so i see no reaon why java wont, they would calculate the range of values a variable may have at any point and issue warnings if your program was going to generate errors/ contain redundant code -
JLabel on JPanel Disappears(Small CODE!)
Um... I had posted a message a earlier just ot make the complex problem simpler. I have made this small version of my massive code and again the JLabel does not get displayed on the JPanel.
This is urgent please help me.
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
class LabelTry
public static void main(String args[])
JFrame aFrame= new JFrame("This is a Test");
aFrame.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e)
{System.exit(0);
aFrame.setSize(500,500);
Container c = aFrame.getContentPane();
JPanel secPanel = new JPanel();
secPanel.setLayout(null);
secPanel.setBackground(Color.gray);
secPanel.setBorder(BorderFactory.createEtchedBorder());
JLabel aLabel = new JLabel(" ");
aLabel.setBounds(100,100,10,10);
aLabel.setBackground(Color.black);
aLabel.setOpaque(false);
aLabel.setVisible(true);
secPanel.setOpaque(false);
secPanel.add(aLabel);
c.add(secPanel, BorderLayout.CENTER);
aFrame.setVisible(true);
}//end main
}//end class LabelTryI've got it working now, but I cannot get it to work in a bigger program.
the code that runs properly is as follows
/;code
class LabelTry
public static void main(String args[])
JFrame aFrame= new JFrame("This is a Test");
aFrame.addWindowListener(new WindowAdapter()
{public void windowClosing(WindowEvent e)
{System.exit(0);
aFrame.setSize(500,500);
Container c = aFrame.getContentPane();
JPanel secPanel = new JPanel();
secPanel.setLayout(null);
secPanel.setBackground(Color.gray);
secPanel.setOpaque(false);
secPanel.setBorder(BorderFactory.createEtchedBorder());
JLabel aLabel = new JLabel(" ");
aLabel.setBounds(200,200,10,10);
aLabel.setBackground(Color.black);
aLabel.setOpaque(true);
aLabel.setVisible(true);
secPanel.add(aLabel);
c.add(secPanel, BorderLayout.CENTER);
aFrame.setVisible(true);
}//end main
}//end class LabelTry
//end code -
Hello , Can anyone plz tell me how do i get this output from this sample code ? im new to java...
public class Fact2
int factorial (int n) {
int res;
System.out.println(n);
if (n == 1) return 1;
res = factorial (n - 1) * n ;
System.out.println("res " + res);
return res;
public static void main (String [] args) {
Fact2 f= new Fact2();
System.out.println("The factorial of this number is " + f.factorial(5));
The output is :
C:\Documents and Settings\AM>java Fact2
5
4
3
2
1
res 2
res 6
res 24
res 120
The factorial of this number is 120
Here , from 5 to 1 is understood and also the last phrase of course , but from where did the variable "res" have these values 2,6,24 ....2: int factorial (int n) {
3: int res;
4: System.out.println(n);
5: if (n == 1) return 1;
6: res = factorial (n - 1) * n ;
7: System.out.println("res " + res);
8: return res;
9: }
When you call factorial(5) this will happen:
It prints 5 (line 4)
It calls factorial(4) (line 6) - (and waits for it result!!!!!)
factorial(4) shall print 4, and calls factorial(3)
prints 3, calls factorial(2)
prints 2, calls factorial(1)
prints 1, returns 1returns from factorial(1), multiplies it by 2 (line 6), result = 2
prints the result to the screen (line 7)
returns the result (line 8) (thus 2)multiplies the result of factorial(2) with 3 (line 6), result = 6
prints this result, and returns itmultiplies the result of factorial(3) with 4, result = 24
prints this result, and returns itmultiplies the result of factorial(4) with 5, result = 120
prints this result and returns itHope this get things clear to you -
Just want to know it this small code is right
Hello everyone, im back :P
well, i've been doing exercises, but i don't have the solution yet...so could you tell me if this code is right? thanks.
About the constructors etc..i think its right, but i not sure about the last method ( distanceFromTwoPoints() )
If i'd like to test this class, i would ask for 4 coord. (x1,y1) and (x2, y2)..
And solved the distance between those two points..well
I don't understand..
On that code how can i calculate the distance from two points if i just have x1 and y1, i mean ...when i wrote that boolean method ( if the two points are equal) the the "p" variable reference is pointing to x1 and y1 , right? maybe that boolean method is wrong too, cuz i want to compare (x1, y1 ) with (x2, y2) well....when i wrote :
this.x1 == p.x1 etc both are references to x1 and y1, so returns always true.
Do i need to write a setMethod to change the values ?
Is that code comparing two points? thats all i want to know...if yes, so how can i test it?
public class Point {
private double x1;
private double y1;
public Point(final double x1, final double y1){
this.x1 = x1;
this.y1 = y1;
public double getX1() {
return x1;
public double getY2() {
return y1;
public boolean isEqual(final Point p){
return (this.x1 == p.x1 && this.y1 == p.y1);
public double distanceFrom2Points (int x1, int y2, Point p){
return Math.sqrt((this.x1 - p.x1)*(this.x1 - p.x1) + (this.y1 - p.y1)*(this.y1 - p.y1));
I think this code is just working with two coord. x1 and y1 :S where do i put x2 and y2?
"p" is a reference to the x1 and y1 variables, so where are the x2 and y2?
im confused :P
thankspublic class Point {
private double x;
private double y;
public Point(final double x, final double y){
this.x = x;
this.y = y;
public double getX() {
return x;
public double getY() {
return y;
public boolean isEqual(final Point p){
return (this.x == p.x && this.y == p.y);
public double distanceFrom2Points ( Point p){
return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y));
public class TestingPoint {
public static void main(String[] args) {
System.out.print("X1: ");
double x1 = Teclado.doubleLido();
System.out.print("Y1: ");
double y1 = Teclado.doubleLido();
//Teclad.intLido() reads from the console, something like:
//Keyboard.intRead(); we use that.
System.out.print("X2: ");
double x2 = Teclado.doubleLido();
System.out.print("Y2: ");
double y2 = Teclado.doubleLido();
Point p1 = new Point(x1, y1);
Point p2 = new Point(x2, y2);
double distance = p2.distanceFrom2Points(p1.distanceFrom2Points
(x1,x2));
System.out.println("The distance is "+distance);
}the compilation ERROR says: The method distanceFrom2Points(Point) in the type Point is not applicable for the arguments (double, double)
these are the two classes.
What is wrong ?
thanks! -
Can't find the error on this small code :S
Hi , i've just compiled this code and i can't find what is wrong! :(
The compiler is ok, but the output print its not what i was expect.
If u insert 121 (capicua) the answer is: This number its not a capicua :S
what is wrong?
thanks!!
Note: Don't create another code plz.
import java.io.*;
public class Capicua {
public static void main (String[] args) throws Exception {
int digit, num;
int inverted = 0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print(" Insert number: ");
num=Integer.parseInt(br.readLine().trim());
while(num > 0) {
digit = num % 10;
num = num /10;
inverted = inverted * 10 + digit;
if(num == inverted) {
// to be capicua the number inserted must
//be equals to the inverted
System.out.println("Its Capicua!");
}else{
System.out.println("This number is not a Capicua!");
}Please use code tags (see button above posting box) when posting code. It makes it much easier to read.
So, it appears that capicua means palindrome--the number reads the same backwards and forwards. Is that correct?
There are ways of doing this without converting the 121 to a number, but I won't explain that unless you want.
I think your problem is this line:
if (num == inverted)
You have changed "num" within your while loop. Therefore, num is no longer the original input 121.
Try adding println statements like this to watch what happens:
while(num > 0) {
digit = num % 10;
num = num /10;
inverted = inverted * 10 + digit;
System.out.println("digit = " + digit);
System.out.println("num = " + num);
System.out.println("inverted = " + inverted);
} -
Can somebody please help me with this? Security code issue; very small code
Hi All, Iam a Unix admin and trying to learn Java/weblogic. I have a JSP and iam trying to run on my weblogic 81 Service Pack version 3.
My following code failed to work and giving me some security exceptions. Then in my weblogic console i saw
Domain Wide Security Settings > Anonymous Admin Lookup Enabled
The above checkbox is disabled. When i enabled, it worked. I talked to my company "Security" folks and they do not allow this checkbox to be enabled. they are saying fix your code problem......
if somebody can please let me know what a probable fix would, that be great and very helpful.
try{
Environment env = new Environment();
javax.naming.InitialContext ic = new InitialContext();
MBeanHome home = (MBeanHome) ic.lookup(MBeanHome.LOCAL_JNDI_NAME);
DomainMBean dom = home.getActiveDomain();
Set s = home.getMBeansByType("ServerRuntime");
ServerRuntimeMBean srmb = (ServerRuntimeMBean) s.iterator().next();
WebLogicObjectName on = new WebLogicObjectName(home.getDomainName()+":Location="+srmb.getName()+",Name="+srmb.getName()+",Type=ServerConfig");
//WebLogicObjectName on = new WebLogicObjectName(Name="+srmb.getName()+",Type="ServerConfig",Domain="+home.getDomainName()+",Location="+srmb.getName()+");
ServerMBean server = (ServerMBean) home.getMBean(on);
ClusterMBean cluster = null;
if( server != null)
cluster = server.getCluster();did i asked such a dumb question? ... :)Well, yes, sort of. The problem description "My following code failed to work and giving me some security exceptions" doesn't have nearly enough details. Such as, what exceptions, what is it supposed to do, what did it do instead, that sort of thing.
-
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. -
PLZ Help!! Im getting an error in a small code
when i compile this i get an error saying
"variable tax might not have been initialized" for the line that says system.out.printin...........
PLZ HELP!!
THANKS
class A1Q2
public static void main (String[] args)
double income ;
System.out.println ("Please enter yearly income: ");
income = ITI1120.readDouble( );
char tax;
if (income <= 37885) {
tax = 'A';
} else if ( (income > 37885) && (income <= 75769) ) {
tax = 'B';
} else if ( (income > 75769) && (income <= 123184) ) {
tax = 'C';
} else if (income > 123184) {
tax = 'D';
System.out.println("Tax = " + tax);
}Hello slvr99,
Firstly, can you please use the CODE button to format your code when you post? It just makes it a lot easier for us to read.
As for your error, it really is quite literal.
variable tax might not have been initialized
means that the variable you have called "tax" may not have been initialized, you just need to set it:
char tax = ''; -
Please see my small code ( parsing html)
The following code extracts URLs from a webpage. It is working fine for most of the URLs. But not for some, like
http://www.sun.com/java
http://www.kraftfoods.com/
http://www.kitchen-bath.com/
Actually , I observed for these URLs, they are getting redirected. How can I over come this?
Thanks.
Note : there is some redundant code in the program.
import java.io.*;
import java.util.regex.*;
import java.net.*;
import java.util.*;
import java.lang.reflect.*;
import javax.swing.text.html.*;
import javax.swing.text.*;
class Out
public static String[] getLinks(String uriStr) {
List result = new ArrayList();
try {
URL locator = new URL(uriStr);
URLConnection connection = locator.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)");
connection.connect();
// BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
Reader rd = new InputStreamReader(connection.getInputStream());
// Parse the HTML
EditorKit kit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
kit.read(rd, doc, 0);
// Find all the A elements in the HTML document
HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
while (it.isValid()) {
SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
String link = (String)s.getAttribute(HTML.Attribute.HREF);
if (link != null) {
// Add the link to the result list
result.add(link);
it.next();
} catch (MalformedURLException e) {
System.out.println("In Out.java");
System.out.println(e);
e.printStackTrace();
} catch (BadLocationException e) {
System.out.println("In Out.java");
System.out.println(e);
e.printStackTrace();
} catch (IOException e) {
System.out.println("In Out.java");
System.out.println(e);
e.printStackTrace();
// Return all found links
return (String[])result.toArray(new String[result.size()]);
public static void main(String[] args)
String links[] = getLinks(args[0]);
System.out.println(links.length);
for(int i = 0 ; i < links.length ; i++)
System.out.println(links);I made the following changes.Still it is not working.
URL locator = new URL(uriStr);
HttpURLConnection connection = (HttpURLConnection)locator.openConnection();
connection.setInstanceFollowRedirects(true);
Can anyone help me??
Thanks. -
Fork process exception: enclosed small code and exception
A code snapshot is enclosed along with the exception we are getting on our production system.
My class file namely as StatementProcessParametersAction.saveParameters() method does following as enclosed the code snippet.
CODE ------
String val = (String) request.getParameter("x");
String jobId = request.getParameter("jobid");
if ("1234".equals(val)) {
try {
Runtime.getRuntime().exec("java -classpath /export/bea/Mah-ARCS/ARCSDomain/cron ups.arcs.batch.ArcsBatchExecutioner http://arcsreport.inside.ups.com/ArcsContent/arcsinterfaceservlet processType statements command " + jobId);
catch (Exception e) {
e.printStackTrace();
}EXCEPTION ----
ERROR 20 Mar 2006 09:04:53,569 StatementProcessParametersAction.saveParameters(): an unexpected error has occurred. Details: java.lang.UNIXProcess.forkAndExec(Native Method)
java.lang.UNIXProcess.<init>(UNIXProcess.java:52)java.lang.Runtime.execInternal(Native Method)
java.lang.Runtime.exec(Runtime.java:566)java.lang.Runtime.exec(Runtime.java:428)
java.lang.Runtime.exec(Runtime.java:364)java.lang.Runtime.exec(Runtime.java:326)
myapp.arcs.app.action.StatementProcessParametersAction.saveParameters(StatementProcessParametersAction.java:562)
myapp.arcs.app.action.ArcsBaseParametersAction.submitParameters(ArcsBaseParametersAction.java:394)sun.reflect.GeneratedMethodAccessor967.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.grnds.structural.struts.icl.IclLookupDispatchAction.dispatchMethod(IclLookupDispatchAction.java:311)
org.grnds.structural.struts.icl.IclLookupDispatchAction.execute(IclLookupDispatchAction.java:237)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)w
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
myapp.arcs.filter.GZIPFilter.doFilter(GZIPFilter.java:38)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)---------------------
I have done lot of googling on this UNIXProcess.forkAndExec and found out that it is related to our SUN UNIX version 8.0 SWAP space problem. I did one test to reduce the SWAP space to 2 gig from 6 gig and recreated the problem ourself in Testnet.
Now, i was looking for some answers ....
1) I do not like forking a process (as it is like creating a new JVM within an already existing JVM) and do stuff from there. Now, what is the best way to implement these forking scenerios within the same JVM (here BEA Weblogic) and NOT forking a new JVM.
2) Just curiuos --- why does the Unix fork processes uses SWAP space rather than the real memory lying on the Unix box.
I may be asking this question very awkwardly but this is the best way to write my question from my mind. Iam really confused about all this forking and stuff. So, please ignore me if the answer is asked half baked.
Thanks,also to add to my queries ....
in our code, we are catching exception like this ....
catch ( Exception e )
logger.error( TRACE_TAG + methodName + GENERIC_ERROR +
CommonUtils.getStackOutput( e ) );
}Now, the exception that iam getting is a Runtime exception (correct me if iam wrong though) ...
My question is (to learn about exception....:))
isn't Exception is a very high level Exception handling .... does the code need to catch a more specific exception handling like "RuntimeException"
Maybe you are looking for
-
Error in uploading data from DSO to Infocube in 3.5(rsa1old)
While uploading data from DSO to Infocube, I selected Initial update option In schedule tab when I clicked start, an error occured it says: Delete init request REQU_D4YTAGX8PEOUQJLSKOEPH9EV before running init. again with same selection. Can anyone l
-
CD burn problem "unknown error 4450"
Hello everyone, I've been surching quite everywhere about the "unknown error 4450" but nothing found. Does someone know how to resulf this problem??? Please help, because I'd like to burn my downloaded songs.. Thanks!!
-
Multi Apllication Server Setup
Hi, I have a big SAP BPC implementation (7 servers) that i need to implement at my client and the solution requires 3 Application servers. Do I need to install them differently? How will they communicate with each other? How will the Web server know
-
ITunes album artwork still ain't working
I still haven't found anyone with a solution After I import an album, I right click on the album for GET INFO and then assign cover art: But iTunes is not accepting my selection. Sometimes it works - sometimes it doesn't. See the screenshot below, so
-
Updated computer installed new version of DE cannot authorize.."already in use" error
Not sure how to get around this. When i go to authorize w my adobeDE..i get id "already in use". Do i have to create new adobe account to continue? for a new auth number? I cannpt find old number listed anywhere in account info.