If statment needing if else for fales.
Just been working over a text book and came accross a problem. The question in the text book is to build a Reactor class with with two methods first been UML:-
+increaseTemperature(boolean)
+decreasTemperature(boolean)
the qustions say the increase temperature should never be allowed to rise above 10. If an attempt is made then return a value of false.
so the code i have is :-
public class Reactor {
private int temperature;
public final static int MAX = 10;
public final static int MIN = -10;
public void Reactor()
temperature = 0;
public int getTemperature()
return temperature;
public void increaseTemperature(boolean alarm)
if ( temperature >= MAX)
alarm = false;
temperature++;
alarm = true;
public void decreaseTemperature(boolean alarm)
if ( temperature <= MIN)
alarm = false;
temperature--;
alarm = true;
} now for the problem I have got and don't understand why this happens. In my main method I have an if statment that works on the return of the increaseTemperature(boolean)
so if return true print reactor is fine else print reactor is critical. However this does not work but if i place if else false it does work?? see code below
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
char option;
Reactor reactorSheffield = new Reactor();
boolean alarm = true;
System.out.println("Welcome to the Reactor program for sheffield");
System.out.println("please select for the following options ");
do{
System.out.println("[1] check temperature ");
System.out.println("[2] incress the temp ");
System.out.println("[3] decress the temp ");
System.out.println("[4] exit the programm ");
option = EasyScanner.nextChar();
switch (option)
case '1': reactorTemp(reactorSheffield);
break;
case '2': reactorSheffield.increaseTemperature(alarm);
break;
if (alarm = true)
System.out.println("*****Reactor is fine*****"+reactorSheffield.getTemperature());
else
System.out.println("**********Reactor is critical******"+reactorSheffield.getTemperature());
}while (option != '3');
} not working
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
char option;
Reactor reactorSheffield = new Reactor();
boolean alarm = true;
System.out.println("Welcome to the Reactor program for sheffield");
System.out.println("please select for the following options ");
do{
System.out.println("[1] check temperature ");
System.out.println("[2] incress the temp ");
System.out.println("[3] decress the temp ");
System.out.println("[4] exit the programm ");
option = EasyScanner.nextChar();
switch (option)
case '1': reactorTemp(reactorSheffield);
break;
case '2': reactorSheffield.increaseTemperature(alarm);
break;
if (alarm = true)
System.out.println("*****Reactor is fine*****"+reactorSheffield.getTemperature());
else if(alarm = false)
System.out.println("**********Reactor is critical******"+reactorSheffield.getTemperature());
}while (option != '3');
}thsi works why?
I don't understand why the secound one works and still learning about this. Any help would be great so I understand how it all works.
In Java all variables are passed by value. This means that the value of the variable you are passing into the method is copied to the method. The method does not have access to the original variable reference you passed it, it will therefore not be updated.
public class PassByValue {
public static void flipBoolean(boolean b) {
b = !b;
public static boolean flipBooleanWithReturn(boolean b) {
return !b;
public static void main(String[] args) {
boolean testBool = true;
System.out.printf("Original value of boolean: %s%n%n",Boolean.toString(testBool));
flipBoolean(testBool);
System.out.printf("Value of boolean after attempting to change variable submitted as parameter: %s%n%n",Boolean.toString(testBool));
boolean newBool = flipBooleanWithReturn(testBool);
System.out.printf("Value of boolean obtained through return parameter (simple and correct way to notify whether an action has been performed): %s%n%n",Boolean.toString(newBool));
}Also, you are unecessarily using an equals sign to do a logical evaluation of a boolean's value. This is causing a problem, because you are in fact using an assignment operator not a logical equals.
Look at this code for a demonstration.
public class ShowProperBooleanUsage {
public static void main(String[] args) {
boolean b = false;
if(b) {
System.out.println("This does not get executed because the value of the boolean evaluates to false");
} else {
System.out.println("This is the proper way to use an if statement with a boolean value");
System.out.println();
if(b == true) {
System.out.println("unnecessary check for boolean equality");
} else {
System.out.println("There is no need to perform a logical equals against a literal boolean to evaluate the boolean value of a boolean");
System.out.println("It is redundant just like the explanation");
System.out.println("Saying (b == true) is exactly the same as saying b");
System.out.println("Saying (b == false) is exactly the same as saying !b");
System.out.println();
if(b = true) {
System.out.println("You might think this is the same as the statement above");
System.out.println("However, what you are really doing is setting the value of b to true and then check to see if it is true");
System.out.println("Therefore the execution will end up in the if part of the statement instead of the else");
} else {
System.out.println("Doesn't get here, you have performed a logical coding error which will not be caught by the compiler");
System.out.println("It is better practice to avoid making assignment at the same time you are performing logical evaluations to avoid these problems.");
}
Similar Messages
-
I want to buy an Apple TV for my grandchild so she can play content from her Ipad on her family's big screen TV. She has cable WiFi in her home does she need anything else beside the Apple TV. Also what is AirPlay. Is it an app, a service or a seperate hardware from the Apple TV?
Airplay is a wireless streaming protocol. It allows content to be pushed from the iPad through the Apple TV onto your connected HDTV.
If she wants to see the iPad displayed on the big screen and/or play games that involves mirroring. As long as it's an iPad 2 (or later) then you will be fine. More info on both has been referened below
http://support.apple.com/kb/HT4437?viewlocale=en_US&locale=en_US
http://support.apple.com/kb/ht5209 -
Need sound drivers for a Pavillion dv8309us running Windows 7 Enterprise 64-Bit OS
Need sound drivers for a Pavillion dv8309us running Windows 7 Enterprise 64-Bit OS. I'm getting "no audio output device is installed" error after trying various different drivers. Sometimes the driver will install and I'll reboot, but to no avail I end up with the same error and a red X over the speaker in the system tray. I've tried Realtek drivers and Conexant drivers from HP. When I run Windows upgrade advisor it recognizes the problem, but Microsoft doesn't offer a compatible driver. At this point I'm very desperate considering everything else works fine and I don't want to go back too XP Media Center. If there is anything you can do to help, it would be greatly appreciated. Thank you
I guess this one isn't even 64 bit but it is the one on HP's site:
http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-46818-1&cc=us&dlc=en&lc=en&...
I never tried to force a driver but I think it can be done. I seeing that in some threads.
Reminder: Please select the "Accept as Solution" button on the post that best answers your question. Also, you may click on the white star in the "Kudos" button for any helpful post to give that person a quick thanks. These feedback tools help keep our community active, so you receive better answers faster. -
I refurbished my macbook air 7 months ago because there was a problem with the steady state drive. Now my battery seems to be dead again. How long does the warranty last? Do I need to pay for a new battery?
As I wrote Apple will diagnose an Apple product even if it is out of warranty for free. That should be your first step to find out if the problem is the battery or something else.
Once you have Apple telling you a 7 month old battery is defective (if that turns out to be the case) then it becomes a game of horse trading. You'll need to speak to the tech and when he tells you there is nothing he can do you will need to speak to the tech manager and when she says most likely there is nothing they can do you go to the store manager, etc. It is unlikely (though possible) that they will give in easily you need to be firm, polite and let on that you're willing to accept a partial reimbursement.
So again the first step is to find out what is wrong.
good luck -
I Need Java code for following Algorithm
* I Need Java code for following algorithm. Kindly any one help.
1. Read the contents (ideas and its corresponding scores) from two files named as 'a' and 'b'.
2. Stored the file 'a' contents in array a[].
3. Stored the file 'b' contents in array b[].
4. compare both files like
if(a.equals(b[j])
Writing the common idea and add the score from file 'a' and 'b'.
else
write the uncommon idea and its score..
For example :
Form Agents.txt
action,65
architecture,85
eco-,15
essay,30
form,85
form,85
link,40
tangent,25
Form Agents1.txt
Black holes,69
essay,78
Herewith i have above mentioned two files named as Form Agents and Form Agents1.
Form Agents has eight fields
Form Agents1 has two fields
--> 'essay' is common in two files, so store the idea 'essay' and add the score from Form Agents score is '30' and Form Agents1 has 78 (essay 108).
Finally it stores idea in another file with uncommon fields also.
Please help us.We have tried with following code.
But we cant add the scores.
For Example:
Form Agents.txt --> has "essay,30"
Form Agents1.txt --> has "essay,78"
Result is: essay,108
Finally it stores idea in another file with uncommon fields also.
So Any one pls correct the following code.
try
DataOutputStream o1=new DataOutputStream(new
FileOutputStream("C:\\Interfaces\\interfaces\\temp\\BlackBoard\\My Design
World\\Project\\Material\\art\\System Agents\\Form Agents\\CandidateResponses\\Form
Agents.txt"));
//Reading the contents of the files
BufferedReader br= new BufferedReader(new InputStreamReader(new
FileInputStream("C:\\Interfaces\\interfaces\\temp\\BlackBoard\\My Design
World\\Project\\Material\\art\\System Agents\\Form Agents\\Ideological\\Form
Agents.txt")));
BufferedReader br1= new BufferedReader(new InputStreamReader(new
FileInputStream("C:\\Interfaces\\interfaces\\temp\\BlackBoard\\My Design
World\\Project\\Material\\art\\System Agents\\Form Agents\\Related\\Form
Agents.txt")));
while((s=br.readLine())!=null)
s1+=s+"\n";
while((s2=br1.readLine())!=null)
s3+=s2+"\n";
int numTokens = 0;
StringTokenizer st = new StringTokenizer(s1);
String[] a = new String[10000];
String[] br_n=new String[10000];
int i=0;
while (st.hasMoreTokens())
s2 = st.nextToken();
a=s2.substring(0,s2.length()-3);
s6=s2.substring(s2.length()-2);
br_n[i]=s6;
i++;
numTokens++;
int numTokens1 = 0;
StringTokenizer st1 = new StringTokenizer (s3);
String[] b = new String[10000];
String[] br1_n=new String[1000];
int j=0;
while (st1.hasMoreTokens())
s4 = st1.nextToken();
b[j]=s4.substring(0,s4.length()-3);
s7=s4.substring(s4.length()-2);
br1_n[j]=s7;
j++;
numTokens1++;
int x=0;
for(int m=0;m<a.length;m++)
for(int n=0;n<b.length;n++)
if(a[m].equalsIgnoreCase(b[n])){
int sc=Integer.parseInt(br_n[m]);
int sc1=Integer.parseInt(br1_n[n]);
int score=sc+sc1;
o.writeBytes(a[m]+","+score+"\n");
break;
else
o.writeBytes(a[m]+","+br_n[m]+"\n");
break;
}catch(Exception e){} -
Need a code for finding prime no.s from 0 to 100.
Hi,
i need a code for finding prime no.s from 0 to 100.
Please help me out.
Regards,
Santosh Kotra.hai santosh,
here is an example program to find the prime number...........
EXAMPLE:
DATA: BEGIN OF primes OCCURS 0,
number TYPE i,
exp TYPE i,
END OF primes.
DATA: w_mult TYPE i,
w_limi TYPE i,
w_prem TYPE i.
DATA: w_outp TYPE text132.
DATA: w_rtime TYPE i,
w_stime TYPE p DECIMALS 3.
DEFINE add_part.
sy-fdpos = strlen( &1 ) + 1.
&1+sy-fdpos(*) = &2.
condense &1.
END-OF-DEFINITION.
PARAMETERS: p_numb TYPE i, "number to check
p_fact TYPE c AS CHECKBOX, "display components
p_nbpr TYPE c AS CHECKBOX. "nb of primes
START-OF-SELECTION.
GET RUN TIME FIELD w_rtime.
IF p_nbpr IS INITIAL OR p_numb LE 12000.
PERFORM eratostene USING p_numb.
add_part w_outp p_numb.
READ TABLE primes WITH KEY number = p_numb.
IF sy-subrc = 0.
add_part w_outp 'is prime'.
ELSE.
IF p_fact IS INITIAL.
add_part w_outp 'is not prime'.
ELSE.
add_part w_outp '='.
w_limi = p_numb.
LOOP AT primes WHERE exp GT 0.
CHECK primes-number LE w_limi.
IF w_prem GT 0.
add_part w_outp '*'.
ENDIF.
IF primes-exp GT 1.
add_part w_outp '('.
add_part w_outp primes-number.
add_part w_outp '^'.
add_part w_outp primes-exp.
add_part w_outp ')'.
ELSE.
add_part w_outp primes-number.
ENDIF.
w_limi = w_limi / ( primes-number ** primes-exp ).
IF w_limi = 1.
EXIT.
ENDIF.
w_prem = 1.
ENDLOOP.
ENDIF.
ENDIF.
WRITE: / w_outp.
IF NOT p_nbpr IS INITIAL.
DESCRIBE TABLE primes LINES sy-tmaxl.
CLEAR: w_outp.
add_part w_outp 'Number of primes:'.
add_part w_outp sy-tmaxl.
WRITE: / w_outp.
SKIP.
LOOP AT primes.
WRITE: / primes-number.
ENDLOOP.
ENDIF.
ELSE.
PERFORM factors.
ENDIF.
GET RUN TIME FIELD w_rtime.
w_stime = w_rtime / 1000000.
SKIP.
CLEAR: w_outp.
add_part w_outp 'Calculation time:'.
add_part w_outp w_stime.
WRITE: / w_outp.
FORM eratostene *
FORM eratostene USING in_number TYPE i.
DATA: BEGIN OF no_primes OCCURS 0,
number TYPE i,
END OF no_primes.
DATA: cnum TYPE i,
dnum TYPE i,
limi TYPE i,
mult TYPE i,
puis TYPE i,
cmod TYPE i.
IF NOT ( p_fact IS INITIAL AND p_nbpr IS INITIAL ).
limi = in_number.
ELSE.
limi = sqrt( in_number ).
ENDIF.
cnum = 2.
WHILE cnum LE limi.
READ TABLE no_primes WITH KEY number = cnum.
IF sy-subrc NE 0.
primes-number = cnum.
mult = 2.
puis = 1.
dnum = mult * cnum.
WHILE dnum LE in_number.
READ TABLE no_primes WITH KEY number = dnum.
IF sy-subrc NE 0.
no_primes-number = dnum.
APPEND no_primes.
ENDIF.
IF NOT p_fact IS INITIAL.
cmod = dnum MOD ( cnum ** puis ).
IF cmod = 0.
cmod = in_number MOD ( cnum ** puis ).
IF cmod = 0.
primes-exp = puis.
puis = puis + 1.
ENDIF.
ENDIF.
ENDIF.
mult = mult + 1.
dnum = mult * cnum.
ENDWHILE.
APPEND primes.
CLEAR: primes.
ENDIF.
cnum = cnum + 1.
ENDWHILE.
ENDFORM.
FORM factors *
FORM factors.
DATA: ex_factors TYPE string,
mod TYPE i,
still TYPE f,
factor TYPE i,
exponent TYPE i,
square TYPE f,
fac_string TYPE text40,
exp_string TYPE text40.
IF p_numb LE 3.
ex_factors = p_numb.
ELSE.
factor = 2.
still = p_numb.
DO.
CLEAR: exponent.
mod = still MOD factor.
WHILE mod = 0.
exponent = exponent + 1.
still = still div factor.
mod = still MOD factor.
ENDWHILE.
IF exponent EQ 1.
fac_string = factor.
CONCATENATE ex_factors '*' fac_string
INTO ex_factors
SEPARATED BY space.
CONDENSE ex_factors.
ELSEIF exponent GT 1.
fac_string = factor.
exp_string = exponent.
CONCATENATE ex_factors '* (' fac_string
'^' exp_string ')'
INTO ex_factors
SEPARATED BY space.
CONDENSE ex_factors.
ENDIF.
factor = factor + 1.
square = factor ** 2.
IF square GT still.
EXIT.
ENDIF.
ENDDO.
IF still GT 1.
CATCH SYSTEM-EXCEPTIONS convt_overflow = 1.
fac_string = factor = still.
ENDCATCH.
IF sy-subrc NE 0.
fac_string = still.
ENDIF.
CONCATENATE ex_factors '*' fac_string
INTO ex_factors
SEPARATED BY space.
CONDENSE ex_factors.
ENDIF.
SHIFT ex_factors UP TO '*'.
SHIFT ex_factors BY 2 PLACES.
ENDIF.
WRITE: / p_numb RIGHT-JUSTIFIED.
IF ex_factors CA '*^'.
WRITE: '=', ex_factors.
ELSE.
WRITE: 'is prime'.
ENDIF.
ENDFORM.
HOPE THIS WILL BE HELPFULL.
regards
praba. -
In Need of PW for factory set 'user user' account so I can complete update! :)
I bought a macbook from someone else and before they sold it to me, they set the cpu back to factory settings. I need to do a software update but I need a password for the account 'user user' in order to complete it. I have the MAC OS X Install Disc 1 and 2. Does anyone know the PW and/or know how I can change it I am used to working with pc's and am new to the mac environment so if you could put the instructions in simplest terms. Does anyone know how to get this mess fixed????? Help plz!!!
<Edited by Host>Boot the installation DVD. From the Utilities menu, you can reset account passwords.
Or you could just reinstall from scratch using the installation DVDs.
You could also wipe the disk using the installation DVD Utilities menu -> Disk Utility -
I need a bapi for workdownstructure elements
i need a bapi for workdownstructure elements
WBS number
WBS descriptions
WBS start date
WBS end date
Status
thanks and regards,
jameer.p
Edited by: Jameer P on Jan 30, 2008 12:59 PMHai.
It may help you.
can use WS_DOWNLOAD like this:
L_T_HEADERS TYPE TABLE OF TEXT40.
IF SP_LOCAL = 'X'.
Headings: TEXT-U01 ... TEXT-U28
DO 28 TIMES.
CLEAR: L_F_INDEX,L_F_NAME,L_F_HEADERS.
L_F_INDEX = SY-INDEX.
CONCATENATE 'TEXT-U' L_F_INDEX INTO L_F_NAME.
ASSIGN (L_F_NAME) TO <FS_HEADER>.
L_F_HEADERS = <FS_HEADER>.
APPEND L_F_HEADERS TO L_T_HEADERS.
ENDDO.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = SP_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = L_T_OUT
FIELDNAMES = L_T_HEADERS
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
LEAVE PROGRAM.
ELSE.
DESCRIBE TABLE L_T_OUT LINES L_F_COUNT.
MESSAGE I145 WITH L_F_COUNT SP_FILE.
ENDIF.
Regards.
Sowjanya.b. -
Need sample programs for inbound & outbound interfaces in abap hr?
hi friends
i need sample programs for inbound & outbound interface programs in hr abap . any one send me pls
thanks & regards
deepurd&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Report ZPROG65_11 *
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
REPORT zprog65_11 .
TABLES : lfa1.
TYPES : BEGIN OF ven ,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs ,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
spars LIKE lfa1-spras,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
anred LIKE lfa1-anred ,
END OF ven .
DATA : t_ven TYPE TABLE OF ven WITH HEADER LINE ,
t_bdc LIKE TABLE OF bdcdata WITH HEADER LINE .
DATA : v_file TYPE string ,
v_temp TYPE i ,
v_lifnr(10) TYPE n,
v_hdate LIKE sy-datum.
DATA : c_tcode LIKE sy-tcode .u201Dvalue u2018XK01u2032.
PARAMETERS : p_file(30) DEFAULT u2018c:\vendor1_11.txtu2019,
p_group LIKE apqi-groupid.
START-OF-SELECTION .
MOVE p_file TO v_file .
PERFORM file_upload TABLES t_ven USING v_file .
v_hdate = sy-datum - 1.
CALL FUNCTION u2018BDC_OPEN_GROUPu2019
EXPORTING
client = sy-mandt
DEST = FILLER8
group = p_group
holddate = v_hdate
keep = u2018Xu2019
user = sy-uname
IMPORTING
QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
OTHERS = 11
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT t_ven .
clear lfa1.
v_temp = 0.
MOVE t_ven-lifnr TO v_lifnr.
SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr =
v_lifnr.
IF sy-subrc = 0.
WRITE :/ u2018foundu2019.
v_temp = 1.
else.
write: / u2018not foundu2019.
ENDIF.
IF v_temp = 0.
c_tcode = u2018xk01u2032.
PERFORM fill_ddc_table .
ELSEIF v_temp = 1.
c_tcode = u2018xk02u2032.
PERFORM fill_bdc_table .
ENDIF.
CALL FUNCTION u2018BDC_INSERTu2019
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_bdc
EXCEPTIONS
internal_error = 1
OTHERS = 7.
REFRESH t_bdc .
ENDLOOP .
CALL FUNCTION u2018BDC_CLOSE_GROUPu2019
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013>P_T_VEN text
u2013>P_V_FILE text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM file_upload TABLES p_tven STRUCTURE t_ven
USING p_vfile.
CALL FUNCTION u2018GUI_UPLOADu2019
EXPORTING
filename = p_vfile
filetype = u2018ASCu2019
has_field_separator = u2018Xu2019
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = p_tven
EXCEPTIONS
file_open_error = 1
file_read_error = 2
OTHERS = 17
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. u201D file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_ddc_table .
SCREN 100
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180100u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-KTOKKu2019.
t_bdc-fval = t_ven-ktokk.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
120
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180120u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
130
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180130u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=ENTRu2019.
APPEND t_bdc. CLEAR t_bdc.
210
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180210u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-AKONTu2019.
t_bdc-fval = t_ven-akont .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-FDGRVu2019.
t_bdc-fval = t_ven-fdgrv.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
215
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180215u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
220
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180220u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
310
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180310u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFM1-WAERSu2019.
t_bdc-fval = t_ven-waers .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
320
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180320u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=UPDAu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201CFILL_DDC_TABLE
u201D FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_BDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_bdc_table .
SCREN 101
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180101u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018lfa1-anredu2019.
t_bdc-fval = t_ven-anred .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
300
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180300u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=YESu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201D FILL_BDC_TABLE
Best Regards -
Need a download for Illustrator CS4
I need a download for Illustrator CS4. I have a valid serial number but the disc seems to be damaged.
CS4 - http://helpx.adobe.com/creative-suite/kb/cs4-product-downloads.html
You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
CS3 and CS4: http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html -
Need Menu Exit for T-Code ME32K in ECC
Hello,
I need Menu Exit for Transaction ME32K in ECC version, It would be helpful if any one could tell me,
Deserving answer will be rewarded points
Regards
Rajeshhi
use this program to search for the BADIS and enhancements
& Report ZPJA_PM002 (V2) &
& Text Elements: &
& P_DEVC Show user-exits from development class &
& P_LIMIT Limit submit program selection &
& P_FUNC Show function modules &
& P_SUBM Show submit programs &
& S01 Selection data (TCode takes precedence over program name) &
report zpja_pm002
no standard page heading
line-size 158.
*tables: enlfdir. "Additional Attributes for Function Modules
data: tabix like sy-tabix,
w_linnum type i,
w_off type i,
w_index like sy-tabix,
w_include like trdir-name,
w_prog like trdir-name,
w_incl like trdir-name,
w_area like rs38l-area,
w_level,
w_str(50) type c,
w_funcname like tfdir-funcname.
constants: c_fmod(40) type c value 'Function modules selected: ',
c_subm(40) type c value 'Submit programs selected: ',
c_col1(12) type c value 'Enhanmt Type',
c_col2(40) type c value 'Enhancement',
c_col3(30) type c value 'Program/Include',
c_col4(20) type c value 'Enhancement Name',
c_col5(40) type c value 'Enhancement Description'.
Work Areas: ABAP Workbench
data: begin of wa_d010inc.
data: master type d010inc-master.
data: end of wa_d010inc.
data: begin of wa_tfdir.
data: funcname type tfdir-funcname,
pname type tfdir-pname,
include type tfdir-include.
data: end of wa_tfdir.
data: begin of wa_tadir.
data: devclass type tadir-devclass.
data: end of wa_tadir.
data: begin of wa_tstc.
data: pgmna type tstc-pgmna.
data: end of wa_tstc.
data: begin of wa_tstcp.
data: param type tstcp-param.
data: end of wa_tstcp.
data: begin of wa_enlfdir.
data: area type enlfdir-area.
data: end of wa_enlfdir.
Work Areas: BADIs
data: begin of wa_sxs_attr.
data: exit_name type sxs_attr-exit_name.
data: end of wa_sxs_attr.
data: begin of wa_sxs_attrt.
data: text type sxs_attrt-text.
data: end of wa_sxs_attrt.
Work Areas: Enhancements
data: begin of wa_modsap.
data: member type modsap-member.
data: end of wa_modsap.
data: begin of wa_modsapa.
data: name type modsapa-name.
data: end of wa_modsapa.
data: begin of wa_modsapt.
data: modtext type modsapt-modtext.
data: end of wa_modsapt.
Work Areas: Business Transaction Events
data: begin of wa_tbe01t.
data: text1 type tbe01t-text1.
data: end of wa_tbe01t.
data: begin of wa_tps01t.
data: text1 type tps01t-text1.
data: end of wa_tps01t.
user-exits
types: begin of t_userexit,
type(12) type c,
pname like trdir-name,
txt(300),
level type c,
modname(30) type c,
modtext(40) type c,
end of t_userexit.
data: i_userexit type standard table of t_userexit with header line.
Function module developmnet classes
types: begin of t_devclass,
clas like trdir-clas,
end of t_devclass.
data: i_devclass type standard table of t_devclass with header line.
Submit programs
types: begin of t_submit,
pname like trdir-name,
level,
done,
end of t_submit.
data: i_submit type standard table of t_submit with header line.
Source code
types: begin of t_sourcetab, "#EC * (SLIN lügt!)
line(200), "#EC * (SLIN lügt!)
end of t_sourcetab. "#EC * (SLIN lügt!)
data: sourcetab type standard table of t_sourcetab with header line.
data c_overflow(30000) type c.
Description of an ABAP/4 source analysis token
data: i_stoken type standard table of stokex with header line.
data wa_stoken like i_stoken.
Description of an ABAP/4 source analysis statement
data: i_sstmnt type standard table of sstmnt with header line."#EC
keywords for searching ABAP code
types: begin of t_keywords,
word(30),
end of t_keywords.
data: keywords type standard table of t_keywords with header line.
function modules within program
types: begin of t_fmodule,
name like rs38l-name,
pname like trdir-name,
pname2 like trdir-name,
level,
bapi,
done,
end of t_fmodule.
data: i_fmodule type standard table of t_fmodule with header line.
& Selection Options &
selection-screen begin of block selscr1 with frame title text-s01.
parameter: p_pname like trdir-name memory id rid,
p_tcode like syst-tcode,
p_limit(4) type n default 100,
p_devc like rihea-dy_ofn default ' ',
p_func like rihea-dy_ofn default ' ',
p_subm like rihea-dy_ofn default ' '.
selection-screen end of block selscr1.
& START-OF-SELECTION &
start-of-selection.
if p_pname is initial and p_tcode is initial.
message e008(hrfpm). "Make entry on the selection screen
stop.
endif.
ensure P_LIMIT is not zero.
if p_limit = 0.
p_limit = 1.
endif.
perform data_select.
perform get_submit_data.
perform get_fm_data.
perform get_additional_data.
perform data_display.
& Form DATA_SELECT &
form data_select.
data selection message to sap gui
call function 'SAPGUI_PROGRESS_INDICATOR'
destination 'SAPGUI'
keeping logical unit of work
exporting
text = 'Get programs/includes' "#EC NOTEXT
exceptions
system_failure
communication_failure
. "#EC *
determine search words
keywords-word = 'CALL'.
append keywords.
keywords-word = 'FORM'.
append keywords.
keywords-word = 'PERFORM'.
append keywords.
keywords-word = 'SUBMIT'.
append keywords.
keywords-word = 'INCLUDE'.
append keywords.
if not p_tcode is initial.
get program name from TCode
select single pgmna from tstc into wa_tstc-pgmna
where tcode eq p_tcode.
if not wa_tstc-pgmna is initial.
p_pname = wa_tstc-pgmna.
TCode does not include program name, but does have refereve TCode
else.
select single param from tstcp into wa_tstcp-param
where tcode eq p_tcode.
if sy-subrc = 0.
check wa_tstcp-param(1) = '/'.
check wa_tstcp-param+1(1) = '*'.
if wa_tstcp-param ca ' '.
endif.
w_off = sy-fdpos + 1.
subtract 2 from sy-fdpos.
if sy-fdpos gt 0.
p_tcode = wa_tstcp-param+2(sy-fdpos).
endif.
select single pgmna from tstc into wa_tstc-pgmna
where tcode eq p_tcode.
p_pname = wa_tstc-pgmna.
if sy-subrc <> 0.
message e110(/saptrx/asc) with 'No program found for: '
p_tcode."#EC NOTEXT
stop.
endif.
else.
message e110(/saptrx/asc) with 'No program found for: ' p_tcode.
"#EC NOTEXT
stop.
endif.
endif.
endif.
Call customer-function aus Program coding
read report p_pname into sourcetab.
if sy-subrc > 0.
message e017(enhancement) with p_pname raising no_program."#EC *
endif.
scan abap-source sourcetab tokens into i_stoken
statements into i_sstmnt
keywords from keywords
overflow into c_overflow
with includes.
WITH ANALYSIS.
if sy-subrc > 0. "keine/syntakt. falsche Ablauflog./Fehler im Skanner
message e130(enhancement) raising syntax_error. "#EC *
endif.
check I_STOKEN for entries
clear w_linnum.
describe table i_stoken lines w_linnum.
if w_linnum gt 0.
w_level = '0'.
w_prog = ''.
w_incl = ''.
perform data_search tables i_stoken using w_level w_prog w_incl.
endif.
endform. "DATA_SELECT
& Form GET_FM_DATA &
form get_fm_data.
data selection message to sap gui
call function 'SAPGUI_PROGRESS_INDICATOR'
destination 'SAPGUI'
keeping logical unit of work
exporting
text = 'Get function module data' "#EC NOTEXT
exceptions
system_failure
communication_failure
. "#EC *
Function module data
sort i_fmodule by name.
delete adjacent duplicates from i_fmodule comparing name.
loop at i_fmodule where done ne 'X'.
clear: i_stoken, i_sstmnt, sourcetab, wa_tfdir, w_include .
refresh: i_stoken, i_sstmnt, sourcetab.
clear wa_tfdir.
select single funcname pname include from tfdir into wa_tfdir
where funcname = i_fmodule-name.
check sy-subrc = 0.
call function 'FUNCTION_INCLUDE_SPLIT'
exporting
program = wa_tfdir-pname
importing
group = w_area.
concatenate 'L' w_area 'U' wa_tfdir-include into w_include.
i_fmodule-pname = w_include.
i_fmodule-pname2 = wa_tfdir-pname.
modify i_fmodule.
read report i_fmodule-pname into sourcetab.
if sy-subrc = 0.
scan abap-source sourcetab tokens into i_stoken
statements into i_sstmnt
keywords from keywords
with includes.
if sy-subrc > 0.
message e130(enhancement) raising syntax_error.
endif.
check i_stoken for entries
clear w_linnum.
describe table i_stoken lines w_linnum.
if w_linnum gt 0.
w_level = '1'.
w_prog = i_fmodule-pname2.
w_incl = i_fmodule-pname.
perform data_search tables i_stoken using w_level w_prog w_incl.
endif.
endif.
endloop.
if p_devc = 'X'.
loop at i_fmodule.
clear: wa_tadir, wa_enlfdir.
select single area from enlfdir into wa_enlfdir-area
where funcname = i_fmodule-name.
check not wa_enlfdir-area is initial.
select single devclass into wa_tadir-devclass
from tadir where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name = wa_enlfdir-area.
check not wa_tadir-devclass is initial.
move wa_tadir-devclass to i_devclass-clas.
append i_devclass.
i_fmodule-done = 'X'.
modify i_fmodule.
endloop.
sort i_devclass.
delete adjacent duplicates from i_devclass.
endif.
endform. "GET_FM_DATA
& Form GET_SUBMIT_DATA &
form get_submit_data.
data selection message to sap gui
call function 'SAPGUI_PROGRESS_INDICATOR'
destination 'SAPGUI'
keeping logical unit of work
exporting
text = 'Get submit data' "#EC NOTEXT
exceptions
system_failure
communication_failure
. "#EC *
sort i_submit.
delete adjacent duplicates from i_submit comparing pname.
w_level = '0'.
loop at i_submit where done ne 'X'.
clear: i_stoken, i_sstmnt, sourcetab.
refresh: i_stoken, i_sstmnt, sourcetab.
read report i_submit-pname into sourcetab.
if sy-subrc = 0.
scan abap-source sourcetab tokens into i_stoken
statements into i_sstmnt
keywords from keywords
with includes.
if sy-subrc > 0.
message e130(enhancement) raising syntax_error.
continue.
endif.
check i_stoken for entries
clear w_linnum.
describe table i_stoken lines w_linnum.
if w_linnum gt 0.
w_prog = i_submit-pname.
w_incl = ''.
perform data_search tables i_stoken using w_level w_prog w_incl.
endif.
endif.
restrict number of submit program selected for processing
describe table i_submit lines w_linnum.
if w_linnum ge p_limit.
w_level = '1'.
endif.
i_submit-done = 'X'.
modify i_submit.
endloop.
endform. "GET_SUBMIT_DATA
& Form DATA_SEARCH &
form data_search tables p_stoken structure stoken
using p_level p_prog p_incl.
loop at p_stoken.
clear i_userexit.
tabix = sy-tabix + 1.
i_userexit-level = p_level.
if i_userexit-level = '0'.
if p_incl is initial.
i_userexit-pname = p_pname.
else.
concatenate p_pname '/' p_incl into i_userexit-pname.
endif.
else.
if p_incl is initial.
i_userexit-pname = p_prog.
else.
concatenate p_prog '/' p_incl into i_userexit-pname.
endif.
endif.
Include
if p_stoken-str eq 'INCLUDE'.
check p_level eq '0'. " do not perform for function modules
*(2nd pass)
w_index = sy-tabix + 1.
read table p_stoken index w_index into wa_stoken.
check not wa_stoken-str cs 'STRUCTURE'.
check not wa_stoken-str cs 'SYMBOL'.
read table i_submit with key pname = wa_stoken-str.
if sy-subrc <> 0.
i_submit-pname = wa_stoken-str.
i_submit-level = p_level.
append i_submit.
endif.
endif.
Enhancements
if p_stoken-str eq 'CUSTOMER-FUNCTION'.
clear w_funcname.
read table p_stoken index tabix.
translate p_stoken-str using ''' '.
condense p_stoken-str.
if p_prog is initial.
concatenate 'EXIT' p_pname p_stoken-str into w_funcname
separated by '_'.
else.
concatenate 'EXIT' p_prog p_stoken-str into w_funcname
separated by '_'.
endif.
select single member from modsap into wa_modsap-member
where member = w_funcname.
if sy-subrc = 0. " check for valid enhancement
i_userexit-type = 'Enhancement'.
i_userexit-txt = w_funcname.
append i_userexit.
else.
clear wa_d010inc.
select single master into wa_d010inc-master
from d010inc
where include = p_prog.
concatenate 'EXIT' wa_d010inc-master p_stoken-str into
w_funcname
separated by '_'.
i_userexit-type = 'Enhancement'.
i_userexit-txt = w_funcname.
endif.
endif.
BADIs
if p_stoken-str cs 'cl_exithandler='.
w_index = sy-tabix + 4.
read table p_stoken index w_index into wa_stoken.
i_userexit-txt = wa_stoken-str.
replace all occurrences of '''' in i_userexit-txt with space.
i_userexit-type = 'BADI'.
append i_userexit.
endif.
Business transaction events
if p_stoken-str cs 'OPEN_FI_PERFORM'.
i_userexit-type = 'BusTrEvent'.
i_userexit-txt = p_stoken-str.
replace all occurrences of '''' in i_userexit-txt with space.
i_userexit-modname = i_userexit-txt+16(8).
case i_userexit-txt+25(1).
when 'E'.
clear wa_tbe01t.
select single text1 into wa_tbe01t-text1 from tbe01t
where event = i_userexit-txt+16(8)
and spras = sy-langu.
if wa_tbe01t-text1 is initial.
i_userexit-modtext = ''. "#EC NOTEXT
else.
i_userexit-modtext = wa_tbe01t-text1.
endif.
i_userexit-modname+8 = '/P&S'. "#EC NOTEXT
when 'P'.
clear wa_tps01t.
select single text1 into wa_tps01t-text1 from tps01t
where procs = i_userexit-txt+16(8)
and spras = sy-langu.
i_userexit-modtext = wa_tps01t-text1.
i_userexit-modname+8 = '/Process'.
endcase.
append i_userexit.
endif.
Program exits
if p_stoken-str cs 'USEREXIT_'.
i_userexit-type = 'Program Exit'.
i_userexit-txt = p_stoken-str.
replace all occurrences of '''' in i_userexit-txt with space.
append i_userexit.
endif.
Submit programs
if p_stoken-str cs 'SUBMIT'.
check p_level eq '0'. " do not perform for function modules
*(2nd pass)
check not p_stoken-str cs '_'. " ensure not SUBMIT_XXX
w_index = sy-tabix + 1.
read table p_stoken index w_index into wa_stoken.
check not wa_stoken-str cs '_'. " ensure not SUBMIT_XXX
replace all occurrences of '''' in wa_stoken-str with space.
read table i_submit with key pname = wa_stoken-str.
if sy-subrc <> 0.
i_submit-pname = wa_stoken-str.
i_submit-level = p_level.
append i_submit.
endif.
endif.
Perform routines (which reference external programs)
if p_stoken-str cs 'PERFORM'.
check p_level eq '0'. " do not perform for function modules
*(2nd pass)
w_index = sy-tabix + 1.
read table p_stoken index w_index into wa_stoken.
if not wa_stoken-ovfl is initial.
w_off = wa_stoken-off1 + 10.
w_str = c_overflow+w_off(30).
find ')' in w_str match offset w_off.
w_off = w_off + 1.
wa_stoken-str = w_str(w_off).
endif.
check wa_stoken-str cs '('.
w_off = 0.
while sy-subrc = 0.
if wa_stoken-str+w_off(1) eq '('.
replace section offset w_off length 1 of wa_stoken-str with ''
replace all occurrences of ')' in wa_stoken-str with space.
read table i_submit with key pname = wa_stoken-str.
if sy-subrc <> 0.
i_submit-pname = wa_stoken-str.
append i_submit.
endif.
exit.
else.
replace section offset w_off length 1 of wa_stoken-str with ''
shift wa_stoken-str left deleting leading space.
endif.
endwhile.
endif.
Function modules
if p_stoken-str cs 'FUNCTION'.
clear i_fmodule.
check p_level eq '0'. " do not perform for function modules
*(2nd pass)
w_index = sy-tabix + 1.
read table p_stoken index w_index into wa_stoken.
if wa_stoken-str cs 'WF_'.
if wa_stoken-str cs 'IF_'.
break-point.
endif.
if wa_stoken-str cs 'BAPI'.
i_fmodule-bapi = 'X'.
endif.
replace first occurrence of '''' in wa_stoken-str with space.
replace first occurrence of '''' in wa_stoken-str with space.
if sy-subrc = 4. " didn't find 2nd quote (ie name truncated)
clear wa_tfdir.
concatenate wa_stoken-str '%' into wa_stoken-str.
select single funcname into wa_tfdir-funcname from tfdir
where funcname like wa_stoken-str.
if sy-subrc = 0.
i_fmodule-name = wa_tfdir-funcname.
else.
continue.
endif.
else.
i_fmodule-name = wa_stoken-str.
endif.
i_fmodule-level = p_level.
append i_fmodule.
endif.
endloop.
endform. "DATA_SEARCH
& Form GET_ADDITIONAL_DATA &
form get_additional_data.
data selection message to sap gui
call function 'SAPGUI_PROGRESS_INDICATOR'
destination 'SAPGUI'
keeping logical unit of work
exporting
text = 'Get additional data' "#EC NOTEXT
exceptions
system_failure
communication_failure
. "#EC *
loop at i_userexit.
Enhancement data
if i_userexit-type cs 'Enh'.
clear: wa_modsapa.
select single name into wa_modsapa-name from modsap
where member = i_userexit-txt.
check sy-subrc = 0.
i_userexit-modname = wa_modsapa-name.
clear wa_modsapt.
select single modtext into wa_modsapt-modtext from modsapt
where name = wa_modsapa-name
and sprsl = sy-langu.
i_userexit-modtext = wa_modsapt-modtext.
endif.
BADI data
if i_userexit-type eq 'BADI'.
clear wa_sxs_attr.
select single exit_name into wa_sxs_attr-exit_name from sxs_attr
where exit_name = i_userexit-txt.
if sy-subrc = 0.
i_userexit-modname = i_userexit-txt.
else.
i_userexit-modname = 'Dynamic call'. "#EC NOTEXT
endif.
clear wa_sxs_attrt.
select single text into wa_sxs_attrt-text from sxs_attrt
where exit_name =
wa_sxs_attr-exit_name
and sprsl = sy-langu.
i_userexit-modtext = wa_sxs_attrt-text.
endif.
modify i_userexit.
endloop.
get enhancements via program package
clear wa_tadir.
select single devclass into wa_tadir-devclass from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = p_pname.
if sy-subrc = 0.
clear: wa_modsapa, wa_modsapt.
select name from modsapa into wa_modsapa-name
where devclass = wa_tadir-devclass.
select single modtext from modsapt into wa_modsapt-modtext
where name = wa_modsapa-name
and sprsl = sy-langu.
read table i_userexit with key modname = wa_modsapa-name.
if sy-subrc <> 0.
i_userexit-modtext = wa_modsapt-modtext.
i_userexit-type = 'Enhancement'. "#EC NOTEXT
i_userexit-modname = wa_modsapa-name.
i_userexit-txt = 'Determined from program DevClass'."#EC NOTEXT
i_userexit-pname = 'Unknown'. "#EC NOTEXT
append i_userexit.
endif.
endselect.
endif.
endform. "GET_ADDITIONAL_DATA
& Form DATA_DISPLAY &
form data_display.
data selection message to sap gui
call function 'SAPGUI_PROGRESS_INDICATOR'
destination 'SAPGUI'
keeping logical unit of work
exporting
text = 'Prepare screen for display' "#EC NOTEXT
exceptions
system_failure
communication_failure
. "#EC *
sort i_userexit by type txt modname.
delete adjacent duplicates from i_userexit comparing txt modname.
format headings
write: 'Enhancements from main program'. "#EC NOTEXT
write: /.
uline.
format color col_heading.
write: / sy-vline,
(12) c_col1, "Enhanmt Type
sy-vline,
(40) c_col2, "Enhancement
sy-vline,
(30) c_col3, "Program/Include
sy-vline,
(20) c_col4, "Enhancement name
sy-vline,
(40) c_col5, "Enhancement description
sy-vline.
format reset.
uline.
format lines
loop at i_userexit.
set line colour
case i_userexit-type.
when 'Enhancement'.
format color 3 intensified off.
when 'BADI'.
format color 4 intensified off.
when 'BusTrEvent'.
format color 5 intensified off.
when 'Program Exit'.
format color 6 intensified off.
when others.
format reset.
endcase.
write: / sy-vline,
i_userexit-type,
sy-vline,
i_userexit-txt(40),
sy-vline,
i_userexit-pname(30),
sy-vline,
i_userexit-modname(20),
sy-vline,
i_userexit-modtext(40),
sy-vline.
endloop.
format reset.
uline.
user-exits from development class of function modules
if p_devc = 'X'.
write: /.
write: / 'User-exits from function module development class'."#EC
*NOTEXT
write: 157''.
uline (90).
write: 157''.
loop at i_devclass.
clear wa_modsapa.
select name from modsapa into wa_modsapa
where devclass = i_devclass-clas.
select single name modtext into corresponding fields of wa_modsapt
from modsapt
where name = wa_modsapa-name
and sprsl = sy-langu.
format color 3 intensified off.
write: / sy-vline,
(12) 'Enhancement',
sy-vline,
wa_modsapa-name,
sy-vline,
wa_modsapt-modtext,
sy-vline.
endselect.
endloop.
uline (90).
format reset.
endif.
describe table i_fmodule lines w_linnum.
write: / c_fmod , at 35 w_linnum. "#EC NOTEXT
write: 157''.
if p_func = 'X'.
display fuction modules used in program
uline (38).
write: 157''.
loop at i_fmodule.
write: sy-vline,
i_fmodule-name,
sy-vline,
i_fmodule-bapi,
sy-vline.
write: 157''.
endloop.
uline (38).
endif.
describe table i_submit lines w_linnum.
write: / c_subm , at 35 w_linnum. "#EC NOTEXT
write: 157''.
if p_subm = 'X'.
display submit programs used in program
uline (44).
write: 157''.
loop at i_submit.
write: sy-vline,
i_submit-pname,
sy-vline.
write: 157''.
endloop.
uline (44).
endif.
issue message with number of user-exits displayed
describe table i_userexit lines w_linnum.
message s697(56) with w_linnum.
endform. "DATA_DISPLAY
reward points if it helps
gunjan -
Needed a code for Creating a Log File in java so that its size is limited
Hi
I need the code for developing a log file using threads so that the log file size is limited
and if the size of the log file is increasing above 1Mb,another log file has to be created automatically and the log have to be printed into that new file.
Thanks in advancepackage cms.web.log;
import java.io.*;
import java.util.Calendar;
import cms.web.WebUser;
* Log is generated by JEditor 1.0.0
* @Project : cms
* @Version : 1.0.0
* @Created date : 11:07:40 PM Thursday, 25/07/2002
* @Author :
* @Organization :
* @Copyright : (c) 2002
* An utility class used to write information, especially error messages, to
* log file so that they can be viewed at later time by administrators.
* Extra information such as date & time they occures & where they are thrown...
* are automatically included and append to the end of log file.
* Log files will increase with the format "name_n" where n is file counter
public class Log implements Serializable
* logs marker
static final String START= "\n\0";
* parent directory that contains log files
private static File parent;
private PrintStream out;
private String name;
* to count how many log for the current stream
int counter;
* maximum number of logs for each log file
int max;
public static void init(File parent)
if (!parent.exists())
parent.mkdirs();
Log.parent= parent;
public Log(String name, int max)
this.name= name;
this.max= max;
file= getLastFile();
counter= countLogs(file);
out= openStream(file);
public synchronized void appendLog(String log)
if (log == null || log.length() == 0)
return;
count();
try {
out.println(START+ counter+ " | "+ getCurrentTime()+ " | "+ log);
out.flush();
} catch (Exception e) {}
* Append the given log to log file.
synchronized void appendLog(String msg, WebUser user)
if (msg == null || msg.length() == 0)
return;
count();
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println(getCurrentTime());
out.println(user != null? "User:"+ user.getFullName(): "User: public user");
out.println(msg);
out.println("\n----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
* Append the given exception to log file
synchronized void appendLog(Throwable error, WebUser user)
if (error == null)
return;
count();
synchronized (out)
try {
out.println(START+ counter+ "----------------------------------------------------------");
out.println("Exception occured at "+ getCurrentTime());
out.println(user != null? "User: "+ user.getFullName(): "User: public user");
error.printStackTrace(out);
out.println("----------------------------- end -----------------------------\n");
out.flush();
} catch (Exception e) {}
private String getCurrentTime()
Calendar c= Calendar.getInstance();
return
parse(c.get(Calendar.HOUR_OF_DAY))+ ":"+ // 0 --> 23
parse(c.get(Calendar.MINUTE))+ ":"+ // 0 --> 59
parse(c.get(Calendar.SECOND))+ " "+ // 0 --> 59
parse(c.get(Calendar.DAY_OF_MONTH))+ "/"+ // 1 --> 31
parse(c.get(Calendar.MONTH)+ 1)+ "/"+ // 1 --> 12
c.get(Calendar.YEAR); // yyyy
private String parse(int n)
return n< 10? "0"+ n: ""+ n;
private void count()
counter++;
if (counter> max)
incrementFile();
counter= 1;
private void incrementFile()
File file= null;
int n= 0;
while ((file= new File(parent, name+ n+ ".log")).exists())
n++;
if (out != null)
out.close();
out= openStream(file);
private PrintStream openStream(File file)
try {
if (file.exists())
return new PrintStream(new FileOutputStream(file.getPath(), true));
else
return new PrintStream(new FileOutputStream(file.getPath()));
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
private int countLogs(File file)
int count= 0;
InputStream in= null;
try {
in= new FileInputStream(file);
int n;
while ((n= in.read()) != -1)
if (n == '\0')
count++;
} catch (IOException e) {
} finally {
if (in != null)
try {
in.close();
} catch (IOException e) {}
return count;
private File getLastFile()
File file= new File(parent, name+ "0.log");
File curr;
int n= 1;
while ((curr= new File(parent, name+ n+ ".log")).exists())
file= curr;
n++;
return file;
protected void finalized()
if (out != null)
out.close(); -
Do you need antivirus software for Macs?
Hi there,
I purchased a new iMac yesterday, and I was wondering if I need antivirus software for it? Thanks!There are two trains of thought here. Ultimately you'll need to decide which one fits you and your usage.
In general, there are no true viruses on Mac OS X - that is, no software that can just infect your machine and self-replicate without any user involvement.
However, that's not to say that malware doesn't exist. There are several known trojans on Mac OS X - software that's advertised to do one thing but actually doesn't something else (generally malicious) behind the scenes. These applications typically use some social-engineering or other guise to fool you into thinking they're legitimate - for example, you might visit a web site that pops up a message saying you need a certain software update in order to access the site, along with a link to 'conveniently' install that software, only to find it's installing something completely different.
The difference here is that trojan applications like this require some kind of user input and usually require you to authenticate your username and password in order to install. If you only install trusted software and are smart about knowing when you should/should not need to enter your password then you're pretty immune from such tricks. If there are multiple users on the machine (especially if they all have admin access), this problem becomes compounded since it only takes one person to let down their guard.
Then, there's the third class of malware in which your machine becomes a vehicle for viruses, even if you're not affected yourself. A classic example here is email and/or distributing software that gets opened on othe platforms. For example, if you recieve a document that's infected with a Windows virus, it can and will do nothing on your machine. However, if you then forward that document to other users, they may open it thinking it's trusted (it came from someone they know), only to find it infects their machine.
This kind of problem is more prevalent in mixed-platform corporate environments, and is exascerbated when you consider that things like Microsoft Word documents and PDF files have been carriers of this kind of malware in the past.
A good anti-virus application would detect and identify these kinds of malware, even though they cannot affect your machine itself.
So, do you need anti-virus? Probably not if you're careful and don't share much content with other users (especially other users on other platforms). However, there's generally little downside to doing so. -
Hi all,
can anybody tell me how to get the result of the following query by using cursor?
SELECT (SUBSTR(' ', 1,LEVEL*2)
|| t1.label) AS t1_label,
amount
FROM
(SELECT t1.label,
t1.ID,
t1.parent_id,
SUM(t2.turnover) AS amount
FROM t1,
t2
WHERE t2.t1_id = t1.id
AND t2.t1_id IN
(SELECT id
FROM t1
START WITH t1.ID = 2
CONNECT BY PRIOR t1.ID = t1.parent_id
GROUP BY t1.label, t1.ID, t1.parent_id
) t1
START WITH t1.ID = 2
CONNECT BY PRIOR t1.ID = t1.parent_id;...and the result:
t1_label amount
B11 11778.54
B121 19980.28
B1211 18842.77
B1212 25480.56
B122 18339.07
B12 23455.9
B13 20876.52Thanks,
Alex
Edited by: 860003 on Jun 9, 2011 1:30 AM
Edited by: 860003 on Jun 9, 2011 1:31 AM
Edited by: 860003 on Jun 9, 2011 1:31 AM860003 wrote:
Is not that i don't want to use hierarchy queries, but find others ways, tricks to reach the result needed. I just want to explore different ways that Oracle provides to resolve issues.Not a problem with that in principle.
Maybe using "loop, if-else, for" will provide us with an elegant way to get the result. However, a problem in principle with this. SQL and PL/SQL are not the same thing. Two separate and very different languages.
In PL/SQL, you can code both PL and SQL - so you can write source code of 2 different language and mix these. The PL/SQL parser is clever enough to figure out what is what and glues the code seamlessly and transparently together.
SQL is used to crunch SQL data. PL/SQL sucks at this in comparison (and Java/.Net sucks a heck of a lot worse at this). Cursor fetch loops? Bulk processing. Neat. But will always be slower than running that data crunching in SQL only.
That is why there is a simple maxim for performance in Oracle: Maximise SQL. Minimise PL/SQL.
Do not use PL/SQL to do what the SQL is perfectly able and capable of doing. The exception is when the processing is too complex for SQL to handle and you need the programming logic part of the PL/SQL language.
My question is how to use this cursor to get the value, fetch it and then get another value(ofc only for the children) and fetch it again so i can output it? I thing this can be achieve but don't know how.All SQLs (and anonymous PL/SQL) are parsed and cursors are created. A cursor is a basically a set of instructions (as seen via execution plans) of how to get the job done. Think of cursors as programs that are executed and output data.
So do you want t create a bunch of cursors (programs) and then call these from PL/SQL, consume their output, create/call new cursor programs and repeat?
Or do you want to create a single cursor program that does the job and outputs the required results?
Maximise SQL. Minimise PL/SQL. -
Seriously need an Undo for assigning keywords... a couple of times now when in a Smartalbum showing various keywords, somehow I have managed to assign a new keyword to all photos, which mixes them up with other ones, and I have to manually go through them all again to remove the keyword as there is no "undo" when you assign the keywords.
ThanksThanks, have submitted it as a bug report, I cant think of the issue as anything else. Although I tend to prefer forums over bug reports/feature requests, I dont think in my life I have ever had any positive outcome when contacting large companies with bugs or feature requests. Usually the community provide much better support!
Maybe you are looking for
-
I bought this phone on ebay and it's still in great condition, charged up quickly, and seems to be working fine except for this one thing. I factory reset it and plugged it into my Mac and nothing happened. No charging sound - nothing. I contacted
-
Need Advice on Creating Multi-Language Menus
Hello Friends, I am working on a documentary project that will contain three languages: English, Spanish, German, and Portuguese. There are two spoken-language audio tracks (English and Spanish) and four subtitle tracks (one for each of the above lan
-
Workitem stays in InProcess state
Hi Everybody, I have created a custom workflow to send mail with PDF as attachment.I have an activity step which is creates calls the method of my custom BO and in the method I am calling a function module wherein I have all the code to Create a smar
-
Quicktime Settings are saved ...Where?
Greetings, anyone know where the Quicktime control panel applet saves it's settings? I have Quicktime player installed on XP Pro machines. Latest SPacks and updates applied. In Win2003Domain, and users have mandatory profiles and run at user level. P
-
Apple TV not responding-Port 3689
I have been syncing with my Apple TV for almost 2 years. My only recent changes have been the upgrade to Snow Leopard. When I tried to sync today and clicked on the more info I received the following response: Once you have synced or paired the Apple