Please help me optimize this code..
i have already checked the indexes of the tables and used the primary keys.
r_datum-sign = gco_sign_i.
r_datum-low = docdate_from.
IF NOT docdate_to IS INITIAL.
r_datum-option = gco_option_bt.
r_datum-high = docdate_to.
ELSE.
r_datum-option = gco_option_eq.
ENDIF.
APPEND r_datum.
CLEAR r_datum.
r_vbeln-sign = gco_sign_i.
r_vbeln-low = docnum_from.
IF NOT docnum_to IS INITIAL.
r_vbeln-option = gco_option_bt.
r_vbeln-high = docnum_to.
ELSE.
r_vbeln-option = gco_option_eq.
ENDIF.
APPEND r_vbeln.
CLEAR r_vbeln.
process_web_rset salesgroup
r_vkgrp
gco_sign_i
gco_option_eq.
* Get Total (Confirmed) Qty
PERFORM get_valid_itemcateg TABLES gr_pstyv.
* Header
SELECT vbak~vbeln
vbkd~inco1
vbak~erdat
vbak~gueen
vbak~ernam
vbkd~bstkd
vbak~kunnr
APPENDING CORRESPONDING FIELDS OF TABLE lt_hdr
FROM vbak INNER JOIN vbkd
ON vbak~vbeln EQ vbkd~vbeln
WHERE vbak~vbeln IN r_vbeln
AND vbak~erdat IN r_datum
AND vbak~vkgrp IN r_vkgrp
AND vbak~kunnr EQ customer
AND vbkd~posnr EQ lv_posnr
SORT lt_hdr BY vbeln.
LOOP AT lt_hdr.
* Customer Name
SELECT SINGLE kna1~name1
INTO lv_cusname
FROM kna1
WHERE kna1~kunnr EQ lt_hdr-kunnr.
MOVE lt_hdr-vbeln TO listing-sa.
MOVE lt_hdr-ernam TO listing-ordered_thru.
MOVE lt_hdr-bstkd TO listing-po.
MOVE lt_hdr-kunnr TO listing-customer.
MOVE lv_cusname TO listing-customer_name.
MOVE lt_hdr-erdat TO listing-date_created.
MOVE lt_hdr-gueen TO listing-valid_until.
CONCATENATE lt_hdr-erdat+6(2) lt_hdr-erdat+4(2) lt_hdr-erdat+0(4) INTO
listing-date_created SEPARATED BY '.'.
CONCATENATE lt_hdr-gueen+6(2) lt_hdr-gueen+4(2) lt_hdr-gueen+0(4) INTO
listing-valid_until SEPARATED BY '.'.
* Get Mode of Sale
IF lt_hdr-inco1 EQ 'FOB'.
listing-incoterms = co_inco1.
ELSEIF lt_hdr-inco1 EQ 'CIF'.
listing-incoterms = co_inco2.
ENDIF.
* Get Status
SELECT SINGLE bezei
FROM tvbst JOIN vbuk
ON tvbst~statu EQ vbuk~gbstk
INTO listing-status
WHERE tbnam EQ co_tbnam
AND spras EQ co_spras
AND fdnam EQ co_fdnam
AND vbuk~vbeln EQ listing-sa.
* Get Ship to party
SELECT SINGLE name1
FROM vbpa INNER JOIN kna1
ON vbpa~kunnr = kna1~kunnr
INTO listing-ship_to
WHERE vbeln EQ listing-sa
AND posnr EQ lv_posnr
AND parvw EQ 'WE'.
* Get Plant
SELECT SINGLE vbap~werks
t001w~name1
FROM vbap INNER JOIN t001w
ON vbap~werks EQ t001w~werks
INTO (listing-plant,
listing-plant_text)
WHERE vbap~vbeln EQ listing-sa
* Items
SELECT SINGLE
a~matnr
a~pstyv
b~bmeng
b~vrkme
INTO (lv_matnr,
lv_pstyv,
lv_bmeng,
lv_vrkme)
FROM vbap AS a INNER JOIN vbep AS b
ON a~vbeln = b~vbeln
AND a~posnr = b~posnr
WHERE a~vbeln = lt_hdr-vbeln
AND a~posnr EQ co_posnr
AND a~pstyv IN gr_pstyv
* Use zshowitem to identify items for display on SO
lv_convvl = 1.
* Convert Quantity
PERFORM check_conversion USING: lv_bmeng
listing-total_uom
lv_pstyv
lv_vrkme
lv_matnr. "<<CR002-DEVK944861 ins
IF listing-total_uom IS INITIAL.
MOVE lv_vrkme TO listing-total_uom.
ENDIF.
IF listing-total_uom IS INITIAL.
MOVE lv_vrkme TO listing-total_uom.
ENDIF.
vl_sum1 = vl_sum1 + lv_bmeng.
* ENDLOOP.
listing-total_qty = vl_sum1.
REFRESH lv_itab.
CLEAR: vl_sum1,
vl_sum2.
* Scheduling Agreement Item and Served Qty
SELECT SINGLE
b~vbeln AS vbeln2
b~rfmng
b~meins
INTO (lv_vbeln2,
lv_rfmng,
lv_meins)
FROM vbap AS a INNER JOIN vbfa AS b
ON a~vbeln EQ b~vbelv
AND a~posnr EQ b~posnv
WHERE a~vbeln = lt_hdr-vbeln
AND a~pstyv IN gr_pstyv
AND b~vbtyp_n EQ co_vbtyp_n.
IF sy-subrc EQ 0.
* Goods Issue Status per Item
SELECT SINGLE wbstk
FROM vbuk
INTO vl_drstatus
WHERE vbeln = lv_vbeln2.
* Convert Quantity
PERFORM check_conversion USING: lv_rfmng
listing-served_uom
lv_pstyv
lv_meins
lv_matnr. " <<CR002-DEVK944861 ins
* Pass Value
IF listing-served_uom IS INITIAL.
MOVE lv_meins TO listing-served_uom.
ENDIF.
vl_served_qty = vl_served_qty + lv_rfmng.
CLEAR: lt_scheditm,
vl_drstatus,
vl_sum3,
vl_meins.
ENDIF.
listing-served_qty = vl_served_qty.
CLEAR vl_served_qty.
* Append List
APPEND listing.
CLEAR: lt_hdr,
lv_itab,
lt_scheditm,
listing,
vl_datum1,
vl_datum2,
vl_sum1,
vl_sum2,
vl_sum3.
ENDLOOP.
IF sy-subrc <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'W'
cl = 'ZECOM'
number = 000
IMPORTING
return = return.
ELSE.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'S'
cl = 'ZECOM'
number = 001
IMPORTING
return = return.
ENDIF.
ENDFUNCTION.
As mentioned by others avoid into corresponding fields.
If you have to join vbak/vbkd then at least try to use
Sales Organization
Distribution Channel
Division
FOr customer name do n ot select for each document, select for all entries in lt_hdr_aux before the loop where lt_hdr_aux[] = lt_hdr[] with adjacent duplicates by customer deleted and then in the loop use read instead.
Don't use inner joins on vbap to other tables instead select vbap information for all documents selected and then read.
etc etc
Use st05 to review which table accesses are giving you a problem and concentrate first on those taking into account
- not to retrieve data multiple times e.g. is customer is cust1 for deoc1 and for doc 10 then only retrieve once as detailed above.
- optimise the actual select statement - no into corresponding, using keys etc
Similar Messages
-
1. This code fragment:
declare
procedure t(ent in varchar)
is
begin
for reg in (
select
/*+nocache*/
opds_psap_numero,
min(opds_data_inicio_tarde) as opds_data_inicio_tarde
from operacoes_diagrama_sap, projeto_sap
where
opds_psap_numero = psap_numero and
psap_pep like ent
group by
opds_psap_numero
) loop
dbms_output.put_line('just teste');
end loop;
end;
begin
t('PR42E-075001%');
end;
Execution Time
***SCRIPT START 29-mar-2007 17:33:25 ***
***SCRIPT END 29-mar-2007 17:35:13 ***
Time = 2 minutes (aprox)
==============================================
2. But this code fragment (the same as before but with static sql):
declare
procedure t(ent in varchar)
is
begin
for reg in (
select
/*+nocache*/
opds_psap_numero,
min(opds_data_inicio_tarde) as opds_data_inicio_tarde
from operacoes_diagrama_sap, projeto_sap
where
opds_psap_numero = psap_numero and
psap_pep like 'PR42E-075001%'
group by
opds_psap_numero
) loop
dbms_output.put_line('just teste');
end loop;
end;
begin
t('PR42E-075001%');
end;
Execution Time
***SCRIPT START : 29-mar-2007 17:39:29***
***SCRIPT END 29-mar-2007 17:39:30***
Time 1 sec
================================================
I need the code of the first example (I must pass an 'in" parameter to the procedure), but with performance of the second.
This query runs very fast when posted in sqlnavigator.
it returns approx 1000 lines and i have an index at projeto_sap.psap_pep field
What am i doing wrong?
Please if you dont understand let me know. English is not my first language. From hot Brazil heheYour second fragment has a string literal 'PR42E-075001%' for the LIKE operator in your WHERE clause. The first fragment uses a PL/SQL parameter, effectively a bind variable.
The optimizer can choose the index for the second fragment because it knows the index will be effective. But the first fragment could have any value for the variable. The optimizer chooses a path that is best for "any value" AND YOU WIND UP WITH A PLAN THAT ...
Hmm, I hit the caps lock by accident there, but it seems strangely appropriate.
Anyway, you can try adding a hint to your query:
/*+ nocache index( projeto_sap index_name */ -
Please help me optimize this process?
I have a process as following, would you please help optimize it if possible?
SO on FG to plant PltA (SO in sap)
PltA placed a subcon PO to PltB for subcon. (PO in sap)
PltB detects shortage of Raw and places a PO to PltA for replenishment (PO & SO in SAP)
PltA receives PO and places another PO to 3rd vendor for dropship purchasing.... (PO & SO in SAP)
Then there will be 3 billings from PltA to customer for SO, from PltA to PltB for Raw, from PltB to PltA for FG.....
eventually, there are 6 orders and 3 billings..........
Anyone can help to simplify this? I thought about transfer PO, but there is no billing....I need the billing.....
Thank you!...
-
class Vehicles
public String name="<unnamed>";
Vehicles Ferrari1=new Vehicles();
Vehicles Honda1=new Vehicles();
Vehicles Toyota1=new Vehicles();
Ferrari.nameFor="Ferrari";
Honda.nameFor="Honda";
Toyota.nameFor="Toyota";
public void main(String[]args)
System.out.println("Hello Folks!");
System.out.println(Ferrari.name);
System.out.println(Honda.name);
System.out.println(Toyota.name);
System.out.println("Bye Now!");
It always says i am missing an indentifier in line 6-8 when i complie. Please help somebody!!!class Vehicles
public String name = "unnamed";
Vehicles Ferrari=new Vehicles();
public void main(String[]args)
System.out.println("Hello Folks!");
Vehicles Ferrari=new Vehicles();
System.out.println(Ferrari.name);
System.out.println("Bye Now!"); -
Please help me debug this code!
HELP! I can't figure out where I'm going wrong. Thank you.
import java.lang.Math.*;
import java.io.*;
public class Feature_Recognizer {
Vertices vertices; /* storage bin for vertices*/
Edges edges; /* storage bin for edges*/
Faces faces; /* storage bin for faces*/
/*** Reads file and stores data into vertices, edges, and faces bins ***/
void readFile(String file)
BufferedReader inputFile = null; /*start reading the input file*/
String[] info;
String temp;
/*need to fix io exceptions in java.lang
* They need to be caught or declared to be thrown*/
try{
inputFile = new BufferedReader(new FileReader(file));
catch (FileNotFoundException e){
System.out.println("File named"+file+"does not exist");
return;
catch (IOException e){
System.out.println("IO Exception. Error reading from:"+file);
return;
/*begin reading in data array, set into vertices/edges/faces*/
inputFile.readLine(); /* will skip comments in input files*/
temp = inputFile.readLine(); /* store number of vertices*/
vertices = new Vertices(Integer.parseInt(temp.trim())); /* initialize the vertices based on data array*/
inputFile.readLine(); /* will skip comments in input files*/
/* store vertices*/
int i=0;
while(i++<vertices.total)
temp = inputFile.readLine();
info = temp.split(" ");
vertices.addVertex(Double.parseDouble(info[0]),Double.parseDouble(info[1]),Double.parseDouble(info[2]));
inputFile.readLine(); /* will skip comments in input files*/
temp = inputFile.readLine(); /* store number of edges*/
edges = new Edges(Integer.parseInt(temp.trim())); /* initialize the edges based on the data array*/
inputFile.readLine(); /* will skip comments in input files*/
/* store edges*/
int i1=0;
while(i1++<edges.total)
temp = inputFile.readLine();
info = temp.split(" ");
edges.addEdge(vertices.getVertex(Integer.parseInt(info[0])),
vertices.getVertex(Integer.parseInt(info[1])),
Integer.parseInt(info[2]));
inputFile.readLine(); /* will skip comments in input files*/
temp = inputFile.readLine(); /* store number of faces*/
faces = new Faces(Integer.parseInt(temp.trim())); /* initialize faces based on the data array*/
inputFile.readLine(); /* will skip comments in input files*/
/* store faces*/
int i2=0;
while(i2++<faces.total)
/* input # of edges*/
temp = inputFile.readLine();
faces.addFace(Integer.parseInt(temp.trim()));
/* input faces*/
temp = inputFile.readLine();
info = temp.split(" ");
int j=0;
while(j++<faces.getFace(i2).Edge_Totals)
if(Integer.parseInt(info[j]) < 0)
faces.getFace(i2).edges.addEdge(edges.getEdge(Math.abs(Integer.parseInt(info[j]))),true);
else
faces.getFace(i2).edges.addEdge(edges.getEdge(Math.abs(Integer.parseInt(info[j]))),false);
/* input normal vector*/
temp = inputFile.readLine();
info = temp.split(" ");
int j1=0;
while(j1++<3)
faces.getFace(i2).normal[j1] = Integer.parseInt(info[j1]);
/***possibly place another IO exception in here
catch (IOException e){
System.out.println("IO Exception");
return;
/*** State Classes: edge, face, vertex ***/
/* Nested Edge object class*/
class Edge{
int identity, /* identity of edge*/
type; /* concave or convex?*/
Vertices vertices; /* vertices that make up the edge*/
Faces faces; /* faces corresponding to the edge*/
double length; /* length of edge*/
/* Edge class constructor*/
Edge(int IDENTITY, Vertex A, Vertex B, int TYPE)
identity = IDENTITY;
vertices = new Vertices(2);
vertices.addVertex(A);
vertices.addVertex(B);
type = TYPE;
faces = new Faces(2);
/* Length_Calculator will compute the length of edge*/
void Length_Calculator()
length = Math.pow( (vertices.getVertex(2).x - vertices.getVertex(1).x)*(vertices.getVertex(2).x - vertices.getVertex(1).x)
+ (vertices.getVertex(2).y - vertices.getVertex(1).y)*(vertices.getVertex(2).y - vertices.getVertex(1).y)
+ (vertices.getVertex(2).z - vertices.getVertex(1).z)*(vertices.getVertex(2).z - vertices.getVertex(1).z)
, .5 );
/* getFaces finds the faces which are related to the edge
(returns the runtime class of an object)*/
void getFaces()
int i=1;
while( i++ <=Feature_Recognizer.this.faces.total){
int j=1;
while( j++<=Feature_Recognizer.this.faces.getFace(i).Edge_Totals){
if(identity == Feature_Recognizer.this.faces.getFace(i).edges.getEdge(j).identity){
faces.addFace(Feature_Recognizer.this.faces.getFace(i));
/* Edges object class (Edge bin)nested Edges Class*/
class Edges
int index, /* current index in array*/
total; /* total number of edges*/
Edge[] edges; /* actual edges bin*/
boolean[] sign; /* positive or negative (for face object)*/
/* Edges class constructor*/
Edges(int Edge_Totals)
index = 0;
total = Edge_Totals;
edges = new Edge[Edge_Totals];
sign = new boolean[Edge_Totals];
/* method to add an already existing Edge object*/
void addEdge(Edge e)
edges[index++] = e;
/* method to an already existing Edge object*/
/* and state if it is negative or positive (for faces only)*/
void addEdge(Edge e, boolean isNegative)
sign[index] = isNegative;
edges[index++] = e;
/* method to create and add an Edge object*/
void addEdge(Vertex a, Vertex b, int type)
edges[index++] = new Edge(index,a,b,type);
/* returns the Edge corresponding to its identity*/
Edge getEdge(int identity)
return edges[identity-1];
/* finds the lengths and faces of each Edge in the bin*/
void Edge_Stats()
int i=0;
while(i++<total){
edges.Length_Calculator();
edges[i].getFaces();
/* Face object class nested face class*/
class Face
int identity, /* edge identity*/
Edge_Totals; /* number of edges that make up the face*/
Edges edges; /* edges that make up the face*/
int[] normal; /* the vector of the normal to the face*/
/* Face class constructor*/
Face(int IDENTITY, int numE)
identity = IDENTITY;
Edge_Totals = numE;
edges = new Edges(numE);
normal = new int[3];
/* Faces object class (Face bin)nested faces class*/
class Faces
int index, /* current index in array*/
total; /* total number of Faces*/
Face[] faces; /* actual faces bin*/
/* Faces class constructor*/
Faces(int numFaces)
index = 0;
total = numFaces;
faces = new Face[numFaces];
/* method to sum an already existing Face object*/
void addFace(Face f)
faces[index++] = f;
/* method to create and sum a Face object*/
void addFace(int numE)
faces[index++] = new Face(index,numE);
/* returns the Face corresponding to its identity*/
Face getFace(int identity)
return faces[identity-1];
/* Vertex object class nested vertex class*/
class Vertex
int identity; /* vertex identity*/
double x,y,z; /* coordinates*/
/* Vertex class constructor*/
Vertex(int IDENTITY, double X, double Y, double Z)
identity = IDENTITY;
x = X;
y = Y;
z = Z;
/* Vertices object class (Vertex bin)nested vertices bin*/
class Vertices
int index, /* current index in array*/
total; /* total number of vertices*/
Vertex[] points; /* actual Vertex bin*/
/* Vertices class constructor*/
Vertices(int numVertices)
index = 0;
total = numVertices;
points = new Vertex[numVertices];
/* method to add an already existing Vertex object*/
void addVertex(Vertex v)
points[index++] = v;
/* method to create and add a Vertex object*/
void addVertex(double x, double y, double z)
points[index++] = new Vertex(index,x,y,z);
/* returns the Vertex corresponding to it's identity*/
Vertex getVertex(int identity)
return points[identity-1];
/* displays each edge's type based on data array and the corresponding faces to that edge*/
void printEdges_Found(){
String shape;
System.out.println("Edge\tType\tFaces");
int i=0;
while(i++<edges.total){
if(edges.getEdge(i).type == 0)
shape = "Concave";
if(edges.getEdge(i).type == 1)
shape = "Convex";
else
println("Input file must have 0 or 1 for shape type");
System.out.println(i + "\t" + shape + "\t" + edges.getEdge(i).faces.getFace(1).identity
+ ", " + edges.getEdge(i).faces.getFace(2).identity + "\t");
System.out.println();
/* VRML output file maker*/
void VRML_Output(String file)
PrintStream outputFile = null;
outputFile = new PrintStream(new FileOutputStream(file));
outputFile.println("#VRML V2.0 utf8");
outputFile.println("\tShape{");
outputFile.println("\t\tgeometry IndexedFaceSet{");
outputFile.println("\t\t\tcoord Coordinate{");
outputFile.print("\t\t\t\tpoint[ ");
int i=0;
while(i++<vertices.total){
if(i > 0)
if(i%4 == 0) {
outputFile.println("\n");
outputFile.print("\t\t\t\t\t");
outputFile.print(vertices.getVertex(i+1).x + " " + vertices.getVertex(i+1).y
+ " " + vertices.getVertex(i+1).z);
if(i != vertices.total-1)
outputFile.print(",");
outputFile.println("]");
outputFile.println("\t\t\t}");
outputFile.print("\t\t\tcoordIndex[");
int i3=1;
while(i3++<=faces.total){
int j2=0;
while(j2++<faces.getFace(i3).edges.total){
if(faces.getFace(i3).edges.sign[j2])
outputFile.print(faces.getFace(i3).edges.getEdge(j2+1).vertices.getVertex(1).identity-1 + ", ");
else
outputFile.print(faces.getFace(i3).edges.getEdge(j2+1).vertices.getVertex(2).identity-1 + ", ");
outputFile.println("-1");
if(i != faces.total)
outputFile.print("\t\t\t\t ");
outputFile.println("\t\t\t]");
outputFile.println("\t\t}");
outputFile.println("\t}");
outputFile.close();
/*** feature recognition step:***/
/* finds the slots*/
void Slot_Finder()
int i=1;
while(i++<=edges.total){
double L=0.0, W=0.0, H=0.0;
if(edges.getEdge(i).type == 0) {
int vertexID = edges.getEdge(i).vertices.getVertex(1).identity;
int j=1;
while(j++<=edges.total)
if(vertexID == edges.getEdge(j).vertices.getVertex(1).identity || vertexID == edges.getEdge(j).vertices.getVertex(2).identity){
if(edges.getEdge(j).vertices.getVertex(1).z - edges.getEdge(j).vertices.getVertex(2).z != 0)
H = edges.getEdge(j).length;
else
if(edges.getEdge(j).length > L){
W = L;
L = edges.getEdge(j).length;
else
W = edges.getEdge(j).length;
System.out.println("A slot was found at edge #" + i + " with length " + L + ", width " + W + " and height " + H);
/* finds the bases*/
void Base_Finder()
int i=1;
while(i++<=faces.total)
if(faces.getFace(i).normal[2] == -1)
double L, W;
if (faces.getFace(i).edges.getEdge(1).length >= faces.getFace(i).edges.getEdge(2).length )
L = faces.getFace(i).edges.getEdge(1).length; W = faces.getFace(i).edges.getEdge(2).length;
else
L = faces.getFace(i).edges.getEdge(2).length; W = faces.getFace(i).edges.getEdge(1).length;
System.out.println("A base was found at face #" + i + " with length " + L + " and width " + W);
/* finds the ribs*/
void Rib_Finder()
int i=1;
while(i++<=faces.total){
if(faces.getFace(i).normal[2] == 1) {
double L, W;
if ( faces.getFace(i).edges.getEdge(1).length >= faces.getFace(i).edges.getEdge(2).length ){
L = faces.getFace(i).edges.getEdge(1).length; W = faces.getFace(i).edges.getEdge(2).length;
else {
L = faces.getFace(i).edges.getEdge(2).length; W = faces.getFace(i).edges.getEdge(1).length;
if(W < 1.5 && faces.getFace(i).edges.getEdge(1).type == 1 && faces.getFace(i).edges.getEdge(2).type == 1)
System.out.println("A rib was found at face #" + i + " with length " + L + " and width " + W);
/*** main program***/
public static void main(String[] args) {
Feature_Recognizer a = new Feature_Recognizer();
a.readFile(args[0]);
a.edges.Edge_Stats();
a.Edges_Found();
a.VRML_Output(args[1]);
a.Slot_Finder();
a.Base_Finder();
a.Rib_Finder();
}/*main ends here*/Try formatting your code better. Or use an auto formatter.
You have too many '}' before this statement delete one.
There is no such package as java.lang.Math
You have about 4 more bugs to fix to get it to compile.
Nearly there. -
Please help me correct this code
Hi, I have to develop a Java applications that converts a positive number from base 10 to another base. It has to prompt the user to enter the number to be converted an the base to be converted into. After conversion is completed, the program should ask for another conversion. The program would run in a loop until the user would decide to end it. In case of an error entry as a base less than 2, the program should warn the user about the type of error and ask the user to re-enter the values. At the nd of the program, provide a statistic with how many conversions the user has done.
Please look at code below, and see where i went wrong, i can't seem to figure out the formula for conversions.
import java.io.*;
public class Class1
public static void main (String[] args)throws IOException
int num=0;
int base=0;
int result;
int rem;
int arr[]=new int[20];
int count=0;
boolean prompt= true;
for(int i=0; i<arr.length; i++)
while(prompt)
//int i=0 ;
String s;
int x;
BufferedReader aa =
new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a positive number for the conversion:");
s = aa.readLine();
num = Integer.parseInt(s);
System.out.println("Enter the base number that you want to convert your number:");
s=aa.readLine();
base = Integer.parseInt(s);
if(base >= 2)
if(num > 0)
{ rem= num%base;
num=num/base;
arr=rem;
System.out.println("The converted number is: " + arr[i]);
System.out.print("Would you like to go on (yes/no)?");
s=aa.readLine();
prompt= s.equalsIgnoreCase("no");
count++;
//i++;
else
System.out.println("The number must be greater that 0, please enter an other number!!");
else
System.out.println("The base number is not the appropriate,must be greater of two!!");
//promt the user if he/she wants to continiue or not
System.out.println("You have used the conversion thingy " count " times, You Freak!");
System.in.read();Since I have already started this I will try to make the conversion work. ( usually I do not like to to other people's homework ).
import java.io.*;
public class Class1
static char[] theDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
public static void main (String[] args)throws IOException
int num=0;
int base=0;
int result;
int rem;
String arr[]=new String[20];
int count=0;
boolean prompt= true;
for(int i=0; i<arr.length && prompt; i++) {
while(prompt) {
String s;
int x;
BufferedReader aa =
new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a positive number for the conversion:");
s = aa.readLine();
num = Integer.parseInt(s);
System.out.println("Enter the base number that you want to convert your number:");
s=aa.readLine();
base = Integer.parseInt(s);
if( base >= 2 && base < 17 ) {
if (num > 0) {
s = "";
while ( num > 0 ) {
rem= num%base;
s = theDigits[rem] + s;
num=num/base;
arr[count] = new String(s);
count++;
//promt the user if he/she wants to continiue or not
System.out.println("The converted number is: " + s + " base " + base );
System.out.print("Would you like to go on (yes/no)?");
s=aa.readLine();
prompt= s.equalsIgnoreCase("yes");
else
System.out.println("The number must be greater that 0, please enter an other number!!");
else
System.out.println("The base number is not the appropriate,must be greater of two and lower of 17!!");
System.out.println("You have used the conversion thingy " +count +" times, You Freak!");
System.in.read();
}kurt -
Please help me optimize this query
Hi,
Can you’ll please recommend me if there is any way to optimize the SQL statement below.
I have 3 tables:
item_master: contains master list of items
item_rentout: items currently out on rent
item_missing: items having special status like missing, withdrawn and so on.
I want to find items that are currently available.
Which is items in table item_master –(minus) items in table item_rentout –(minus) items in table in item_missing.
This is how my sql statement is:
select item_master.item_id from item_master where item_master.item_id not in
((select item_id from item_rentout) union (select item_id from item_missing where status in (‘missing’,withdrawn’)))Regards,
RajaIn addition to what Pointless posted (which is very valuable information!) you could always try and write a logical equivalent SQL statement. It may generate a more favorable plan.
I have written the following that I think may work but they are untested:
SELECT ITEM_MASTER.ITEM_ID FROM ITEM_MASTER
MINUS
SELECT ITEM_ID FROM ITEM_RENTOUT
MINUS
SELECT ITEM_ID FROM ITEM_MISSING WHERE STATUS IN ('missing','withdrawn')
SELECT item_master.item_id
FROM ITEM_MASTER IM
WHERE NOT EXISTS
SELECT NULL
FROM ITEM_RENTOUT IR
WHERE IR.ITEM_ID = IM.ITEM_ID
AND NOT EXISTS
SELECT NULL
FROM ITEM_MISSING IIM
WHERE IIM.ITEM_ID = IM.ITEM_ID
) -
PLEASE HELP ME WITH THIS CODE I NEED A NAV BAR ASAP!!!!
The code is below I just want a simple navigation bar that when I click on biography it takes me to the biography page and so on...I even tried the "href" nothing works I try it in live view and it doesnt work I try it out of live view and it still doesnt work Im using DW CS5 This page was made using a DW template but I changed it around to fit my liking
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WebIntersect &Bull;Find ElizabethVictoria</title>
<style type="text/css">
<!--
body {
background: #000;
margin: 0;
padding: 0;
color: #FCCFDD;
background-color: #000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
line-height: 1.4;
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
color: #FCCFDD;
font-weight: bold;
text-align: center;
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
color: #000;
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color:#808080;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
a:visited {
color: #FCCFDD;
text-decoration: underline;
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
color: #FCCFDD;
/* ~~ this container surrounds all other divs giving them their percentage-based width ~~ */
.container {
width: 80%;
max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
background: #000;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
/* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
.header {
background: #000;
color: #FCCFDD;
.sidebar1 {
float: left;
width: 20%;
padding-bottom: 10px;
background-color: #000;
background-image: url(images/Untitled-6.gif);
background-repeat: no-repeat;
.content {
padding: 10px 0;
width: 60%;
float: left;
.sidebar2 {
float: left;
width: 20%;
padding: 10px 0;
background-color: #000;
background-image: url(images/Untitled-6.gif);
/* ~~ This grouped selector gives the lists in the .content area space ~~ */
.content ul, .content ol {
padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
/* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
ul.nav {
list-style: none; /* this removes the list marker */
border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
margin-bottom: 15px; /* this creates the space between the navigation on the content below */
ul.nav li {
border-bottom: 1px solid #666; /* this creates the button separation */
ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
padding: 5px 5px 5px 15px;
display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
text-decoration: none;
background: #8090AB;
color: #000;
ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
background: #6F7D94;
color: #FFF;Where is your html code? or better yet a link to your site in question.
-
hi to all experts ,
my requirement is print a barcode..The first part is an alv with two editable fields when user checks the checkbox and changes the second coloumn that no of prints are to be printed ....everything is fine but the problem is if suppose first 3 checkboxes are checked and qty to print is 3 for each .So the total no of prints should be 9 which im able to see in the print preview ......but the problem is when after seeing the print preview when we are back to the alv screen and uncheck one checkbox so now the pages should be 6 but it is still 9 what could be the problem here is my code since i cannot post full im sending in parts.......any help will greatly apprieciated ..........................thanks
TYPE-POOLS: slis.
*TYPES DECLARATIONS
TYPES:BEGIN OF ty_output,
cbox(1) TYPE c,"selection checkbox
menge1 TYPE char16,"QUANTITY TO PRINT
mblnr TYPE mkpf-mblnr,"MATERIAL DOCUMENT NUMBER
bwart TYPE mseg-bwart,"MOVEMENT TYPE
btext TYPE t156t-btext,"MOVEMENT TYPE DESCRIPTION
matnr TYPE mseg-matnr,"MATERIAL NUMBER
maktx TYPE makt-maktx,"MATERIAL DESCRIPTION
menge2 TYPE mseg-menge,"QUANTITY
meins TYPE mseg-meins,"BASE UNIT OF MEASUREMENT
werks TYPE mseg-werks,"PLANT
lgort TYPE mseg-lgort,"STORAGE LOCATION
ebeln TYPE mseg-ebeln,"PO DOCUMENT NUMBER
lifnr TYPE mseg-lifnr,"VENDOR
bldat TYPE mkpf-bldat,"DOCUMENT DATE
budat TYPE mkpf-budat,"POSTING DATE
usnam TYPE mkpf-usnam,"USER ID
xblnr TYPE mkpf-xblnr,"MATERIAL SLIP
END OF ty_output.
TYPES : BEGIN OF ty_data,
menge TYPE mseg-menge,"QUANTITY
mblnr TYPE mkpf-mblnr,"MATERIAL DOCUMENT NUMBER
bwart TYPE mseg-bwart,"MOVEMENT TYPE
matnr TYPE mseg-matnr,"MATERIAL NUMBER
meins TYPE mseg-meins,"BASE UNIT OF MEASUREMENT
werks TYPE mseg-werks,"PLANT
lgort TYPE mseg-lgort,"STORAGE LOCATION
ebeln TYPE mseg-ebeln,"PO DOCUMENT NUMBER
lifnr TYPE mseg-lifnr,"VENDOR
bldat TYPE mkpf-bldat,"DOCUMENT DATE
budat TYPE mkpf-budat,"POSTING DATE
usnam TYPE mkpf-usnam,"USER ID
xblnr TYPE mkpf-xblnr,"MATERIAL SLIP
END OF ty_data.
TYPES: BEGIN OF ty_btext,
btext TYPE t156t-btext,
bwart TYPE t156-bwart,
END OF ty_btext.
TYPES : BEGIN OF ty_maktx,
maktx TYPE makt-maktx,
matnr TYPE makt-matnr,
END OF ty_maktx.
TYPES: BEGIN OF ty_mard,
matnr TYPE mard-matnr,
lgpbe TYPE mard-lgpbe,
END OF ty_mard.
*INTERNAL TABLES
DATA: it_output TYPE STANDARD TABLE OF ty_output,
it_data TYPE STANDARD TABLE OF ty_data,
it_btext TYPE STANDARD TABLE OF ty_btext,
it_maktx TYPE STANDARD TABLE OF ty_maktx,
it_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
it_events TYPE STANDARD TABLE OF slis_alv_event,
it_header TYPE slis_t_listheader,
it_smart TYPE STANDARD TABLE OF zmm_im_001_struc,
it_mard TYPE STANDARD TABLE OF ty_mard.
*WORK AREAS
DATA: wa_output TYPE ty_output,
wa_data TYPE ty_data,
wa_btext TYPE ty_btext,
wa_maktx TYPE ty_maktx,
wa_fieldcat TYPE slis_fieldcat_alv,
wa_events TYPE slis_alv_event,
wa_header TYPE slis_listheader,
wa_smart LIKE LINE OF it_smart,
wa_layout TYPE slis_layout_alv,
wa_mard TYPE ty_mard.
*FLAGS AND CONSTANTS
DATA: fl_sel TYPE flag.
DATA: fl_del TYPE flag,
gv_count TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:
so_mblnr FOR mkpf-mblnr,
so_bwart FOR mseg-bwart,"MOVEMENT TYPE
so_bldat FOR mkpf-bldat,"DOCUMENT DATE
so_budat FOR mkpf-budat,"POSTING DATE
so_matnr FOR mseg-matnr,"MATERIAL ID
so_meins FOR mseg-meins,"BASE UNIT OF MEASUREMENT
so_werks FOR mseg-werks,"PLANT
so_lgort FOR mseg-lgort,"STORAGE LOCATION
so_lifnr FOR mseg-lifnr,"VENDOR
so_xblnr FOR mkpf-xblnr,"MATERIAL SLIP
so_ebeln FOR mseg-ebeln,"PURCHASE DOC
so_usnam FOR mkpf-usnam.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2
WITH FRAME TITLE text-002.
PARAMETERS : 1x3 RADIOBUTTON GROUP
grp1 DEFAULT 'X',
2x4 RADIOBUTTON GROUP
grp1.
SELECTION-SCREEN END OF BLOCK b2.
*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 1(82) text-007.
*SELECTION-SCREEN COMMENT 89(4) text-008. " First part of your comment
*SELECTION-SCREEN END OF LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_mblnr-low.
*GETTING F4 HELP FOR THE
>FIELD MBLNR( MATERIAL DOCUMENT NUMBER)
PERFORM get_f4val .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_mblnr-high.
GETTING F4 HELP FOR THE
FIELD MBLNR( MATERIAL DOCUMENT NUMBER)
PERFORM get_f4val .
AT SELECTION-SCREEN.
PERFORM valid_bwart.
PERFORM valid_selscreen.
if no records are found displaying an error message
IF sy-dbcnt EQ 0.
MESSAGE e003(zmimr012).
ENDIF.
START-OF-SELECTION.
PERFORM get_data.
PERFORM populate_data.
PERFORM get_fcat.
PERFORM get_events.
PERFORM populate_events.
PERFORM get_layout.
PERFORM display_alv.
Refresh : it_output,
it_data,
it_smart.
*& Form GET_DATA
FORM get_data .
SELECT b~menge
a~mblnr
b~bwart
b~matnr
b~meins
b~werks
b~lgort
b~ebeln
b~lifnr
a~bldat
a~budat
a~usnam
a~xblnr
INTO CORRESPONDING
FIELDS OF TABLE it_data
FROM mkpf AS a
INNER JOIN mseg AS b ON
amblnr = bmblnr
AND amjahr = bmjahr
WHERE a~mblnr IN so_mblnr
AND b~bwart IN so_bwart
AND b~bwart IN ('101', '105')
AND a~bldat IN so_bldat
AND a~budat IN so_budat
AND b~matnr IN so_matnr
AND b~matnr NE space
AND b~werks IN so_werks
AND b~lgort IN so_lgort
AND b~ebeln IN so_ebeln
AND b~lifnr IN so_lifnr
AND a~xblnr IN so_xblnr
AND a~usnam IN so_usnam.
SELECT btext
bwart
FROM t156t
INTO TABLE it_btext
FOR ALL ENTRIES IN it_data
WHERE spras EQ 'EN'
AND bwart = it_data-bwart
AND sobkz = ''
AND kzbew = 'B'
AND kzzug = ''
AND kzvbr = ''.
SELECT maktx
matnr
FROM makt INTO
TABLE it_maktx
FOR ALL ENTRIES IN it_data
WHERE matnr EQ it_data-matnr
AND spras EQ 'E'.
SELECT matnr
lgpbe
FROM mard INTO
TABLE it_mard
FOR ALL ENTRIES IN it_data
WHERE matnr EQ it_data-matnr
AND werks EQ it_data-werks
AND lgort EQ it_data-lgort.
ENDIF.
ENDFORM. " GET_DATA
*& Form GET_F4VAL
FORM get_f4val .
TYPES : BEGIN OF ly_mblnr,
mblnr TYPE mkpf-mblnr,
END OF ly_mblnr.
DATA: lc_mblnr TYPE dfies-fieldname
VALUE 'MBLNR',
lc_s_mblnr TYPE help_info-dynprofld
VALUE 'SO_MBLNR-LOW',
lc_dynnr
TYPE sy-dynnr VALUE '1000',
lc_repid TYPE sy-repid.
DATA: lt_mblnr TYPE STANDARD
TABLE OF ly_mblnr,
lv_mblnr TYPE ly_mblnr,
lt_return TYPE STANDARD TABLE OF
ddshretval WITH HEADER LINE.
CLEAR:lt_mblnr[],lv_mblnr,lt_return[],lt_return.
SELECT mblnr FROM mkpf
INTO TABLE lt_mblnr.
SORT lt_mblnr.
DELETE ADJACENT DUPLICATES FROM lt_mblnr.
lc_repid = sy-repid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = lc_mblnr
value_org = 'S'
dynpprog = lc_repid
dynpnr = lc_dynnr
dynprofield = lc_s_mblnr
TABLES
value_tab = lt_mblnr
return_tab = lt_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ELSE.
lc_mblnr = lt_return-fieldval.
ENDIF.
ENDFORM. " GET_F4VAL
Edited by: mozam khan on Feb 28, 2009 4:39 AM*& Form PF_STATUS
FORM pf_status_set USING
ex_tab TYPE slis_t_extab .
SET PF-STATUS 'ZMIMR012_GUI' EXCLUDING ex_tab.
ENDFORM. " PF_STATUS
*& Form user_command
text
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield .
DATA: p_ref1 TYPE REF TO cl_gui_alv_grid.
CASE r_ucomm .
WHEN 'EXEC' .
CLEAR p_ref1.
IF p_ref1 IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = p_ref1.
ENDIF.
IF p_ref1 IS NOT INITIAL.
CALL METHOD p_ref1->check_changed_data.
ENDIF.
LOOP AT it_output INTO wa_output WHERE cbox EQ 'X'.
READ TABLE it_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
IF sy-subrc EQ 0.
wa_smart-lgpbe = wa_mard-lgpbe.
ENDIF.
wa_smart-matnr = wa_output-matnr.
wa_smart-maktx = wa_output-maktx.
wa_smart-meins = wa_output-meins.
wa_smart-bldat = wa_output-bldat.
wa_smart-no_cop = wa_output-menge1.
APPEND wa_smart TO it_smart.
CLEAR: wa_smart,wa_output.
ENDLOOP.
CALL METHOD p_ref1->REFRESH_TABLE_DISPLAY.
CHECK fl_del NE 'X'.
IF 1x3 = 'X'.
PERFORM print_smartform1x3.
ELSE.
PERFORM print_smartform2x4.
ENDIF.
WHEN 'SEL_ALL'.
fl_sel = 'X'." setting up the flag for all selection.
PERFORM sel_rec.
rs_selfield-refresh = 'X'.
WHEN 'DES_ALL'.
fl_del = 'X'.
PERFORM del_sel.
rs_selfield-refresh = 'X'.
ENDCASE.
ENDFORM. " user_command
" top_of_page
*& Form display_alv
FORM display_alv .
DATA: l_repid TYPE sy-repid.
l_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_pf_status_set = 'PF-STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'top_of_page'
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = wa_layout
it_fieldcat = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = it_events
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_output
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_alv
*& Form get_layout
FORM get_layout .
wa_layout-box_fieldname = 'CBOX' .
wa_layout-box_tabname = 'IT_OUTPUT'.
wa_layout-colwidth_optimize = 'X'.
ENDFORM. " get_layout
" print_smartform_1x3
*& Form valid_bwart
text
--> p1 text
<-- p2 text
FORM valid_bwart .
TYPES:BEGIN OF ly_bwart,
bwart TYPE mseg-bwart,
END OF ly_bwart.
DATA:it_bwart TYPE TABLE OF ly_bwart WITH HEADER LINE.
IF so_bwart[] IS NOT INITIAL.
SELECT bwart FROM mseg INTO TABLE it_bwart
FOR ALL ENTRIES IN so_bwart[]
WHERE bwart <= so_bwart-high AND bwart => so_bwart-low.
LOOP AT it_bwart.
IF it_bwart-bwart NE '101' OR it_bwart-bwart NE '105' .
CONTINUE.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " valid_bwart
*& Form print_smartform2x4
text
-->P_WA_SMART text
-->P_IT_SMART text
FORM print_smartform1x3.
DATA : fm_name TYPE rs38l_fnam,
control_parameters TYPE ssfctrlop,
wa_job_output_info TYPE ssfcrescl,
ssfcompin TYPE ssfcompin,
ssfcompop TYPE ssfcompop.
ssfcompin-dialog = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
ARCHIVE_PARAMETERS =
USER_SETTINGS = 'X'
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJ =
OUTPUT_OPTIONS =
control_parameters = control_parameters
IMPORTING
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
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 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMM_IM_001'
variant = ' '
direct_call = ' '
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
LOOP AT it_smart INTO wa_smart.
IF wa_smart-no_cop IS NOT INITIAL.
MOVE wa_smart-no_cop TO gv_count.
ENDIF.
DO gv_count TIMES.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = control_parameters
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = ssfcompop
USER_SETTINGS = 'X'
wa_display = wa_smart
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDDO.
CLEAR gv_count.
CLEAR : wa_smart.
ENDLOOP.
CALL FUNCTION 'SSF_CLOSE'
IMPORTING
job_output_info = wa_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " print_smartform2x4
*& Form print_smartform2x4
text
--> p1 text
<-- p2 text
FORM print_smartform2x4 .
DATA : fm_name TYPE rs38l_fnam,
control_parameters TYPE ssfctrlop,
wa_job_output_info TYPE ssfcrescl,
ssfcompin TYPE ssfcompin,
ssfcompop TYPE ssfcompop.
ssfcompin-dialog = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
ARCHIVE_PARAMETERS =
USER_SETTINGS = 'X'
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJ =
OUTPUT_OPTIONS =
control_parameters = control_parameters
IMPORTING
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
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 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZMM_IM_002'
variant = ' '
direct_call = ' '
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
control_parameters-no_open = 'X'.
control_parameters-no_close = 'X'.
LOOP AT it_smart INTO wa_smart.
IF wa_smart-no_cop IS NOT INITIAL.
MOVE wa_smart-no_cop TO gv_count.
ENDIF.
DO gv_count TIMES.
CALL FUNCTION fm_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = control_parameters
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = ssfcompop
USER_SETTINGS = 'X'
wa_display = wa_smart
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDDO.
CLEAR: gv_count.
ENDLOOP.
CALL FUNCTION 'SSF_CLOSE'
IMPORTING
job_output_info = wa_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " print_smartform2x4
*& Form valid_selscreen
text
--> p1 text
<-- p2 text
FORM valid_selscreen .
SELECT b~menge
a~mblnr
b~bwart
b~matnr
b~meins
b~werks
b~lgort
b~ebeln
b~lifnr
a~bldat
a~budat
a~usnam
a~xblnr
INTO CORRESPONDING
FIELDS OF TABLE it_data
FROM mkpf AS a
INNER JOIN mseg AS b ON
amblnr = bmblnr
AND amjahr = bmjahr
WHERE a~mblnr IN so_mblnr
AND b~bwart IN so_bwart
AND b~bwart IN ('101', '105')
AND a~bldat IN so_bldat
AND a~budat IN so_budat
AND b~matnr IN so_matnr
AND b~matnr NE space
AND b~werks IN so_werks
AND b~lgort IN so_lgort
AND b~ebeln IN so_ebeln
AND b~lifnr IN so_lifnr
AND a~xblnr IN so_xblnr
AND a~usnam IN so_usnam.
ENDFORM. " valid_selscreen
*& Form sel_rec
text
--> p1 text
<-- p2 text
FORM sel_rec .
DATA: lv_tabix TYPE sy-tabix.
LOOP AT it_output INTO wa_output.
lv_tabix = sy-tabix.
wa_output-cbox = 'X'.
MODIFY it_output FROM wa_output TRANSPORTING cbox.
CLEAR: wa_output.
ENDLOOP.
ENDFORM. " sel_rec -
Please, Help me check this code
public Data class{
private static void new(){
PreparedStatement ps = conn.prepareStatement("INSERT INTO Members " +
"VALUES(?, ?, ?, ?)");
ps.setString(1, "14");
ps.setString(2, "Mike");
ps.setString(3, "Nwabikwo");
ps.setString(4, "14/10/2008");
ps.executeUpdate();
public static void main(String [] arg){
new();
Where conn is a Connection object that connects to JDBC-ODBC
When I tried to run it, I expect it to update the Database but it does not
and no exception is reported.
Please, tell me where the problem is.Phemmy wrote:
public Data class{
private static void new(){
PreparedStatement ps = conn.prepareStatement("INSERT INTO Members " +
"VALUES(?, ?, ?, ?)");
ps.setString(1, "14");
ps.setString(2, "Mike");
ps.setString(3, "Nwabikwo");
ps.setString(4, "14/10/2008");
ps.executeUpdate();
public static void main(String [] arg){
new();
Where conn is a Connection object that connects to JDBC-ODBC
When I tried to run it, I expect it to update the Database but it does not
and no exception is reported.
Please, tell me where the problem is.it's because you don't commit the update and close your Connection properly. you don't close any resources correctly, so your code is flawed in every way.
you save a date as a string? awful. make a date a date.
% -
Please help me with this code. Newbie here!
Hi all,
Below is a sample from the project that I am doing now. Would someone be so kind as to tell me how come the internal frame doesn't appear and the compiler keeps returning an error pointing to "setContentPane(mainDeskTop);"?
Thanks in advance.
package myprojects.xmlquery;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class XMLQuery extends Frame {
public XMLQuery() {
super("XMLQuery"); //Don't know what is this statement for?
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
JDesktopPane mainDeskTop;
mainDeskTop = new JDesktopPane(); //a specialized layered pane
JInternalFrame frame = new JInternalFrame("test",true,true,true,true);
frame.setSize(100,100);
frame.setLocation(0,0);
frame.setVisible(true); //set frame visible
mainDeskTop.add(frame);
try {
frame.setSelected(true);
} catch (java.beans.PropertyVetoException e) {}
setContentPane(mainDeskTop);
public static void main(String args[]) {
System.out.println("Starting XMLQuery...");
XMLQuery mainFrame = new XMLQuery();
mainFrame.setSize(400, 400);
mainFrame.setTitle("XMLQuery");
mainFrame.setVisible(true);Extend JFrame instead of Frame.
Denis -
Please help me transform this C++ code to java code....
guys...please help me transform this C++ code to java code....please try to explain the code..thanks
[program]
#include <stdio.h>
#define ALIVE 1
#define DEAD 0
#define SZ 33
int stschk (int ,int );
main()
int s[SZ][SZ], i, j;
for (i=0; i<sz; i++ ) s[0] = DEAD;
for (j=0; j<sz; j++ ) s[0][j] = DEAD;
s[0][1] = ALIVE;
for (i=0; i<sz-1; i++) {
for ( j=1;j<sz;j++ ) {
s[i][j] = stschk(s[i][j-1],s[i+1][j];
if(s[i][j-1]==ALIVE) printf("*");
else printf(" ");
printf("\n");
int stschk(int s1,int s2)
if(((s1==DEAD)&&(s2==ALIVE))||
((s1==ALIVE)&&(s2==DEAD))) return ALIVE;
else return DEAD;Being picky, that's not C++, that's C. Standard headers in C++ dont' have .h after them, loop variables are scoped with the for, you use constants rather than #defines, etc..
C and C++ both don't initialise arrays by default; you'd have to write an initialiser to get it to zero out the array:
int s[sz][sz] = {};gcc will insert a call to memset to zero the array.
If the author was assuming that the array was zeroed out, there would be no point zeroing the first row and column.
The code reads values which haven't been initialised. If you mark such values explicitly undefined, and change the program to report an error when undefined, then you get several cases where the program makes such report.
So either it' s a primitive random number generator (some random number generators use uninitialised memory as a source of randomness), or it's buggy, or it's processing undefined data and throwing away the result. Either way, it cannot be directly be ported to Java if the undefined values (which are limited to a small area of the ouput) are significant. -
i brought a iTunes card and the the code on the back is not there it has faded away can u please help me with this problem
Hi Daniel ...
Try here > iTunes Store: Invalid, inactive, or illegible codes -
Hello Team,
I have upgraded My leopard to Mountain lion 10.7 via snow leapeard. Now My itunes is not working properly nor I able to install google chrome successfully. Please help me in this occasion.
Also, I am not being able to upgrade Mac OS X 10.7 to 10.7.4 or letest for lion.
I am facing following messages when I open itunes ( I down loaded and install new for 10.7)
Process: iTunes [463]
Path: /Applications/iTunes.app/Contents/MacOS/iTunes
Identifier: com.apple.iTunes
Version: 10.7 (10.7)
Build Info: iTunes-10702101~1
Code Type: X86-64 (Native)
Parent Process: launchd [273]
Date/Time: 2012-10-22 23:33:07.226 +0200
OS Version: Mac OS X 10.7 (11A390)
Report Version: 8
Interval Since Last Report: 4918 sec
Crashes Since Last Report: 2
Per-App Crashes Since Last Report: 2
Anonymous UUID: 3DE933E2-7A48-4840-91F4-7DC466ED9C26
Crashed Thread: 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
@executable_path/../Frameworks/iPodUpdater.framework/Versions/A/iPodUpdater
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/iPodUpdater.framework/Versions/A/iPodUpdater
Referenced from: /Applications/iTunes.app/Contents/MacOS/iTunes
Reason: unsafe use of @executable_path in /Applications/iTunes.app/Contents/MacOS/iTunes with restricted binary
Binary Images:
0x102a96000 - 0x103c36fff com.apple.iTunes (10.7 - 10.7) <0CC47E12-134F-A9E1-7E4F-3EAC797C3050> /Applications/iTunes.app/Contents/MacOS/iTunes
0x7fff62696000 - 0x7fff626cb1ff dyld (195 - ???) <71093406-21CF-3DBE-A001-802259ED5300> /usr/lib/dyld
Model: MacBook4,1, BootROM MB41.00C1.B00, 2 processors, Intel Core 2 Duo, 2.4 GHz, 2 GB, SMC 1.31f1
Graphics: Intel GMA X3100, GMA X3100, Built-In, 144 MB
Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz, 0xAD00000000000000, 0x48594D503131325336344350362D59352020
Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz, 0xAD00000000000000, 0x48594D503131325336344350362D59352020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x88), Broadcom BCM43xx 1.0 (5.10.131.36.5)
Bluetooth: Version 2.5.0b13, 2 service, 12 devices, 2 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: FUJITSU MHY2160BH, 160.04 GB
Parallel ATA Device: MATSHITADVD-R UJ-867
USB Device: Built-in iSight, apple_vendor_id, 0x8501, 0xfd400000 / 2
USB Device: USB Receiver, 0x046d (Logitech Inc.), 0xc52f, 0x1d100000 / 2
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8205, 0x1a100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x022a, 0x5d200000 / 3
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x5d100000 / 2
And Google chrome just keep loading the page for hours and nothing is appear on its browser. But safari and firefox working absolutly fine.
In addition, I have reboot computer as well but it never worked. Please help me in this occasion.
Eagerly waiting for your response on this issue.
Best Regards,You need to upgrade your copy of MS Office. You're using a version that is 8 years old (at least). You can buy Office 2011, which will work. You could also get a copy of Pages from the App Store, which is cheaper and will open Word files (though not perfectly). Or you could get a free Office clone, like OpenOffice or LibreOffice.
-
Can someone please help me understand this
I am a new poster here and was hoping someone might be able to help me...
I am writing a program that is supposed to generate a non applet (IE text) version of a 4-way intersection....however i have run into a problem that i simply cannot see a solution....please tell me why this code does not do what it is supposed to:
in i meant to call the car arrives method which is supposed to enqueue based on some randomly determined parameters, known as direction and bound....it is supposed to loop through and do that for every car created.. what i think is happnening is that everything is getting overwritten rather than enqueued...what i dont understand is why...the reason i believe that nothing is enqueuing is because later in the code i attempt to dequeue these queues and and set a paramter and i get a null pointer exception
PLEASE NOTE I RECIEVED THESE ERRORS BEFORE INSTANTIATING THE VEHICLE CURRENT CAR AS NULL...perhaps it is an instantiation problem but i cannot tell...please help me out as I have worked on this forthe last few days and am desparate for an answer
Vehicle CurrentCar = null;
do
//this ensures that the number of vehicles generated is within the spec guidelines
if (j == 1)//might need to be changed
numCars = generator.nextInt(7) + 4;
else if ((j%2) == 0)
numCars = generator.nextInt(6) + 10;
else if ((j>1)&&( (j%2) !=0))
numCars = generator.nextInt(4) + 10;
totalCars += numCars;
System.out.println("j is " + j);
System.out.println( numCars);
System.out.println(totalCars);
//this ensures the number of vehicles never goes over 100
if (totalCars>100)
int subCars = (totalCars - 100); //ensures that car total never goes above 100
numCars = numCars - subCars;
//calls the MakeMeaCar method which contains the vehicle constructor
for (int k=1;k <= numCars; k++)
CurrentCar = MakeMeACar(count);
count ++;
Street.CarArrives(CurrentCar);
CurrentCar.toString();
HERE IS THE CAR ARRIVES METHOD
public static void CarArrives (Vehicle CurrentCar)
//These if-else statements evaluate the enum parameters from the vehicle class and assigns them to a queue based on those parameters
if (CurrentCar.getDirection() == Directenum.s)
if ((CurrentCar.getBound() == Boundenum.nB) || (CurrentCar.getBound() == Boundenum.wB))
lfstrChurchNorthbound.enqueue(CurrentCar);
else if (CurrentCar.getBound() == Boundenum.eB)
rChurchNorthbound.enqueue(CurrentCar);
else if (CurrentCar.getDirection() == Directenum.n)
if ((CurrentCar.getBound() == Boundenum.sB) || (CurrentCar.getBound() == Boundenum.eB))
lfstrChurchSouthbound.enqueue(CurrentCar);
else if (CurrentCar.getBound() == Boundenum.wB)
rChurchSouthbound.enqueue(CurrentCar);
else if (CurrentCar.getDirection() == Directenum.e)
if ((CurrentCar.getBound() == Boundenum.wB) || (CurrentCar.getBound() == Boundenum.sB))
lfstrMainEastbound.enqueue(CurrentCar);
else if (CurrentCar.getBound() == Boundenum.nB)
rMainEastbound.enqueue(CurrentCar);
else if (CurrentCar.getDirection() == Directenum.w)
if ((CurrentCar.getBound() == Boundenum.eB) || (CurrentCar.getBound() == Boundenum.nB))
lfstrMainWestbound.enqueue(CurrentCar);
else if (CurrentCar.getBound() == Boundenum.sB)
rMainWestbound.enqueue(CurrentCar);
if you need more code to help please let me know...i would post it all but it about 8 pages or more total (inlcuding the various classes)
thanks
I appreciate all help givenok running it through a debugger DID NOT HELP at all, please somebody help me, im very desparate now. i have spent 15 hours on this problem alone. i see absolutley nothing wrong with my code and have tried about 10 doifferent ways of trying this.,....i cannot get it to work, somebody please help me, ...in addition i was hoping someone could clear up an issue i have with enums...i do not understand how i can access the variable of the enum, the only access to it my text book provides is how to acess the string associated with enums....but i need to access the variable itself...how would i design such a get method....ive tried that a bunch of different ways as well, and right now im so lost that i want to cry, somebody please help, im begging on my knees...i really need someone to explain this to me....
Maybe you are looking for
-
"There was an error opening this document. The filename, directory name, or volume label syntax is incorrect." I tried different versions, no avail. I think it has to do with the password somehow, but I do not know. I can copy the files from the web
-
My iTunes for windows no longer automatically syncs my iPhone when started
I used to be able to do a daily backup of my iPhone by simply plugging into my computer. iTunes would automatically start and do the sync. That suddenly stopped under version 10.6.0.40. The iPhone is recognized and I can manually sync it, just not
-
How debug a routine created in InfoPackage for Data selection ?
Hi everybody, I decide to debug a routine create in InfoPackage. Here, the name of my ABAP routine: program conversion_routine form compute_TREATMENT_DATE When i execute the "/h" command to launch debugger, i don't see this routine in Call Stack... H
-
Dv7t Quad - Windows 7 64bit - Internal HP Webcam not detected by Device Manager
New system - one re-install of Windows 7 Ultimate, 64 bit. All else is running as expected. (SimplePass is even cooperating.) Webcam is missing from the Device Manager. I believe the onboard (internal) HP TrueVision HD Webcam worked originally (a
-
[SOLVED] Emacs dependent on Ubuntu font family
Installed emacs, and when I tried to run it, this what it said: Font `Ubuntu Mono 13' is not defined And it wouldn't start. I had to install ttf-ubuntu-font-family to make it run. File ~/.emacs was empty, and nothing resembling ubuntu (except for a f