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
Similar Messages
-
I upgraded to a newer version of firefox. My ISP is Comcast.
I tried opening up my e-mails they will not open up.I contacted Comcast ,they told me there customers have no problems opening their e-mails.Please help me with this problem asap.
The problem started after I upgraded to the higher version.
Thank you,
Arnold
My phone is: 313 882-9785If it's a thin 1 pixel wide vertical line it's highly likely it could be caused by a defective LCD.
One quick basic way to check is to note the position of the line. Then go to System Preferences, Displays, and lower the resolution. If ther line moves it's on the video and the logic board or video card if fitted is likely to be defective. If the line stays in the same position it's likely to be an LCD fault. Either way to have it repaired you'll need to visit an Apple store or AASP.
The worst offender for this problem is the Late 2006 17" iMac. FOC replacement of the LCD used to be covered by a quality program, but it's now ended.
Steve -
Please, I want to help in correcting this code
I want to know what mistakes in this code where it gives the message (frm-41214 unable to run report)
the code
DECLARE
v_rep_id REPORT_OBJECT;
v_repjob VARCHAR2(100);
v_job_id VARCHAR2(100);
v_rep_status VARCHAR2(100);
v_reportsrvr VARCHAR2(50) := 'rep10';
v_runformat vARCHAR2(50) := 'pdf';
BEGIN
IF :date_from IS NULL and :date_to is null and :ITEM4 is null THEN
RAISE FORM_TRIGGER_FAILURE;
END IF;
v_rep_id := FIND_REPORT_OBJECT('REPORT2');
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_DESTYPE, CACHE);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_SERVER, v_reportsrvr);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_DESFORMAT, v_runformat);
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_OTHER , 'P_date="' || TO_CHAR(:date_from, 'dd/mm/yyyy') || '" P_date1="'|| TO_CHAR(:date_to, 'dd/mm/yyyy') || '"'||'" p_no="' || :ITEM4||'" paramform=no"');
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_FILENAME, 'd:\ltvisits_omayma.rdf');
v_repjob := RUN_REPORT_OBJECT(v_rep_id);
v_job_id := SUBSTR(v_repjob, LENGTH(v_reportsrvr) + 2, LENGTH(v_repjob) );
v_rep_status := REPORT_OBJECT_STATUS(v_repjob);
IF v_rep_status = 'FINISHED' THEN
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid' || v_job_id ||'?server=' || v_reportsrvr || '', '_blank');
ELSE
message('Report failed with error message ');
END IF;
CLEAR_FORM;
END;Hi,
You CANNOT use hardcord path in report name
SET_REPORT_OBJECT_PROPERTY(v_rep_id, REPORT_FILENAME, 'd:\ltvisits_omayma.rdf'); Remove "d:\" part from the report name and then copy your report to FORMS_PATH location.
*If answer is correct then please mark it. -
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!"); -
The font for sign into my yahoo mail is so small that I am unable to make out my ID and password and when I do get into my mailbox, the fonts are far too big and the words overlap. Tried going into tools /options to make changes but not successful, please help.thanks
Reset the page zoom on pages that cause problems, make sure that the window is not maximized:
*<b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
*http://kb.mozillazine.org/Zoom_text_of_web_pages
If you have increased the minimum font size then try the default setting "none" as a high value can cause such issues.
*Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
Make sure that you allow websites to choose their fonts.
*Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"
You can use an extension to set a default font size and page zoom on web pages.
*Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
*NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/ -
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 SQL query...
hi, please consider following:
create table test(col varchar2(255))
insert into test values ('DURATION');
insert into test values ('VOLUME');
select col from test where col in ('DURATION','VOLUME');
this returns the rows.
but my input string is a comma separated list:
DURATION,VOLUME
so i try
select col from test where col in (replace('DURATION,VOLUME',',',''','''));
but no results. Or:
select col from test where col in (''''||replace('DURATION,VOLUME',',',''',''')||'''');
however
select ''''||replace('DURATION,VOLUME',',',''',''')||'''' from dual
gives 'DURATION','VOLUME'
so why doesnt it work?
hope you can help. ThanksAnother solution will be:
SQL> variable comma_sep_value VARCHAR2(100);
SQL> exec :comma_sep_value := 'DURATION,VOLUME,ABCD'
PL/SQL procedure successfully completed.
SQL> SELECT *
2 FROM TEST
3 WHERE INSTR (:comma_sep_value, col) > 0
4 /
DURATION
VOLUME
2 rows selected.
SQL> exec :comma_sep_value := 'DURATION';
PL/SQL procedure successfully completed.
SQL> SELECT *
2 FROM TEST
3 WHERE INSTR (:comma_sep_value, col) > 0
4 /
DURATION
1 row selected.
SQL> exec :comma_sep_value := 'DURATION,VOLUME';
PL/SQL procedure successfully completed.
SQL> SELECT *
2 FROM TEST
3 WHERE INSTR (:comma_sep_value, col) > 0
4 /
DURATION
VOLUME
2 rows selected.Hope this helps.
Regards,
Jo -
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 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 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 -
import java.util.*;
public class ThirteenCards
{//1
Card[] hand;
ArrayList<Card> deck;
Random rand;
public ThirteenCards()
{//2
deck = Card.newDeck();
rand = new Random();
hand = makeHand();
printHand();
}//2
Card[] makeHand()
{//3
Card[] deal = new Card[13];
Arrays.fill(deal, null);
for (int i = 0; i < deal.length; ++i)
deal[i] = pickCard(deal);
return deal;
}//3
Card pickCard(Card[] dealt)
{//4
int i = rand.nextInt(52);
Card c = deck.get(i);
if (! got(c, dealt))
return c;
else
return pickCard(dealt);
}//4
boolean got(Card card, Card[] ca)
{//5
Card cc;
int i = 0;
while ((cc = ca[i++]) != null)
if (cc.equals(card))
return true; // already got } } return false; }
return false;
}//5
public void printHand()
{//6
Card[] spades = new Card[13];
Card[] diamonds = new Card[13];
Card[] clubs = new Card[13];
Card[] hearts = new Card[13];
Arrays.fill(spades, null);
Arrays.fill(diamonds, null);
Arrays.fill(clubs, null);
Arrays.fill(hearts, null);
int si, di, ci, hi;
si = di = ci = hi = 0;
for (Card c : hand)
{//a
System.out.print(c + ", ");
switch(c.suit())
{//b
case SPADES : spades[si++] = c;
break;
case DIAMONDS : diamonds[di++] = c;
break;
case CLUBS : clubs[ci++] = c;
break;
case HEARTS : hearts[hi++] = c;
}//b
}//a
System.out.println();
System.out.print("Spades : ");
for (Card c : spades)
{//c
if (c == null)
{ break;
}//c
System.out.print(ra(c) + ", ");
}//6
System.out.println();
System.out.print("Diamonds : ");
for (Card c : diamonds)
if (c == null)
break;
System.out.print(ra(c) + ", ");
System.out.println();
System.out.print("Clubs : ");
for (Card c : clubs)
if (c == null)
break;
System.out.print(ra(c) + ", ");
System.out.println();
System.out.print("Hearts : ");
for (Card c : hearts)
if (c == null)
{ break;
System.out.print(ra(c) + ", ");
System.out.println();
// System.out.println();
String ra(Card c)
String s = c.getString();
return s.substring(0, s.indexOf(" "));
public void printHandInShortForm()
Card[] spades = new Card[13];
Card[] diamonds = new Card[13];
Card[] clubs = new Card[13];
Card[] hearts = new Card[13];
Arrays.fill(spades, null);
Arrays.fill(diamonds, null);
Arrays.fill(clubs, null);
Arrays.fill(hearts, null);
int si, di, ci, hi;
si = di = ci = hi = 0;
for (Card c : hand)
System.out.print(sf(c) + " ");
switch(c.suit())
case SPADES : spades[si++] = c;
break;
case DIAMONDS : diamonds[di++] = c;
break;
case CLUBS : clubs[ci++] = c;
break;
case HEARTS : hearts[hi++] = c;
System.out.println();
System.out.print("Spades : ");
for (Card c : spades)
if (c == null)
{ break;
System.out.print(sfr(c) + " ");
System.out.println();
System.out.print("Diamonds : ");
for (Card c : diamonds)
if (c == null)
break;
System.out.print(sfr(c) + " ");
System.out.println();
System.out.print("Clubs : ");
for (Card c : clubs)
if (c == null)
break;
System.out.print(sfr(c) + " ");
System.out.println();
System.out.print("Hearts : ");
for (Card c : hearts)
if (c == null)
break;
System.out.print(sfr(c) + " ");
System.out.println();
String sf(Card c)
String s, r;
s = r = null;
switch (c.suit())
case SPADES : s = "s";
break;
case DIAMONDS : s = "d";
break;
case CLUBS : s = "c";
break;
case HEARTS : s = "h";
switch (c.rank())
case DEUCE : r = "2";
break;
case THREE : r = "3";
break;
case FOUR : r = "4";
break;
case FIVE : r = "5";
break;
case SIX : r = "6";
break;
case SEVEN : r = "7";
break;
case EIGHT : r = "8";
break;
case NINE : r = "9";
break;
case TEN : r = "10";
break;
case JACK : r = "j";
break;
case QUEEN : r = "q";
break;
case KING : r = "k";
break;
case ACE : r = "a";
return r + s;
String sfr(Card c)
String sf = sf(c);
return sf.substring(0, sf.length() - 1);
public static void main(String[] args)
ThirteenCards tc = new ThirteenCards();
System.out.println();
System.out.println("[short forms]");
tc.printHandInShortForm();
}//1
I get the following error
ThirteenCards.java:133: 'class' or 'interface' expected
String ra(Card c)
^
1 errorMULTI POST
http://forum.java.sun.com/thread.jspa?threadID=714652&tstart=0 -
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 -
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
Maybe you are looking for
-
How can I do to have the same contacts in all my devices, pc, iPad and iMac?
I have severl devices and the last taime I updated my contacts was almos manually. I would Like to be able to have the same contacts in all, pc, iPad, and iMac. How can I set it so to get it done through iCloud? For instance in my pc ( windows 7 Home
-
Hey friends, Happy Canadian Thanksgiving. I just upgraded to the new iTunes and I am wondering how I can get Home Sharing to allow me share music with my Fiance. We both download a lot of music (all of it purchased from iTunes Music Store) and we hav
-
How do I find the history of sent photos in aperture?
Where do I find the list of where I have sent a photo directly from Aperture. I am wondering if I sent a photo to a certain email and I would like to look it up to see if I already sent it.
-
Error while creating work order from purchase order
Dear All, We are having a subcontracting scenario where we are creating a Work order from PO but getting the below error. Error - "No master data assigned to partners-locations-product combination." Done all the setting mentioned in the below thread
-
How to copy the Data From Oracle Table To SAP Table
Hi Friends, We need to copy the data from Oracle Database Table to SAP Table. The data should be updated simultaneously in both tables . Should I write a program that contains the native sql statement like EXEC SQL PERFORMING WRITE,.... I appreciate