Some help passing values
Maybe it's because Im so tired, but I am having a horrible day trying to run anything in more than one method.
I set everything as public, so I don't know what I am doing wrong.
import java.io.*;
import java.util.*;
public class mainMenu extends CalcSalesTax{
public static int UI()throws Exception {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
int selected = Integer.parseInt(input.readLine());
double total = 0;
public static void Menu(){
System.out.println("Please Select:");
System.out.println("1: to Calculate Tax");
System.out.println("or");
System.out.println("0 to Exit");
selected = Integer.parseInt(input.readLine());
return selected;
public static void main(String[] args)throws Exception {
selected = UI();
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
while (selected==1){
switch(selected){
case 0:
return;
case 1:
salesTax();
break;
}I am getting errors like, cannot find "selected"... please help me out... is it a syntax thing?
For better guidance, you will need to post your code for the superclass CalcSalesTax as we cannot guess what class / instance fields and methods it has.
I think you have a problem with understanding the scope of variables. Take a quick look at
{color:#0000ff}http://home.cogeco.ca/~ve3ll/jatutor2.htm#st{color}
Execution blocks are the sections of code that start and end with curly brackets. Variables maintain their definition (or 'scope') until the end of the execution block that they are defined in.
FWIW I have reworked your code, but I expect you to ask about the changes you don't understand -- and post the updated code for both MainMenu and CalcSalesTax and any superclass/es of CalcSalesTax.import java.io.*;
import java.util.*;
public class MainMenu extends CalcSalesTax {
int selected = 1;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
public MainMenu () {
while (selected == 1) {
menu ();
switch (selected) {
case 0:
System.exit (0);
case 1:
salesTax(); // mehod in super class ?
private void menu () {
System.out.println("Please Select:\n1: to Calculate Tax\nor\n0 to Exit");
String inString = input.readLine()
try {
selected = Integer.parseInt(inString);
} catch (NumberFormatException ex) {
selected = 0;
ex.printStackTrace ();
public static void main (String[] args) throws Exception {
MainMenu mainMenu = new MainMenu ();
}Disclaimer: I don't have a JDK on this office machine, so there may be typos in the code posted.
db
Edited by: Darryl.Burke to remove whatever typos I could spot.
Similar Messages
-
Help passing values to graphics
I am able to create some graphics in a stand-alone app, but I am having some difficulty passing values from one class to a sub class of JPanel.
I can create a blank bar graph, the x and y axis, the title and labels, etc, but I need some values from another class passed in, and I'm not sure where to do this. Any suggestions would be appreciated.
Below is a simple gradebook program, and I want to be able to graph the individual scores along with the averages on each of three tests. The problem is in the DrawChart class.
thanks in advance!
//This starts the graphical representation of the data<br />
//----------------------------------------------------------------------------------------------------------//<br />
class DrawChart extends JPanel<br />
{ <br />
// constructor<br />
public DrawChart()<br />
{<br />
setBackground( Color.WHITE ); // set the background to white<br />
} // end DrawChart constructor<br />
<br />
// draws a Chart using concentric circles<br />
public void paintComponent( Graphics g, )<br />
{<br />
super.paintComponent( g );<br />
g.setColor(Color.BLACK);<br />
g.drawLine(30, 25, 30, 130); //this is the y-axis<br />
g.drawLine(25, 130, 605, 130); //this is the x-axis<br />
Font font = new Font("Serif", Font.PLAIN, 10);<br />
g.setFont(font);<br />
<br />
<br />
//each test score width = 10, space = 5, width for avg = 20, buffer between tests = 40<br />
//(10 bars and spaces = 150) + 20 = 170 for each test <br />
//170 * 3 + 40*2 = total width = 570, but allow the <br />
<br />
//The following are the values shown left of the y-axis. If there were many more, it would have been worth <br />
//while to set up a for/next loop to generate them<br />
//because of the way these are set, they are all left-justified <br />
g.drawString("100", 10, 30);<br />
g.drawString("90", 15, 40);<br />
g.drawString("80", 15, 50);<br />
g.drawString("70", 15, 60);<br />
g.drawString("60", 15, 70);<br />
g.drawString("50", 15, 80);<br />
g.drawString("40", 15, 90);<br />
g.drawString("30", 15, 100);<br />
g.drawString("20", 15, 110);<br />
g.drawString("10", 15, 120);<br />
//This will set up the labels below the x-axis<br />
g.drawString("Test 1", 65, 145);<br />
g.drawString("Avg.", 150,145);<br />
g.drawString("Test 2", 275, 145);<br />
g.drawString("Avg.", 360,145);<br />
g.drawString("Test 3", 485, 145);<br />
g.drawString("Avg.", 570,145);<br />
//set up light grey horz lines to make it easier to read the values<br />
g.setColor(Color.LIGHT_GRAY);<br />
g.drawLine(30, 30, 600, 30);//100%<br />
g.drawLine(30, 40, 600, 40);//90%<br />
g.drawLine(30, 50, 600, 50);//80%<br />
g.drawLine(30, 60, 600, 60);//70%<br />
g.drawLine(30, 70, 600, 70);//60%<br />
g.drawLine(30, 80, 600, 80);//50%<br />
g.drawLine(30, 90, 600, 90);//40%<br />
g.drawLine(30, 100, 600, 100);//30%<br />
g.drawLine(30, 110, 600, 110);//20%<br />
g.drawLine(30, 120, 600, 120);//10%<br />
int x; //this will be used to move the starting point <br />
x = 35; //initialize to 35 for the first bar<br />
g.setColor(Color.BLACK);<br />
for (int i = 0; i<3;i++)<br />
{<br />
for (int j = 0;j<10;j++)<br />
{<br />
if (testScores[i][j] == testMin) g.setColor(Color.RED); //red is bad - lowest score
else if(testScores[i][j] == testMax[i]) g.setColor(Color.GREEN);//green is good
g.fillRect(x,30 + 100 - testScores[i][j], 10, testScores[i][j]);//after drawing, set the color back to the default, black
g.setColor(Color.BLACK);
x = x + 15; //this will move the horz position for each of the 10 scores
} //this ends the inner loop, i
g.setColor(Color.CYAN);
g.fillRect(x,30 + 100 - testAvg[i], 20, testAvg[i]);//this will print the avg twice as wide
x = x + 40; //nice wide buffer to separate each group of tests the extra 40 at the end will not affect anything
} //ends outter loop, i }
} // end method paintComponent
// } // end class DrawChart
}//ends paintComponent method
} //End of main method
} //End of classjeff_cia wrote:
Any thoughts on how to pass the values?Again, I can't read your code, and I doubt anyone else can. I can only give you the generic recommendation that if the data doesn't change you have setters in the class that needs to receive the data and getters in the class that's producing the data. If the data does change dynamically, then you'll probably want to use the Observable design pattern or something similar, something easy to do in Swing. -
Need some help regarding value date
hiii experts...i want little clarification about value date and its effects... i searched scn and google but my issue is like...when we receive cheque today i.e 11/06/2014... it will be come in bank a/cs nearly on 14/06/2014... so if we write the value date 14/06/2014... will that bank ledger show effect on 14/06/2014... moreoveer the user posted a entry development server for 1/3/2014 and gave value date of 1/4/2014.. now in faglb03... how it will reflect..i know its basic question but i didnt find any solution through searching soo posted... please guide me..
Regards
Abhayhey mani... thankss for the reply... its shows the meaning which i understood but the effect in ledger... when it will show... value date or posting date??
e.g
a customer gives cheque today 11/6/2014.. user deposits cheque today and it will come into bank account near on 14/6.2014..
IN SAP
user does entry today i.e 11/06/2014
in bank g/l... he gives value date 14/06/2014... now when he posts the entry... the entry will shown in ledger on 11/06/2014... but the actual amount will come in 14/06/2014... soo my question is ... whts the user of value date then if he is posting the document on posting date -
Need some help in Rounding a double value to a whole number
Hey Peeps,
Need some help here, I got a method that returns a value in double after a series of calculation.
I need to know how can I round the double value, so for example,
1. if the value is 62222.22222222, it rounds to 62222 and
2. if the value is 15555.555555, it rounds to 15556
How can i do this
ZubHi Keerthi- Try this...
1. if the value is 62222.22222222, it rounds to 62222 and
double d = 62222.22222222;long l = (int)Math.round(d * 100); // truncatesd = l / 100.0;
double d = 62222.22222222;
System.out.println(d);
long l = (int)Math.round(d * 100);
// truncatesSystem.out.println(l);
d = l / 100.0;System.out.println(d);
for (int i = 0; i < 1000; i++)
{ d -= 0.1;}
for (int i = 0; i < 1000; i++)
{ d += 0.1;}System.out.println(d);
regards- Julie Bunavicz
Output:
62222.22222222
62222
62222.22
62222.22000000000001 -
Re: Help needed in passing values from workflow to Approve Forms
Dear Experts,
how do I pass values from a workflow to a step (Form) - approve form?
I am using a customized table structure as my data source (FORMCONTAINERELEMENT) but am stuck on how to access the data when i get to to the screen painter's flow logic... What am i missing? Can you give me a step by step example. the ones i see on the net are input fields that update the screen... nothing that shows value being passed from the outside.
I need to pass an exisitng value in the workflow into the form for approval of the the assigned agent.
Please help!!
Thank you.Hello !
Create a method just before the form step.This method should populate the values for the fields maintained in the form.
Pass the values populated from this method to your customized table structure (data source).In other words, you have to pass all the values to the workflow container.
To the step, pass this workflow container by binding.In the control tab of form step, you have to do the binding.
Regards,
S.Suresh -
Passing Values Child to Child...Need Help
I am a bit of a noob, and I'm having a problem. I had posted about this before but I think I was explaining what I need to do in way to much of a complicated manner so I'm going to try and simplify this a bit.
I have 5 swf's.
- main.swf (parent)
- child01.swf
- child02.swf
- child03.swf
- child04.swf
When main.swf runs, it loads child03.swf on the bottom (eventhough levels are not relevent in AS3) child01.swf and child02.swf load on top of child03.swf.
main.swf has an arrow button, to proceed to the next screen. When the arrow button is pressed it unloads child01.swf, child02.swf and child03.swf, it then loads child04.swf.
Here is my problem... child03.swf has dynamic text boxes, named tf0 - tf14, which get passed values by functions in each of those files. I need to pass these same values to dynamic text boxes on child04.swf.
The thing that concerns me is that child01.swf and child02.swf get unloaded when the arrow button is pressed. I would assume that the values stored in these text boxes get unloaded as well. If this is the case I need to store these values before the unload happens, which I am not sure how to do.
Then once I store these values they need to pass to the dynamic text boxes, named tf15 - tf 29, in child04.swf. I have been researching, and researching and cant find a solution. Some talk about using LocalConnection. kglad tried pointing me in the right direction using MovieClip, but I can't seem to get it working.
I am including the script for the relevent files.
main.swf
stop();
var Allergy_Tag:URLRequest = new URLRequest("child01.swf");
var Info_Tag:URLRequest = new URLRequest("child02.swf");
var Sec_A_B:URLRequest = new URLRequest("child03.swf");
var Sec_C_D:URLRequest = new URLRequest("child04.swf");
var AT_Loader:Loader = new Loader();
var IT_Loader:Loader = new Loader();
var AB_Loader:Loader = new Loader();
var CD_Loader:Loader = new Loader();
AT_Loader.x = 0;
AT_Loader.y = 85;
IT_Loader.x = 483;
IT_Loader.y = 85;
AB_Loader.x = 0;
AB_Loader.y = 0;
CD_Loader.x = 0;
CD_Loader.y = 0;
AT_Loader.load(Allergy_Tag);
IT_Loader.load(Info_Tag);
AB_Loader.load(Sec_A_B);
CD_Loader.load(Sec_C_D);
addChild(AT_Loader);
addChild(IT_Loader);
addChild(AB_Loader);
//arrow btn actions
arrowBtnMain.buttonMode = true;
arrowBtnMain.addEventListener(MouseEvent.ROLL_OVER , arrowBtnMainRollOver);
arrowBtnMain.addEventListener(MouseEvent.CLICK, arrowBtnMainClick);
function arrowBtnMainRollOver(event:MouseEvent):void{
arrowBtnMain.gotoAndPlay(2);
function arrowBtnMainClick(event:MouseEvent):void{
gotoAndStop(2);
AT_Loader.unload();
IT_Loader.unload();
AB_Loader.unload();
addChild(CD_Loader);
child03.swf
stop();
//changes text size on checkboxes
import fl.managers.StyleManager;
var textf:TextFormat = new TextFormat();
textf.size = 9;
StyleManager.setComponentStyle(CheckBox, "textFormat", textf);
StyleManager.setComponentStyle(CheckBox, "textPadding", 2);
//handles tag labels
var currentTF:uint = 0;
function clickCB(evt:MouseEvent): void {
this["tf"+currentTF].text = CheckBox(evt.target).label;
currentTF += 1;
for(var i:uint=0; i<30; i++){
this["cBox"+i].addEventListener(MouseEvent.CLICK, clickCB);
//handles text boxes
f_name.addEventListener(Event.CHANGE,copyText);
l_name.addEventListener(Event.CHANGE,copyText);
emer_01.addEventListener(Event.CHANGE,copyText);
emer_02.addEventListener(Event.CHANGE,copyText);
emer_03.addEventListener(Event.CHANGE,copyText);
function copyText(e:Event):void
tf10.text = f_name.text;
tf11.text = l_name.text;
tf12.text = emer_01.text;
tf13.text = emer_02.text;
tf14.text = emer_03.text;
child04.swf
stop();
import fl.managers.StyleManager;
var textf:TextFormat = new TextFormat();
textf.size = 12;
StyleManager.setComponentStyle(CheckBox, "textFormat", textf);
StyleManager.setComponentStyle(CheckBox, "textPadding", 2);
//handles allergy beads
var currentTF:uint = 30;
function clickCB(evt:MouseEvent): void {
this["tf"+currentTF].text = CheckBox(evt.target).label;
currentTF += 1;
for(var i:uint=30; i<60; i++){
this["cBox"+i].addEventListener(MouseEvent.CLICK, clickCB);
Here is an example of some of the script I have tried to impliment on child04.swf to call the values of the dynamic text boxes on child03.swf
tf15.addEventListener(Event.CHANGE,importText);
function importText(e:Event):void
tf15.text = MovieClip(AT_Loader.content).tf0;Thx kglad,
I'm still working with it. However I am getting a strange output message. I was working with the script to get those to pass, and started getting it. I then removed the added script and I'm still getting it.
TypeError: Error #1034: Type Coercion failed: cannot convert "
" to flash.display.MovieClip.
at child03_fla::MainTimeline/frame1()
Here is the script I currently have on the main.swf and still recieving this message... Weird because at this point I'm not trying to convert anything to a MovieClip
stop();
var Allergy_Tag:URLRequest = new URLRequest("allergy_tags.swf");
var Info_Tag:URLRequest = new URLRequest("info_tag.swf");
var Sec_A_B:URLRequest = new URLRequest("checks_and_texts.swf");
var Sec_C_D:URLRequest = new URLRequest("sec_c_d.swf");
var AT_Loader:Loader = new Loader();
var IT_Loader:Loader = new Loader();
var AB_Loader:Loader = new Loader();
var CD_Loader:Loader = new Loader();
AT_Loader.x = 0;
AT_Loader.y = 85;
IT_Loader.x = 483;
IT_Loader.y = 85;
AB_Loader.x = 0;
AB_Loader.y = 0;
CD_Loader.x = 0;
CD_Loader.y = 0;
AT_Loader.load(Allergy_Tag);
IT_Loader.load(Info_Tag);
AB_Loader.load(Sec_A_B);
CD_Loader.load(Sec_C_D);
addChild(AT_Loader);
addChild(IT_Loader);
addChild(AB_Loader);
//arrow btn actions
arrowBtnMain.buttonMode = true;
arrowBtnMain.addEventListener(MouseEvent.ROLL_OVER , arrowBtnMainRollOver);
arrowBtnMain.addEventListener(MouseEvent.CLICK, arrowBtnMainClick);
function arrowBtnMainRollOver(event:MouseEvent):void{
arrowBtnMain.gotoAndPlay(2);
function arrowBtnMainClick(event:MouseEvent):void{
AT_Loader.unload();
IT_Loader.unload();
AB_Loader.unload();
addChild(CD_Loader);
removeChild(arrowBtnMain); -
How to Pass values from XML to JSP??? Urgent Please Help me
Hi guys,
I am new to XML, I want to pass values from XML to JSP. I have a xml file with attributes, I should send this values to a JSP file. How is it??? Please Help guys.... its very urgent. Please send me how to do it with an example or atleast any urls related that....
Looking for ur favourable reply.
Thanks in advance,
Sridharin a servlet :
parse your xml file (see how at the end of the post) and
put the values you want in the request attributes
request.setAttribute("value1", value1);
...redirect to the jsp
in the JSP:
get the wanted attributes:
String value1=(String)request.getAttribute("value1");To learn how to parse a xml file, pay a look at this page, it explains how to read the XML document to build an object representation, and then how to navigate through this object to get the data
http://labe.felk.cvut.cz/~xfaigl/mep/xml/java-xml.htm -
Issue in Passing Value from SAP Portal through Open Doc
Hi
I am trying to pass the variables through open doc link from SAP portal.
I am trying to pass four variables.
OrganisationHierarchy
FiscalPeriodFrom
FiscalPeriodTo
Business
OrganisationHierarchy and Business are hierarchy variables.
I am testing few scenarios.Scenario1 and Scenario 2 are working fine.
But I am facing with Scenario3 and Secnario4.
Scenario1
Only two levels are passed to OrganisationHierarchy
http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA++++++++++++++++++++++++++0HIER_NODE]&sRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010
Result: Report is refreshed
Status: Passed
Scenario2
Only two levels are passed to Business
http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&sRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010&lsMBusiness=[0MAT_PLANT__ZBUSINESS++++++++RKEG_WWBUS_0MATPLANT].[ATV+++++++++++++++++++++++++++0HIER_NODE];[0MAT_PLANT__ZBUSINESS+++++++RKEG_WWBUS_0MATPLANT].[TPS++++++++++++++++++++++++++++0HIER_NODE]
Result: Report is refreshed
Status: Passed
Scenario3
When two levels are passed for both OrganisationHierarchy,Business
http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA+++++++++++++++++++++++++0HIER_NODE]&lsRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010&lsMBusiness=[0MAT_PLANT__ZBUSINESS+++++++RKEG_WWBUS_0MATPLANT].[ATV++++++++++++++++++++++++++++0HIER_NODE]
Result: Report is never refreshed and its keep on running
Status: Failed
Scenario4
Only three levels are passed for OrganisationHierarchy,
No values are passed for Business
http://mspr39.corp.medtronic.com:8080/OpenDocument/opendoc/openDocument.jsp?sap_sysid=DB1&sap_client=010&iDocID=11589&lsMOrganisationHierarchy=[ZSS_L2_C+++++++++++++++++++++ZSS_L2_SEL].[AUSTRALIA+++++++++++++++++++++0HIER_NODE];[ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[INDIA+++++++++++++++++++++++++0HIER_NODE]; [ZSS_L2_C++++++++++++++++++++ZSS_L2_SEL].[ASEAN++++++++++++++++++++++++++0HIER_NODE]&lsRefresh=Y&lsSFiscalPeriodFrom=001.2010&lsSPreviousWorkingDay=10%2F28%2F2010&lsSTargetCurrency=HKD&lsSFiscalPeriodTo=011.2010
Result: Report is never refreshed and its keep on running
Status: Failed
Thanks
ArunHello Rupachandran,
the memory id won't work as it is within the current session only.
you have two main options:
1) pass parameters in URL
2) persist the parameters somehow ( shared memory area, database table ) and pass a GUID in the URL which refers to these.
strangely enough although this is a mirror of most of the posts here, which want to launch WDA apps from standard GUI based code, the techniques are very very similar.
you might get some help from looking at this recent post Calling webdypro through R3 Function module -
Hello Experts,
I am trying to test usage of f4 help function module.
We want to dynamically pass values from remote machines into the given input parameters of a Given Search help and receive the output into a table (no dialogs required .. so no pop ups )
I wrote a test program to just test if we can really do that at runtime ?
This program pops up the window of search help First I want to surpress that window and Second I have no clue
( How to pass the input parameters as value eg. 20 to a given field as we pass manually )
Can some one suggest something here ?
REPORT ZTEST_F4_TEST.
data lt_return TYPE TABLE OF DDSHRETVAL.
data ls_return TYPE DDSHRETVAL.
data lt_return_ddic TYPE TABLE OF zDDSHRETVAL.
data ls_return_ddic TYPE zDDSHRETVAL.
PARAMETERS ptable type tabname.
PARAMETERS pfield type fieldname.
PARAMETERS pshelp type SHLPNAMe.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = ptable
fieldname = pfield
SEARCHHELP = pshelp
* SHLPPARAM = ' '
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
* STEPL = 0
* VALUE = ' '
MULTIPLE_CHOICE = 'X'
DISPLAY = 'F'
SUPPRESS_RECORDLIST = 'X'
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* SELECTION_SCREEN = ' '
* IMPORTING
* USER_RESET =
TABLES
RETURN_TAB = lt_return
* EXCEPTIONS
* FIELD_NOT_FOUND = 1
* NO_HELP_FOR_FIELD = 2
* INCONSISTENT_HELP = 3
* NO_VALUES_FOUND = 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.
data lv_count type i.
delete lt_return where fieldname <> pfield.
sort lt_return by fieldval.
delete ADJACENT DUPLICATES FROM lt_return COMPARING fieldval.Hello Sim,
We will be exposing the Input parameters and Output lists of the SAP Search helps (simple search helps only) as input output of a Webservice.
So I need to understand how can we exploit the SAP Search Helps ?
What function modules can take these inputs as structures and can provide the output in form of a table ?
Regards,
Ravi -
Passing value of View Attribute from standard page to custom page
Hi everyone,
I have a custom page which needs to be called from a standard page. Now this custom page is based on some parameters whose value will depend on the dynamic selection by user. So how to get the currently executed value from VO.
For ex: Vendor Id , contact id and site Id all are to be fetched which are present in three different VOs. When user select particular vendor, contact and site these values will change accordind to selection.
Here do I need to extend the controller and application module of the standard page or it can be done by passing parameters in destination URI of submit button.
I tried using parameters in destination URI of submit button as {VO.ViewAttributeName} and printing in custom page but it was printing " {VO.ViewAttributeName}" as it is.
Please help..
Thanks in advance.
Edited by: Kittu on Nov 18, 2010 1:05 PMHi Meher,
I tried doing it by destination uri but it was not taking the value.
I tried CO extension with the following code in my extended CO :
public class ExtendedByrCntDirCO extends ByrCntctDirCO
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
/* I WANT TO CREATE TEH SUBMIT BUTTON PROGRAMATICALLY */
OASubmitButtonBean oasb= (OASubmitButtonBean)pageContext.getWebBeanFactory().createWebBean(pageContext,"BUTTON_SUBMIT");
oasb.setID("SubmitBtn");
oasb.setUINodeName("SubmitBtn");
oasb.setEvent("xxSubmitButton");
oasb.setText("Submit");
webBean.addIndexedChild(oasb);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
String url = "OA.jsp?page=/oracle/apps/aeap/Vendors/webui/VendorContactsPG";
OAApplicationModule am =
(OAApplicationModule)pageContext.getApplicationModule(webBean);
OAViewObject VendorsVO = (OAViewObject)am.findViewObject("VendorsVO1"); // To retrive the attribute of a particular VO
Number VendorId = (Number)VendorsVO.getCurrentRow().getAttribute("VendorId"); *// But here its showing null pointer exception*
HashMap params = new HashMap(1);
params.put("VendorId", VendorId);
String strEvent= pageContext.getParameter(EVENT_PARAM) ;
if ( strEvent.equals("xxSubmitButton"))
pageContext.setForwardURL(url,
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
params,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
OAWebBeanConstants.IGNORE_MESSAGES);
So how can I retrive the value from VO . Is there any another way . Plz help...
Edited by: Kittu on Nov 19, 2010 12:46 PM -
Hello,
I want pass value in STATUS and Reason for rejection according to requirement when i am creating multiple lead using BAPI_LEAD_CREATEMULTI. Please help me how can i pass value. Please give some sample code that in which table i have to pass values and please also tell me INPUT_FIELDS values. Please help me
Regards,
Kshitij RathoreHello,
Please help me for solve this problem. I am trying to solve problem from last 4 days but i didn't get any solution.
Regards,
Kshitij Rathore -
I would like some help in determining the proper structure/implementation
I would like some help in determining the proper structure/implementation for the following scenario:
I have ~10 steel rods that have been equipped with a strain gauge. The most I would have is ~30 steel rods.
Each setup has had a 10 point calibration done.
These steel rod/strain gauge setups are assigned a calibration number.
The data would be grouped for each steel rod and identified by the calibration number.
I would like to use that calibration data to determine the Young’s Modulus for each steel rod and store that within the specific rod’s information.
I want the user to be able to add new steel rods dynamically and the Young’s Modulus calculated and stored with it.
There are two different types of rods.
The cross-sectional area of the rod needs to be stored and that value is constant based on the rod type (so there are two different area values).
After a rod’s calibration data is entered the first time, the data should be static so it doesn’t need to be re-entered.
The user would enter the cal#, the 10 point calibration data, and the rod type.
The user will only see the steel rod cal# on the FP.
I am using a queue-based producer/consumer with event structure for the front panel interface. So I’m thinking whenever a rod cal# was added I would call a subvi where the calibration data can be entered and then the Young’s Modulus could be calculated and stored. An option to edit/review existing cal data should be available.
LabVIEW 2010, Win 7.
My initial idea was:
Rod Arr – array of clusters:
Rod Info - cluster:
Calibration number – string
Rod Scale cluster:
mV/V – double array
force – double array
Young’s Modulus – double
Rod type – enum
Cross-sectional area – double
I have not implemented this because I’m not sure how to implement that AND keep the data after it’s been entered. And all of the bundling/unbundling anytime I want to access/edit any rod information can be BD consuming. I thought a lookup table might work. When I looked on the forums for a lookup table I was pointed in the direction of arrays/clusters.
So I have two questions:
What would be the best structure for the steel rod data?
What would be the best data type for the calibration# that the user can edit (enum, ring, ?)?I would make a couple of small change to your proposed data layout (highlighted in blue):
Rod Arr – array of clusters:
Rod Info - cluster:
Calibration number – string
Array of Rod Scale cluster:
mV/V – double
force – double
Young’s Modulus – double
Rod type – enum
Cross-sectional area – double
For the calibration data, I would have an array of clusters rather than a cluster of arrays. IMHO, this makes it easier to index through the calibration points, and makes it less likely you will ever have a situation where you don't have the same number of mV/V and force points. I'd also move the Young's modulus, type, and area info into the Rod Info cluster.
I prefer to store this type of configuration in the system registry, but that is more complicated and far from universal in the LabVIEW world. A simpler way would be to simply pass the entire array to the "write to binary file" function. If you do this, however, you might want to add a version number, otherwise it will be very difficult to maintain backwards compatibility if you ever need to change the data structure.
As far as the control type, it depends on what the user is entering. If the user is mostly entering calibration numbers already in the system, I would use a (system) combo box. This allows the user to select an existing calibration number from the menu, but also to enter a new calibration number if they need to. If the user will almost always enter new calibration numbers, then I would use a standard string control. Either way, you'll probably want to validate the format of the number the user enters.
Mark Moss
Electrical Validation Engineer
GHSP -
How to pass values of the prompt through Action Link - URL in 11g
Hi All,
I am in OBIEE 11g v6.
Let's say, I have two dashbaord pages P1 and P2.
P1 page contains
1. Prompt PR1 - containing a single column EmpName
2. Report R1
P2 page contains
1. Prompt PR2 - containing a single column EmpName (same column as in PR1)
2. Report R2
Requirement :
Let's say a user select a value = David from the EmpName column in prompt PR1. In the Report R1, on one the measure columns 'Sales', I am using an action link - Navigate to URL ( I can't use Navigate to BI Content for some reasons). In the URL, I am giving the URL to page P2. Can I pass the selected value (which is David) to the EmpName column of the Prompt PR2 of Page P2 so that Report R2 is automatically limited by David when I land on that page through the URL?
Few things to consider are, I can't use EmpName column in my report R1 on page P1, I just want to pass the value of a common column from one prompt on Page1 to another prompt on Page2. Is that possible. Can anybody please help?
Thanks,
RonnyHmm can you give a try one more time with
Add EmpName name and hide it on report R1 on page P1
and set EmpName as Is Prompted on report R2 on page P2 and with my earlier steps should work.
Other option is read this doc once that helps you how to pass value thru url.
http://docs.oracle.com/cd/E21043_01/bi.1111/e16364/apiwebintegrate.htm#z1005224
You need to have a EmpName as Is Prompted on report R2 on page P2
If helps pls mark -
Need some help in creating Search Help for standard screen/field
I need some help in adding a search-help to a standard screen-field.
Transaction Code - PP01,
Plan Version - Current Plan (PLVAR = '01'),
Object Type - Position ( OTYPE = 'S'),
Click on Infotype Name - Object ( Infotype 1000) and Create.
I need to add search help to fields Object Abbr (P1000-SHORT) / Object Name (P1000-STEXT).
I want to create one custom table with fields, Position Abb, Position Name, Job. Position Abb should be Primary Key. And when object type is Position (S), I should be able to press F4 for Object Abb/Object Name fields and should return Position Abbr and Position Name.
I specify again, I have to add a new search help to standard screen/field and not to enhance it.
This is HR specific transaction. If someone has done similar thing with some other transation, please let me know.
There is no existing search help for these fields. If sm1 ever tried or has an idea how to add new search help to a standard screen/field.
It's urgent.
Thanks in advace. Suitable answers will be rewardedHi Pradeep,
Please have a look into the below site which might be useful
Enhancing a Standard Search Help
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/daeda0d7-0701-0010-8caa-
edc983384237
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm
A search help exit is a function module for making the input help process described by the search help more flexible than possible with the standard version.
This function module must have the same interface as function module F4IF_SHLP_EXIT_EXAMPLE. The search help exit may also have further optional parameters (in particular any EXPORTING parameters).
A search help exit is called at certain timepoints in the input help process.
Note: The source text and long documentation of the above-specified function module (including the long documentation about the parameters) contain information about using search help exits.
Function modules are provided in the function library for operations that are frequently executed in search help exits. The names of these function modules begin with the prefix F4UT_. These function modules can either be used directly as search help exits or used within other search help exits. You can find precise instructions for use in the long documentation for the corresponding function module.
During the input help process, a number of timepoints are defined that each define the beginning of an important operation of the input help process.
If the input help process is defined with a search help having a search help exit, this search help exit is called at each of these timepoints. If required, the search help exit can also influence the process and even determine that the process should be continued at a different timepoint.
timepoints
The following timepoints are defined:
1. SELONE
Call before selecting an elementary search help. The possible elementary search helps are already in SHLP_TAB. This timepoint can be used in a search help exit of a collective search help to restrict the selection possibilities for the elementary search helps.
Entries that are deleted from SHLP_TAB in this step are not offered in the elementary search help selection. If there is only one entry remaining in SHLP_TAB, the dialog box for selecting elementary search helps is skipped. You may not change the next timepoint.
The timepoint is not accessed again if another elementary search help is to be selected during the dialog.
2. PRESEL1
After selecting an elementary search help. Table INTERFACE has not yet been copied to table SELOPT at this timepoint in the definition of the search help (type SHLP_DESCR_T). This means that you can still influence the attachment of the search help to the screen here. (Table INTERFACE contains the information about how the search help parameters are related to the screen fields).
3. PRESEL
Before sending the dialog box for restricting values. This timepoint is suitable for predefining the value restriction or for completely suppressing or copying the dialog.
4. SELECT
Before selecting the values. If you do not want the default selection, you should copy this timepoint with a search help exit. DISP should be set as the next timepoint.
5. DISP
Before displaying the hit list. This timepoint is suitable for restricting the values to be displayed, e.g. depending on authorizations.
6. RETURN (usually as return value for the next timepoint)
The RETURN timepoint should be returned as the next step if a single hit was selected in a search help exit.
It can make sense to change the F4 flow at this timepoint if control of the process sequence of the Transaction should depend on the selected value (typical example: setting SET/GET parameters). However, you should note that the process will then depend on whether a value was entered manually or with an input help.
7. RETTOP
You only go to this timepoint if the input help is controlled by a collective search help. It directly follows the timepoint RETURN. The search help exit of the collective search help, however, is called at timepoint RETTOP.
8. EXIT (only for return as next timepoint)
The EXIT timepoint should be returned as the next step if the user had the opportunity to terminate the dialog within the search help exit.
9. CREATE
The CREATE timepoint is only accessed if the user selects the function "Create new values". This function is only available if field CUSTTAB of the control string CALLCONTROL was given a value not equal to SPACE earlier on.
The name of the (customizing) table to be maintained is normally entered there. The next step returned after CREATE should be SELECT so that the newly entered value can be selected and then displayed.
10. APP1, APP2, APP3
If further pushbuttons are introduced in the hit list with function module F4UT_LIST_EXIT, these timepoints are introduced. They are accessed when the user presses the corresponding pushbutton.
Note: If the F4 help is controlled by a collective search help, the search help exit of the collective search help is called at timepoints SELONE and RETTOP. (RETTOP only if the user selects a value.) At all other timepoints the search help exit of the selected elementary search help is called.
If the F4 help is controlled by an elementary search help, timepoint RETTOP is not executed. The search help exit of the elementary search help is called at timepoint SELONE (at the
F4IF_SHLP_EXIT_EXAMPLE
This module has been created as an example for the interface and design of Search help exits in Search help.
All the interface parameters defined here are mandatory for a function module to be used as a search help exit, because the calling program does not know which parameters are actually used internally.
A search help exit is called repeatedly in connection with several
events during the F4 process. The relevant step of the process is passed on in the CALLCONTROL step. If the module is intended to perform only a few modifications before the step, CALLCONTROL-STEP should remain unchanged.
However, if the step is performed completely by the module, the following step must be returned in CALLCONTROL-STEP.
The module must react with an immediate EXIT to all steps that it does not know or does not want to handle.
Hope this info will help you.
***Reward points if found useful
Regards,
Naresh -
How to pass value in array to another procedure?
Hello.
I have created application by Developer form9i.
And I have some problem about passing value in array to another procedure.
My code is :
PROCEDURE p_add_array (col_no in number,
col_val in varchar2) IS
type xrecord is record(col number,vcol varchar2(1000));
xrec xrecord;
type varraytype is varying array(42) of xrecord;
xvartab varraytype := varraytype();
alert number;
BEGIN
set_application_property(cursor_style,'busy');
xrec.col := col_no;
xrec.vcol := col_val;
xvartab.extend(1);
xvartab(col) := xrec;
EXCEPTION
when others then
set_application_property(cursor_style,'default');
alert := f_show_alert('!Error ORA-'||
to_char(DBMS_ERROR_CODE)||' '||
substr(DBMS_ERROR_TEXT,1,240),
'al_stop');
END;
And I want to have
PROCEDURE p_print_arrey is
BEGIN
END;
So how to bring value of xvartab( ) in p_add_array to use in p_print_array?
Anybody please help me solve this ploblem.Hi,
Instead of declaring the array locally within the procedure (i.e. p_add_array), define it in the package specification (i.e. Under Program Units).
-- Shailender Mehta --
Maybe you are looking for
-
Service order Item category on Contract determination
Hi We have contract determination on CRM service orders and it is working as expected. Our Service contract makes the Service order free of charge but its still generates the debit memo in ECC system with zero value. We don't want this to happen so a
-
Can I able to include image/.js file to payload-body.jsp
Dear Experts, Could anyone please tell me that how can I refer a external javascript file from payload-body.jsp and where should I place the same. Also please tell the same to display an image. Please suggest me ASAP. Thanks, Rajesh
-
Hello experts There is a mapping requiremnt and i don't quite know how to achieve it. Hope to get some hints on how to do it. I have a source file <line> unbounded <field1> <filed2> <field3> </Line> My taget is Idoc <e1xmbh> <e1mb
-
Plugplug.dll missing at start up of PScc
Hi there, I get this message on start up of PS cc. Still lets me use PS cc, used to only happen in Admin mode (I needed to use this to get an extension to work see below) but now its in any mode. info: I am on my trial still, win 8, 16gb ram, i7 lapt
-
Query to find dependent task attached to task on some response in OIM 11g
can anyone help me in making a sql query to find dependent task attached to task on some response in OIM 11g Edited by: user13331347 on Sep 3, 2012 2:09 PM