[ HELP ] FOR statement
Hello Guys
Can you please tell me whether this Matlab code whether correct or not??
this code use to calculate all distances from A to J points on the map ( has longitude and latitude ), the starting point coordinates ( Lat and Long ) is 3.682043 and 101.523710 and the destination is 2.227804 103.35091
for p1=3.682043:-0.5:2.227804
for p2=101.523710:0.5:103.735091
a5= 2.227804;
b5=103.35091;
[dDgree] = distance(p1,p2,a5,b5); %% this function used to find a distance between two coordinates
end
end
Attachments:
2untitled.JPG 26 KB
Of course if you are actually using the optional NI Mathscript RT module (which basically has the same syntax as matlab) from within LabVIEW, you could ask in the Mathscript forum.
Also, if you are looking for a pure g implementation using LabVIEW, here is the right place to ask. But please try for yourself first.
The easiest way to find out if code is "correct" (whatever that means) is to test it using a collection of some well known non-degenerate inputs where the result can be independently verified. Have you tried?
LabVIEW Champion . Do more with less code and in less time .
Similar Messages
-
F4 help for a single field in interactive form
Hi Experts,
I am working in HRAS process.I created a Form Scenario and an Adobe Form. I linked my interactive form in portal using standard Start Processes iView . Now I have to create a value help(F4 help) for 'STATE' field based on 'COUNTRY' field value in adobe form. I filled the Input value Help in the corresponding Form Scenario field. But in portal the adobe form shows the field as a single field only.
How I can I attach the manual F4 help to 'COUNTRY' field?
The how to vary the F4 help values in 'STATE' fied based on 'COUNTRY' field?
Do I need to code in Java script for this?
Please provide some inputs with code sample
Thanks in advance,Lek,
Check Nikhil's reply in this [thread|Re: Reg: value help from BADI is not displayed in the HCm form;. It should probably help you.
Chintan -
Can someone explain to me what I am doing wrong on my for statement? I cant figure out what I need to put in there.
TIA
import java.awt.*;
public class DC extends javax.swing.JApplet {
String greeting;
public void init() {
greeting = "My name is DC !";
for(; greeting) {
repaint();
try {
Thread.sleep(250);
catch (InterruptedException e) {}
// public void paint(Graphics screen) {
// Graphics2D screen2D = (Graphics2D)screen;
// screen2D.drawString(greeting, 50, 75);
public void paint(Graphics g){
double d = Math.random();
if(d < 0.25)
xPos +=1;
else if(x < 0.5)
yPos -=1;
else if
g.drawString(xPos, Ypos, "Testing");
}thank you that makes sense., any suggestions on what
type of variable to use for the xPos and yPos?
thanks againI don't do GUIs, but I would assume ints. They'd probably either represent absolute coordinates or offsets from a starting point.
You'll have to think about how you want X & Y to vary--that could put some constraints on how directly you can use for's index.
Will they vary randomly and independently? If so, then for's index will be useless for the X & Y pos themselves.
Will they vary in lockstep, moving, say, from top left to bottom right? Then for's index can be used directly to vary both of them.
There are of course other options.
¶ -
Problem with the FOR statement.....again!
Hi everyone,
Well I'm still trying to do a car slideshow using external
files and can't seem to see the end. The current movie is here:
http://www.virtuallglab.com/projects.html
I also attach the code. My problem is I had originally set up
an animation with 2 pictures sliding in with some text, and then
wait 4 seconds before sliding out, and then next pictures and text
would slide in and so on, using a setInterval.
The problem is the FOR loop seems to skip the setInterval and
the function "wait", so it just loops quickly and jumps to last
picture, so on the example above, it just slides the last picture
(i=9) and that's it!
Can you not include another function within a FOR statement.
Or is there a way to tell the FOR loop to wait until all motion is
finished?
Any help greatly appreciated
import mx.transitions.*;
import mx.transitions.easing.*;
for (i=0; i<10 ; i++) {
var picLeft = "pics/"+i+".jpg";
var picRight = "pics/"+i+"b.jpg";
var txtToLoad = "text/"+i+".txt";
this.createEmptyMovieClip("leftHolder",1);
leftHolder.loadMovie(picLeft,i,leftHolder.getNextHighestDepth());
leftHolder._x = -200;
leftHolder._y = 15;
var leftTween:Tween = new Tween(leftHolder, "_x",
Strong.easeOut, leftHolder._x, 10, 2, true);
this.createEmptyMovieClip("centerHolder",2);
centerHolder.loadMovie(picRight,i+"b",centerHolder.getNextHighestDepth());
centerHolder._x = 180;
centerHolder._y = 250;
var centerTween:Tween = new Tween(centerHolder, "_y",
Strong.easeOut, centerHolder._y, 15, 2, true);
text._x = 600;
myData = new LoadVars();
myData.onLoad = function(){
text.carText.text = this.content;
myData.load(txtToLoad);
var textTween:Tween = new Tween(text, "_x", Strong.easeOut,
text._x, 420, 2, true);
myInterval = setInterval(wait, 4000);
function wait() {
var leftTweenFinished:Tween = new Tween(leftHolder, "_x",
Strong.easeOut, leftHolder._x, -200, 1, true);
var centerTween:Tween = new Tween(centerHolder, "_y",
Strong.easeOut, centerHolder._y, 250, 1, true);
var textTween2:Tween = new Tween(text, "_x", Strong.easeOut,
text._x, 600, 1, true);
clearInterval(myInterval);
***************************************************************************************** ***There is no way to tell a for loop to wait. That is not what
they do.
The entire for loop will execute (if possible, and it doesn't
enter some kind of continuous infinite loop) completely before each
time the frame is rendered.
If you want to spread things out over time you need to use
the setInterval -- but not inside a for loop! If you do that you
immediately set however many intervals as your loop has. In this
case you will also assign the ids for those intervals to the same
variable, effectively overwriting the value so you will never be
able to clear most of those intervals.
So you need to rethink you whole structure. Set up some kind
of counter and limit like this:
var slidesToShow:Number=10;
var curSlide:Number=0;
Then have your setInterval increment the curSlide each time
it is called and check to see if it has shown all of them. That is
where your "loop" comes in.
As for the other part of your question -- yes you actually
have two different issues going on -- again you cannot make a for
loop wait for anything. So no there is no way to pause it while you
wait for your tween to end. But you can be notified when a tween
ends.
Check out the documentation about the tween class in the help
files. There you will find the onMotionFinished event. So you can
set up one of those to start whatever needs to be started when the
tween has finished.
You should also use the MovieClipLoader class to load your
images, because you have no idea how long it will take to load
them. Using that class you get a nice event (onLoadInit) that tells
you when the asset is ready to be used.
Finally I'm thinking you might want to use setTimeout instead
of setInterval. It only goes once, while setInterval repeats
forever. So I would think your algorithm would be something like
this.
1. load external asset
2. when ready animate in and set onMotionFinished handler
3. when motion is finished start loading next asset and
setTimeout for 4 seconds.
4. when 4 seconds is up or the clip is loaded (which ever
takes longer) go to 2 and repeat.
If this is going to be run locally on a hard drive or CD you
won't have any problem with the length of time it takes to load the
external assets, but if it is over the web it will take time. -
AP Line-Item Report for State Auditors
Dear Members,
I am preparing one Report named AP Line-Item Report for State Auditors and i need the following fields in my report.
Check Number PAYR-CHECT
Voucher Number BSEG-BELNR
Check Date PAYR-ZALDT
Voucher Date BKPF-BUDAT
Vendor Number LFA1-LIFNR
Vendor Name ADRC-NAME1
Vendor Street Address ADRC-STREET
Vendor City ADRC-CITY1
Vendor State ADRC-REGIO
Vendor Zip Code ADRC-POST_CODE1
General Ledger Acct No BSEG-HKONT
Purchase Order Number BSEG-EBELN
Tax Status Code BSEG-MWSKZ
Taxable Amount BSEG-HWBAS
Exempt Amount BSEG-MWSTS
Tax BSEG-MWSTS
Tax Accrued BSEG-MWSTS
Total Invoice BSEG-DMBTR
I am new to FI.So I request some one please let me know which datasources contain the above fields and which CUBE is best suited for this.
Thanks in Advance for help and quick reply is much much appreciated.
Best Regards
RC0VENDOR_ATTR - Vendor Master Data Attributes
0FI_AP_51 - Check Register Line Items
0FI_AP_4 - Accounts Payable Line Items
It should be noted, however, that this won't get you everything that you need, so you may have to create enhance one or more of these DataSources and create User Exit ABAP code to get the required data. Also, the 0FI_AP_51 DataSource isn't available if your source system isn't ECC6 EHP3 or higher. If your source system is less than that, you're going to have to create a generic DataSource for the data from the PAYR table. -
F4 help for one field in modulepool program..(Possible values)
Hello Experts,
I have 3 fields in my module pool screen.
PLANT, MATERIALNO AND STORAGELOCATION.
BASED ON PLANT AND MATERIAL I NEED TO PROVIDE F4 HELP FOR STORAGE LOCATION(LGORT).
How can i write the code in PROCESS ON VALUE REQUEST ..
AND WHICH FUNCTION MODULE SHOULD BE USED.
Please can anybody send me the code asap.
I will give u full points if ur code matches my requirement.Hi Raja,
i will send a sample code for ur problem check in once..In that code i explicitly hardcoded the values for serchhelp.Instead of that we have to use select statement based on ur condition and place them in internal table ok.
FUNCTION MODULE:
F4IF_INT_TABLE_VALUE_REQUEST.
CODE:
*& Report YSEARCHHELP *
*& DEVELOPER : KIRAN KUMAR.G.A *
*& PURPOSE : DEMO ON SEARCH HELP *
*& CREATION DT : 27/12/2007 *
*& REQUEST : ERPK900035 *
REPORT YSEARCHHELP.
INTERNAL TABLE FOR STORING NAMES IN SELECTION LIST
data: begin of t_itab occurs 0,
name(10) type c,
end of t_itab.
*FIELDNAME AND TAB NAME FOR THE SELECTION
DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.
*THE TABLE FOR RETURNING THE NAME OF THE SELECTED ITEM
DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
*START THE SELECTION SCREEN BLOCK
selection-screen begin of block ss1 with frame.
parameters: p_name1(10) type c.
selection-screen end of block ss1.
*& F4 Help for p_name1 *
at selection-screen on value-request for p_name1.
*CLEAR ALL EXISTING DATA
*TO BE DONE EVERYTIME F4 HELP IS REQUESTED
REFRESH t_itab.
REFRESH field_tab.
field_tab-fieldname = 'ERNAM'.
field_tab-tabname = 'VBAK'.
APPEND field_tab.
t_itab-name = 'Andrews'.
append t_itab.
t_itab-name = 'Jennie'.
append t_itab.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = field_tab-fieldname
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE = 'Select name'
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
tables
value_tab = t_itab
FIELD_TAB = field_tab
RETURN_TAB = return_tab
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
else.
p_name1 = return_tab-fieldval.
ENDIF.
Award points if helpful.
Kiran Kumar.G
Have a Nice Day.. -
F4 help for parameter field - no values defined in the database
Hi,
In the Selection screen, I have two fields,
One is for getting input for the month
Other one is for year
These two are created by using parameter statement
and it is not referring to any data base table fields.
parameters : p_bumon type bumon.
parameters : p_bdatj type bdatj.
At the selection screen i need input help for the month and year separately.
I cant use the function module becos no values r fetch from the tables.
or else to get the input help, can u please just me some predefined type declarations so that i can get by default the F4 help for this
or any other table which have the value range for only for the month and year.
Just it is created and the input values is passed to the function module and to calculate the number of days for that particular month and year.
i need this very urgently
Please suggest me in this , whether it is possible
Thankshi,
There is a event called
At selection-screen PROCESS ON VALUE-REQUEST for.......
In your case it can be :-
At selection-screen PROCESS ON VALUE-REQUEST for p_bumon .
< Block 1>
At selection-screen PROCESS ON VALUE-REQUEST for p_bdatj .
< Block 2>
In the block u can write the code.......
say for month u can write
parameters : p_month(2) type c.
Eg for month
At selection-screen PROCESS ON VALUE-REQUEST for P_MONTH.
data : begin of int_month occurs 0,
month(2) type c,
end of ont_month.
INT_MONTH-MONTH = '01'.
append INT_MONTH.
INT_MONTH-MONTH = '02'.
append INT_MONTH.
INT_MONTH-MONTH = '03'.
append INT_MONTH.
INT_MONTH-MONTH = '11'.
append INT_MONTH.
INT_MONTH-MONTH = '12'.
append INT_MONTH.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MONTH' Int tab field name
DYNPPROG = < program name>
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MONTH' Field wer u need F4 help
VALUE_ORG = 'S'
WINDOW_TITLE = Any description
TABLES
VALUE_TAB = INT_MONTH. Internal table name
please reward points if useful.... and mark it answered.....
thank you. -
Need help for a newbie problem
I am VERY new to all this Java programming but have really started to enjoy it.
I have two problems with my program that I can not find answers to.
1. I am looking to find out why my code will not select the right answers when I select the first choice in the array. The answer that is delivered turns out to be the 3rd selection. The second and third selection work great, but the first selection always turns out with the thrid answer.
2. I know I need to do better error checking on the user input. At this point I am only checking for correct integer input, but I dont know how to fix or avoid the error for when the user would mistakedly enter letters instead of numbers.
Any hints?
Code to follow... I hope...
No gui allowed for this program.
First time posting so I hope this works and I do it the right way...
import java.text.DecimalFormat; //To round to 2 decimal places for payment format.
import java.io.*; //Allows User to input.
public class Wk5JimP
//classes for keyboard inputs from user
public static InputStreamReader reader = new InputStreamReader (System.in);
public static BufferedReader keyboard = new BufferedReader (reader);
//main
public static void main (String[] args) throws IOException
//Variables
DecimalFormat decimal = new DecimalFormat("#,##0.00"); //Makes the decimal format for the output
int appAmount = 200000; //approved loan amount
short rPay = 0; //repayment option
int ps; //payment schedule switching variable.
//Year array and variables
int yTerm[] = {30, 15, 7,}; //Term of the loan in years array
short rOller2 = 0; //looping variable for rolling the years
short rOller3 = 0; //looping variable for rolling the years
//Month array and variables
int mTerm[] = {360, 180, 84,}; //Term of the loan in months array
short rOller = 0; //looping variable for rolling the months
short rOller1 = 0; //looping variable for rolling the months
//Interest rate array and variables
double iRate[] = {5.75, 5.50, 5.35,}; //interest rate array
int liRate = 0; //looping variable for interest rate
int liRate1 = 0; //looping variable for interest rate
// Payment array and variables
double mPayment[] = {
((appAmount*(iRate[0]/12/100))/(1-1/Math.pow((1+iRate[0]/12/100), mTerm[0]))),
((appAmount*(iRate[1]/12/100))/(1-1/Math.pow((1+iRate[1]/12/100), mTerm[1]))),
((appAmount*(iRate[2]/12/100))/(1-1/Math.pow((1+iRate[2]/12/100), mTerm[2])))
}; //monthly payment array
int lPay = 0; //looping variable for payment incrementation
int lPay1 = 0; //looping variable for payment incrementation
//Dollar amounts into decimal format of two places
String fappAmount = decimal.format(appAmount);
//Output to screen for header information
System.out.println();
System.out.println("Congratulations!");
System.out.println("You are approved for a $" + fappAmount + " loan");
System.out.println("The three repayment options are listed below.\n");
System.out.println("-------------------------------------------------------------------------");
System.out.println(" Repayment\t Loan\t\t Term\t\t Interest\t Monthly");
System.out.println(" Option\tAmount\t Years Months\t Rate \t Payment");
System.out.println("-------------------------------------------------------------------------");
//Begin repayment option loop for calculation
while (rOller != 3)
// if else loop to second and third repayment options
if (rOller1 <= 2)
// for statement loops last repayment option
for (rPay = 1; rPay <=3; rPay++)
{mPayment[lPay] = mPayment[lPay1++];
yTerm[rOller2] = yTerm[rOller3++];
mTerm[rOller] = mTerm[rOller1++];
iRate[liRate] = iRate[liRate1++];
//Output to screen for numerical repayment option info
System.out.println(" " + rPay + "\t $" + fappAmount + "\t\t " + yTerm[rOller2] + "\t" + mTerm[rOller] + "\t " + decimal.format(iRate[liRate]) + "% \t$" + decimal.format(mPayment[lPay])+ "\n\n");
else
//begin payment option selection
System.out.println();
System.out.println("Which one of the payment schedules would you like to see?\n");
System.out.println("Please enter 1 or 2 or 3 to see the payment schedule\nor enter any other number to exit.");
ps = Integer.parseInt(keyboard.readLine());
switch (ps)
case 1:
System.out.println("\nOption #1\n");
paysched(yTerm[0], appAmount, iRate[0], mPayment[0]);
break;
case 2:
System.out.println("\nOption #2\n\n");
paysched(yTerm[1], appAmount, iRate[1], mPayment[1]);
break;
case 3:
System.out.println("\nOption #3\n\n");
paysched(yTerm[2], appAmount, iRate[2], mPayment[2]);
break;
default:
System.out.println("Thank you!\n\n");
System.exit(0);
}//end switch
}//end while
}//end main
//payment schedule method
public static void paysched(int yTerm, int appAmount, double iRate, double mPayment) throws IOException
//Declare variables for looped calculations
DecimalFormat decimal = new DecimalFormat("#,##0.00"); //Makes the decimal format for the output
double balance = appAmount;
double monIRate = iRate / 12;
double iPay = 0;
double pPay = 0;
short pNum = 1;
short year = 1;
//Header Output to screen for payment schedule
System.out.println("-------------------------------------------------------------------------");
System.out.println(" Payment \t Principle\tInterest\tTotal \t\tBalance");
System.out.println(" Year Month\t Payment\tPayment \tPayment \tRemaining");
System.out.println("-------------------------------------------------------------------------");
//Loop for shceduled payment calculation for all but the final year
do
//Apply the payment
iPay = balance * (monIRate /100);
pPay = mPayment - iPay;
balance = balance - pPay;
//Output to screen for payment information
System.out.println(" " +year+ " \t " +pNum+ " \t $" +(decimal.format(pPay))+ "\t$" +(decimal.format(iPay))+ "\t $" +(decimal.format(mPayment))+ "\t $" +(decimal.format(balance)));
pNum++;
if (pNum % 13 == 0)
System.out.println("Press enter to see the next year payments.");
System.in.read();
System.in.read();
year++;
pNum = 1;
//Output to screen for payment schedule
System.out.println("-------------------------------------------------------------------------");
System.out.println(" Payment \t Principle\tInterest\tTotal \t\tBalance");
System.out.println(" Year Month\t Payment\tPayment \tPayment \tRemaining");
System.out.println("-------------------------------------------------------------------------");
} //end if
} //end do
while(year < yTerm);
//Final Year calculations
do
//Apply the payment
iPay = balance * (monIRate /100);
pPay = mPayment - iPay;
balance = balance - pPay;
//Output to screen for payment information
System.out.println(" " +year+ " \t " +pNum+ " \t $" +(decimal.format(pPay))+ "\t$" +(decimal.format(iPay))+ "\t $" +(decimal.format(mPayment))+ "\t $" +(decimal.format(balance)));
pNum++;
if (pNum % 13 == 0)
System.out.println("Please press enter to select and view another payment schedule.");
System.in.read();
System.in.read();
year++;
} //end if
}//end do
while(year < (yTerm+1));
}//end class
}//end classThis is my first post so please be gentle...
Thanks for any help!When you choose Java to solve the problems, you need to adapt to the power/strategies/methodology that java offers you, and thats the way for solving problems in Java.
Why would you put the entire implementation for calculation inside main method? You could break down the program into smaller methods which could do the calculation bit and then call them in main method.
Anyways the reason that it is calculating for term of 7 years is that
// for statement loops last repayment option
for (rPay = 1; rPay <=3; rPay++)
{mPayment[lPay] = mPayment[lPay1++];
yTerm[rOller2] = yTerm[rOller3++];You are changing the value of the array yTerm[ ]. Hence once the control is out of the for loop the value of y[0]=7,y[1]=7 and y[2]=7.
Solution 1: mark yTerm as final.
Solution 2: set yTerm[0], yTerm[1] back as 30,15 after the for loop.
if (rOller1 <= 2)
// for statement loops last repayment option
for (rPay = 1; rPay <=3; rPay++)
{mPayment[lPay] = mPayment[lPay1++];
yTerm[rOller2] = yTerm[rOller3++];
mTerm[rOller] = mTerm[rOller1++];
iRate[liRate] = iRate[liRate1++];
//Output to screen for numerical repayment option info
System.out.println(" " + rPay + "\t $" + fappAmount + "\t\t " + yTerm[rOller2] + "\t" + mTerm[rOller] + "\t " + decimal.format(iRate[liRate]) + "% \t$" + decimal.format(mPayment[lPay])+ "\n\n");
yTerm [0]=30;
yTerm [1]=15;
}Futher the issue is with monthly calculation of pay back amount in switch - case statement.
As you have not provided what the problem is and what is the criteria for calculation of monthly interest or reducing the amount etc. Its not possible (at least for me) to tell you why it would run to negative. Mathematically that is the only thing possible,
Step 1: make those changes in your code. Make changes required to claculate the balance.
Step 2: Execute the new code and
Step 3: Gimme the dukes.
Cheers
$ -
Using multiple variable names in a for statement?
I have searched, and I just can't seem to find how to do something, I do not have the code atm, but easy enough to explain...
I have a GUI that has 3 rows of 3 fields...
emp1Name, emp1Phone, emp1Fax
emp2Name, emp2Phone, emp2Fax
emp3Name, emp3Phone, emp3Fax
I also have a tabbed file that has the input for each of these fields, it looks something like...
Mike 602-111-1111 602-111-1112
Dave 602-222-2222 602-222-2223
Bethany 602-333-3333 602-333-3334
Here is my method...
private void getFile() {
myFile = new File("C:/javainput.txt");
msgField.setText("Welcome!");
try {
BufferedReader br = new BufferedReader(new FileReader(myFile));
String s;
while ((s=br.readLine())!=null){
String f[] = s.split("\t");
emp1Name.setText(f[0]);
emp1Phone.setText(f[1]);
emp1Fax.setText(f[2]);
br.close();
} catch (IOException e) {
msgField.setText("INPUT FILE NOT FOUND!");
}My question is, how do I cycle through emp1, emp2 and emp3 in a for statement. I tried empName, but that obviously isn't correct.
Help, or point me to where I can read on this?
Thank you!
Edited by: 805764 on Oct 27, 2010 12:10 PMDo one thing at a time. First, define your Employee class. Compile it, debug it. Test it. Make sure that you can create Employees, set their names, phone numbers, etc., and get them back.
Once that works, familiarize yourself with arrays, if necessary, completely separately from your Employee class.
Once you're comfortable with arrays and with defining a new class (i.e., Employee), write a tiny test program that just, say, creates an array of a certain size and populates it with Employees, and then iterates over it printing out each Employee's information to the console.
Once that works, set it aside. Now work on a GUI. Start by just displaying one or two hardcoded names and phone numbers. Once that works, add a bit more to it--say by getting that hardcoded information from inside Employee objects.
And so on.
Right now you're biting off too much at once. Keep working on one very small new step at a time, only move on to the next step once the previous one is solid, and do the steps independently of each other first, and then combine their respective results. It may sound like a lot of work, but I promise you, in the end, it's faster, easier, and far less frustrating to do it this way.
At any given step, if you get stuck, post a question here, providing an [url http://sscce.org]SSCCE that shows what you're trying to do, and clearly explain exactly what problems you're having. -
Search help for input fields in a screen
Hi,
Pls help me
how to set search help property for the I/O fields in screen in se80?
1. do we want to add any property for search help in the property window?
2.do we want to create a MODULE PROCESS ON VALUE REQUEST ?
PLS tell me how to set search for the I/O field in se80?pls tell me the process?
i want to set the search help for more I/O fields in se80 but all the fields belongs to the same table?
can i create a single search for all these fields and use that for all the I/O fields ?
elementary search help or collective search help?
thanks & regards in advance,
vsnl.Hi,
Input Help on the Screen
Within the Screen Painter, you can define two types of input help:
1. The FIELD statement with one of the additions VALUES or SELECT.
2. Linking a search help directly to a screen field.
If you link a search help directly to a screen field, it overrides the additions of the FIELD
statement. However, the input check [Page 581] functions of the FIELD statement remain
unaffected.
Input Help in Flow Logic
The following input help methods are obsolete and should not be used. They are still supported
for compatibility reasons.
In the screen flow logic, you can specify a value list for a screen field <f> as follows:
FIELD <f> VALUES (<val1>, <val2>,...).
The value list contains a series of single values <vali>. The NOT and BETWEEN additions for the
input check [Page 581] are not appropriate for input help.
You can also create a value list by accessing a database table as follows:
FIELD <f> SELECT *
FROM <dbtab>
WHERE <k1> = <f1> AND <k2> = <f2> AND...
In the WHERE condition, the fields of the primary key <ki> of the database table <dbtab> are
checked against the screen fields <fi>. The WHENEVER addition, used with input checks [Page
581], is not necessary for input help.
If you have used a ABAP Dictionary reference for field <f>, the selection and the hit list formatting
may be affected by any check table attached to the field.
Attaching a Search Help
Search helps from the ABAP Dictionary can be attached to a screen field [Ext.]. To do this, enter
the name of the search help in the corresponding field in the attributes of the screen field in the
Screen Painter. This assigns the first parameter of the search help to the screen field. It is only
possible to place a value from the hit list onto the screen.
Input help on a screen.
REPORT DEMO_DYNPRO_F4_HELP_DYNPRO MESSAGE-ID AT.
DATA: CARRIER(3) TYPE C,
CONNECTION(4) TYPE C.
CALL SCREEN 100.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
The next screen (statically defined) for screen 100 is itself. It has the following layout:
602 April 2001
Cancel
Airline
Flight number
Screen field with search help
Input help in the flow logic
The input fields have been adopted from the program fields CARRIER and
CONNECTION. The function code of the pushbutton is CANCEL, with function type
E. The search help DEMO_F4_DE with the search help parameter CARRID is
assigned to the screen field CARRIER. The search help uses the database table
SCARR.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
FIELD CARRIER VALUES ('AA', 'LH').
FIELD CONNECTION SELECT *
FROM SPFLI
WHERE CARRID = CARRIER
AND CONNID = CONNECTION.
When the user chooses the input help for the individual fields, the following input
help is displayed:
For the Airline field, the search help displays the names of the airlines and places the airline
code in the input field for the chosen line. If the airline code is not one of those listed in the
VALUES list of the screen flow logic, the input check triggers an error message in the PAI
event. So the search help overrides the VALUES addition for the input help, but not for the
input checks. This is therefore not an appropriate place to use the VALUE addition.
For the Flight number field, the flow logic displays the selected entries from the database
table SPFLI and places the selected line in the input field.
Regards,
Bhaskar -
How to provide F4 help for a field in table control
Hi Friends,
I have requirement like below.
1.Create one custom transaction code with header and item information.
2.In item level, we will be designed table control to enter/display the data.
3.Table controls first field will be material number and next DOT number (Material may have many DOT numbers) and so on.
4.First user will enter material number in the table controls first rows first field and go to DOT number field.
5.DOT number has drop down option. If user selects drop down box of DOT number, he gets all the DOT numbers available in database. User selects one DOT number and double clicks on it then it will be populated in DOT number field box.
But for point number 5, business wants like when ever user enters material number in table control first field then select DOT numbers drop down then they want to see the particular materials DOT numbers only in the drop down list for selection. Not all DOT numbers available in data base. Same thing should happen for all item lines in table control.
Please see below example.
Assume data base table has 10 DOT numbers. But material number has only 2 DOT numbers. When ever user enters material number in item level table control and selects DOT numbers drop down then it should show only 2 DOT numbers which are related to particular material number. Not all 10 DOT numbers.
Could you please suggest me, how can we achieve this?Hello,
Check this :-
For POV
Input Help in Dialog Modules
You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.
PROCESS ON VALUE-REQUEST.
FIELD <f> MODULE <mod>.
After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.
Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These all have the prefix F4IF_. The most important are:
F4IF_FIELD_VALUE_REQUEST
Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
F4IF_INT_TABLE_VALUE_REQUEST
This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.
Input help in dialog modules
REPORT DEMO_DYNPRO_F4_HELP_MODULE.
TYPES: BEGIN OF VALUES,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
END OF VALUES.
DATA: CARRIER(3) TYPE C,
CONNECTION(4) TYPE C.
DATA: PROGNAME LIKE SY-REPID,
DYNNUM LIKE SY-DYNNR,
DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
VALUES_TAB TYPE TABLE OF VALUES.
CALL SCREEN 100.
MODULE INIT OUTPUT.
PROGNAME = SY-REPID.
DYNNUM = SY-DYNNR.
CLEAR: FIELD_VALUE, DYNPRO_VALUES.
FIELD_VALUE-FIELDNAME = 'CARRIER'.
APPEND FIELD_VALUE TO DYNPRO_VALUES.
ENDMODULE.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE VALUE_CARRIER INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = 'DEMOF4HELP'
FIELDNAME = 'CARRIER1'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CARRIER'.
ENDMODULE.
MODULE VALUE_CONNECTION INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = PROGNAME
DYNUMB = DYNNUM
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNPRO_VALUES.
READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
SELECT CARRID CONNID
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
WHERE CARRID = FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CONNECTION'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUES_TAB.
ENDMODULE.
The next screen (statically defined) for screen 100 is itself. It has the following layout:
The input fields have been adopted from the program fields CARRIER and CONNECTION. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE INIT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON VALUE-REQUEST.
FIELD CARRIER MODULE VALUE_CARRIER.
FIELD CONNECTION MODULE VALUE_CONNECTION.
When the user chooses input help for the individual fields, the following is displayed:
For the Airline field, the POV module VALUE_CARRIER is called. The function module F4IF_FIELD_VALUE_REQUEST displays the input help for the component CARRIER1 of the structure DEMOF4HELP from the ABAP Dictionary, namely the search help DEMOF4DE. The users selection is returned to the screen field CARRIER.
For the Flight number field, the POV module VALUE_CONNECTION is called. The function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the users selection into the screen field CONNECTION.
For POH------------
Field Help
There are three ways of displaying field help for screen elements:
Data Element Documentation
If you place a field on the screen in the Screen Painter by copying a ABAP Dictionary field, the corresponding data element documentation from the ABAP Dictionary is automatically displayed when the user chooses field help (as long as the help has not been overridden in the screen flow logic).
For further information about creating data element documentation, refer to data elements.
Data Element Supplement Documentation
If the data element documentation is insufficient, you can expand it by writing a data element supplement
Data element supplement documentation contains the heading Definition, as well as the following others:
Use
Procedure
Examples
Dependencies
To create data element supplement documentation for a screen, choose Goto ® Documentation ® DE supplement doc. from the element list of the screen. A dialog box appears in which the system proposes a number as the identified for the data element supplement. You can then enter help texts for the above headings using the SAPscript editor.
Data element supplement documentation created in this way is program- and screen-specific. Any data element supplement documentation created in the ABAP Dictionary with the same number is overridden by the screen-specific documentation. You can link existing data element supplement documentation created in the ABAP Dictionary with a screen field by using the table THLPF. To do this, crate a new row in THLPF containing the following data: Program name, screen name, field name, and number of the data element supplement documentation.
To display data element supplement documentation, you must code the following screen flow logic in the POH event:
PROCESS ON HELP-REQUEST.
FIELD <f> [MODULE <mod>] WITH <num>.
After PROCESS ON HELP-REQUEST, you can only use FIELD statements. If there is no PROCESS ON HELP-REQUEST keyword in the flow logic of the screen, the data element documentation for the current field, or no help at all is displayed when the user chooses F1. Otherwise, the next FIELD statement containing the current field <f> is executed.
If there is screen-specific data element supplement documentation for the field <f>, you can display it by specifying its number <num>. The number <num> can be a literal or a variable. The variable must be declared and filled in the corresponding ABAP program.
You can fill the variables, for example, by calling the module <mod> before the help is displayed. However, the FIELD statement does not transport the contents of the screen field <f> to the ABAP program in the PROCESS ON HELP-REQUEST event.
For further information about data element supplement documentation, refer to Data Element Supplements.
Calling Help Texts from Dialog Modules
If data element supplement documentation is insufficient for your requirements, or you want to display help for program fields that you have not copied from the ABAP Dictionary, you can call dialog modules in the POH event:
PROCESS ON HELP-REQUEST.
FIELD <f> MODULE <mod>.
After the PROCESS ON HELP-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F1 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. However, the contents of the screen field <f> are not available in the module <mod>, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. The field help should not be dependent on the user input.
The module <mod> is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:
HELP_OBJECT_SHOW_FOR_FIELD
This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.
HELP_OBJECT_SHOW
Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.
For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.
Field help on screens.
REPORT DEMO_DYNPRO_F1_HELP.
DATA: TEXT(30),
VAR(4),
INT TYPE I,
LINKS TYPE TABLE OF TLINE,
FIELD3, FIELD4.
TABLES DEMOF1HELP.
TEXT = TEXT-001.
CALL SCREEN 100.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE F1_HELP_FIELD2 INPUT.
INT = INT + 1.
CASE INT.
WHEN 1.
VAR = '0100'.
WHEN 2.
VAR = '0200'.
INT = 0.
ENDCASE.
ENDMODULE.
MODULE F1_HELP_FIELD3 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.
ENDMODULE.
MODULE F1_HELP_FIELD4 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW'
EXPORTING
DOKCLASS = 'TX'
DOKLANGU = SY-LANGU
DOKNAME = 'DEMO_FOR_F1_HELP'
DOKTITLE = TEXT-003
TABLES
LINKS = LINKS.
ENDMODULE.
The next screen (statically defined) for screen 100 is 100. It has the following layout:
The screen fields DEMOf1HELP-FIELD1 and DEMOF1HELP-FIELD2 from the ABAP Dictionary and the program fields FIELD3 and FIELD4 are assigned to the input fields. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON HELP-REQUEST.
FIELD DEMOF1HELP-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
FIELD FIELD3 MODULE F1_HELP_FIELD3.
FIELD FIELD4 MODULE F1_HELP_FIELD4.
The components FIELD1 and FIELD2 of structure DEMOF1HELP both refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200.
The following field help is displayed:
When the user chooses F1 on the input field for DEMOF1HELP-FIELD1, the data element documentation for DEMOF1TYPE is displayed, since the field does not occur in the PROCESS ON HELP-REQUEST event.
If the user chooses F1 repeatedly for the input field DEMOF1HELP-FIELD2, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200 alternately. The variable VAR is filled in the dialog module F1_HELP_FIELD2.
When the user chooses F1 on the input field for FIELD3, the data element documentation for DEMOF1TYPE is displayed, since this is called in the dialog module F1_HELP_FIELD3 by the function module HELP_OBJECT_SHOW_FOR_FIELD.
When the user chooses F1 on the input field for FIELD4, the SAPscript documentation DEMO_FOR_F1_HELP is displayed, since this is called in the dialog module F1_HELP_FIELD4 by the function module HELP_OBJECT.
Regards,
Deepu.K -
Mapping Help for replacing source value
Mapping Help for replacing source value
Posted: Mar 14, 2006 1:06 AM Reply
Hi all,
I am unable to do transform the source value to required target value,
From Source ADDRESS_TYPE = 'HOME' should be replaced with 03 to target field ANSSA, and 'MAIL' to be replaced with 05, I am trying to do it but i am unable to handle it, please give u r valuable suggestions,
The source structure is like this,
- <Event ID="239" TRANS_TYPE="ADR">
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="HOME" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="HOME" KEY3="02/10/2006" />
<PersAddr GEO_LOC_CD="US" EMPLID="29" ADDRESS_TYPE="MAIL" EFFDT="02/15/2006" ADDRESS1="92nd Floor" ADDRESS2="812backstreet" ADDRESS3="" ADDRESS4="" CITY="London" COUNTY="" STATE="AN" POSTAL="EC2N 4AG1" COUNTRY="GBR" KEY1="29" KEY2="MAIL" KEY3="02/10/2006" />
</Event>
REGARDS,
sridharHi,
This can be done using user-defined function as well.
Code the function as...
if(Addr_Type.equals("HOME"))
return "03";
else if(Addr_Type.equals("MAIL"))
return "05";
else
return "Invalid Address Type";
Here, Addr_Type is Input String Argument for this function.
Map this function between ADDRESS_TYPE and ANSSA.
Regards,
Uma -
How to dinamically name objects in a for statement using addChild
Hi.
I was wondering where did go the for statement with
attachMovie from library in AS 3.
I mean i was having in AS 2:
for (i=0; i<5; i++) {
attachMovie("sim", "sim"+i, i);
Now in AS 3:
for (var i=0; i<5; i++) {
addChild(new sim());
I can't figure out how to name every instance of the "sim"
object from library that i add to the stage without using string.
How do I dinamically name the added instances of the object
from the library for future reference and usage throughout the
code?
Thanks a lot.Well except those items aren't named! :)
The sim class (BTW it is generally better practice to have
class names start capitalized so that they can be distinguished
from instances which should be lower case.) would need to have a
name property if you wan't to name the instances.
This code create a variable which refers to each Sim instance
and those variables have a "name" of sim0, sim1, etc. And I think
this would be close to replicating the AS2 behavior. But AS3 is a
shift in thinking about your content as well and I don't think this
is probably the best approach.
The bad thing here is that the references aren't typed. Which
disables a lot of the good things that the compiler can do for you.
The following code would do the same thing as clbeech's and give
each instance a name (assuming the class definition includes a name
property.)
var i:int;
for(i=0;i=5;i++){
var curSim:Sim=new Sim();
curSim.name="sim"+i;
addChild(curSim);
Then the trick which is new in AS3 is to use the
DisplayObjectContainer.getChildByName() method when you want to the
retrieve an instance by its name. The help files do caution that
this is slower than something like getChildAt() which retrieves the
values from an array.
So perhaps that points the way toward a better way of
managing these types of things. Perhaps you should create an array
and push a reference to each of your Sim instances onto that array.
But it all really depends upon what you are trying to accomplish. -
Method calls in switch and for statements
I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
1)
switch (foo.getIntegerValue()){
case 1:
case 2:
}My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
2)
for (Foo bla : xyz.compileFoos()) {
}Is compileFoos called once or on every iteration?
I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
any help is appreciatedsdb2 wrote:
I have 2 questions concerning method calls in switch and for statements. Consider these two chunks of code:
1)
switch (foo.getIntegerValue()){
case 1:
case 2:
}My question is, is getIntegerValue() being called for every case statement (since it has to compare with each case) or is the method called only once?
Once, and the value returned compared to each "case" in turn.
2)
for (Foo bla : xyz.compileFoos()) {
}Is compileFoos called once or on every iteration?
I assume it gets called only once but I would like to be sure. The reason I ask is of course to avoid multiple method calls.
any help is appreciatedAlso once, and the returned list/set/array is iterated over. -
Need Help for AIR Email Application
Hi,
I’m a beginner to Adobe AIR.
My new assignment is to create an AIR Application which works like MS Outlook with minimal features like compose mail, inbox, send items and contact details.
With the help of some server side script (like PHP, CF) I can make it work. But My TL asked me to communicate directly with mail server through AIR.
I googled for a week for some tutorial to help me, But I can’t find anything useful.
Is there any way to communicate directly with web server and list the Inbox, Outbox, and Contact details…? If so, please help me to find the solution…
Thanks In AdvanceHi,
You can use LaunchExecutableEx to determine the window state:
LaunchExecutableEx ("command.com /C calc.exe", LE_HIDE, NULL);
Beware that this function does not wait for the started executable to exit.
It executes the command in the string and continues.
If your application has to get the results of the call, then you need to get the application handle (3rd parameter, put a variable instead of the NULL above) and call ExecutableHasTerminated in a loop to find out if the execution finished.
Read carefully the help for the LaunchExecutableEx function and Handle parameter.
To get the result of the command line call, you can add a "> output.txt" parameter to the end of your command line call.
This way all the text output of the command is written to the output.txt file, from which you can read the result.
Check the command-line email sender program's help if there is a special paramter to make it more "verbose".
Hope this helps,
S. Eren BALCI
www.aselsan.com.tr
Maybe you are looking for
-
Safari quit unexpectedly while using the tasty apps plugin
Is anyone konows what can i do fix it ? :S every time I try t open safari this happens.... :S please helpme !!!! Process: Safari [1318] Path: /Applications/Safari.app/Contents/MacOS/Safari Identifier: com.apple.Safari Version:
-
How to rip from vinyl direct to ipad
My turntable and desktop are in different rooms and it seems like it should be quite easy to connect my iPad to the audio out in some way (via mic jack or USB camera adapter?) and record with GarageBand or some other app, but despite a lot of searchi
-
Replacement for obsolete 'FM NAMETAB_GET'
Hi, We have been upgrading SAP from 4.6B to ECC6.0...During this process we have encountered an obsolete 'FM NAMETAB_GET', but as no documentation is available for the same, we are looking for an alternative / replacement for the 'FM NAMETAB_GET'.
-
Crashes randomly (Could not find answer on the internet)
I have basically 3 computers with the same hardware except for the power supply. 3 are running same programs, same way installed etc. 2 are running fine but one of the computer has firefox crashing randomly overtime. Crash: https://crash-stats.mozill
-
What do I need to ensure a smooth roll out of multiple i pads within a primary school
I am intending on rolling out i pads within my primary school. can anyone informme of ways to bulk synch them and also about bulk purchases of apps etc etc