Help in Optimizing code
Hello experts, I have a function module that runs so slow, I just want to seek some advice to help me have a better performance speed what can I used and alternatives to make my codes faster... any advice can help
Heres my <b> code </b>
<b>Declaration</b>
FUNCTION-POOL YXBW_0PRODORDER_ATTR. "MESSAGE-ID ..
TYPE-POOLS: RSAP, RSSG, SRSC, SRSD, RSAOT, RSFH.
DATA: ippord_bw LIKE ppord_bw.
DATA : itabix LIKE sy-tabix.
DATA : V_OBJNR LIKE JEST-OBJNR.
DATA : BEGIN OF i_data_temp OCCURS 0.
INCLUDE STRUCTURE ppord_bw.
DATA : END OF i_data_temp.
data: begin of i_jest_obj occurs 0,
objnr like jest-objnr,
end of i_jest_obj.
*TYPES Declaration *
TYPES : BEGIN OF t_afpo,
aufnr LIKE afpo-aufnr, "Order Number
plnum LIKE afpo-plnum, "Planned order number
psamg LIKE afpo-psamg, "Scrap quantity in item
psmng LIKE afpo-psmng, "Order item quantity
wemng LIKE afpo-wemng, "Quantity of goods for the order item
amein LIKE afpo-amein, "Unit of measure for in-house production
meins LIKE afpo-meins, "Base unit of measure
pamng LIKE afpo-pamng, "Fixed quantity of scrap from production
pgmng LIKE afpo-pgmng, "Total planned order quantity
ablad LIKE afpo-ablad, "Unloading point
END OF t_afpo.
TYPES: BEGIN OF t_afko,
aufnr LIKE afko-aufnr, "Order Number
gltrp LIKE afko-gltrp, "Basic finish date
gstrp LIKE afko-gstrp, "Basic start date
ftrms LIKE afko-ftrms, "Scheduled release date
gltrs LIKE afko-gltrs, "Scheduled finish
gstrs LIKE afko-gstrs, "Scheduled start
gstri LIKE afko-gstri, "Actual start date
gltri LIKE afko-gltri, "Actual finish date
ftrmi LIKE afko-ftrmi, "Actual release date
gmein LIKE afko-gmein, "Base unit of measure
plnty LIKE afko-plnty, "Task list type
plnnr LIKE afko-plnnr, "Key for task groupKey
plnal LIKE afko-plnal, "Group counter
aufld LIKE afko-aufld, "Date of BOM routing transfer
aufpl LIKE afko-aufpl,"Routing number for operations
igmng LIKE afko-igmng, "Yield confirmed order confirmation
iasmg LIKE afko-iasmg, "Scrap confirmed for order
END OF t_afko.
TYPES: BEGIN OF t_afvc,
aufpl LIKE afvc-aufpl, "Routing number for operations order
arbid LIKE afvc-arbid, "Object ID of the resource
END OF t_afvc.
TYPES: BEGIN OF t_zbw_afvv_c,
aufpl LIKE zbw_afvv_c-aufpl, "Routing number
ism03 LIKE zbw_afvv_c-ism03, "Previously confirmed activity
ile03 LIKE zbw_afvv_c-ile03, "Unit of measure
vgw02 LIKE zbw_afvv_c-vgw02, "Standard value
vge02 LIKE zbw_afvv_c-vge02, "Unit of measure standard value
isdd LIKE zbw_afvv_c-isdd, "Actual start: Execution (date)
isdz LIKE zbw_afvv_c-isdz, "Actual start: Execution (time)
END OF t_zbw_afvv_c.
TYPES: BEGIN OF t_CRHD,
objid LIKE crhd-objid, "Object ID of the resource
arbpl LIKE crhd-arbpl, "Work Center
END OF t_CRHD.
TYPES: BEGIN OF t_jest,
objnr LIKE jest-objnr, "Object Number
stat LIKE jest-stat, "Status
END OF t_jest.
*Internal Table Declaration *
DATA: i_afpo TYPE STANDARD TABLE OF t_afpo,
wa_afpo TYPE t_afpo,
i_afko TYPE STANDARD TABLE OF t_afko,
wa_afko TYPE t_afko,
i_afvc TYPE STANDARD TABLE OF t_afvc,
wa_afvc TYPE t_afvc,
i_afvc_d TYPE STANDARD TABLE OF t_afvc,
wa_afvc_d TYPE t_afvc,
i_jest TYPE STANDARD TABLE OF t_jest,
wa_jest TYPE t_jest,
i_zbw_afvv_c TYPE STANDARD TABLE OF t_zbw_afvv_c,
wa_zbw_afvv_c TYPE t_zbw_afvv_c,
i_CRHD TYPE STANDARD TABLE OF t_CRHD,
wa_CRHD TYPE t_CRHD.
<b>Actual Code</b>
i_data_temp[] = i_t_data[].
IF i_data_temp[] IS INITIAL.
RAISE rsap_customer_exit_error.
EXIT.
ELSE.
retrieves values of appended fields from afpo table
SELECT aufnr "Order Number
plnum "Planned order number
psamg "Scrap quantity in item
psmng "Order item quantity
wemng "Quantity of goods for the order item
amein "Unit of measure for in-house production
meins "Base unit of measure
pamng "Fixed quantity of scrap from production
pgmng "Total planned order quantity
ablad "Unloading point
FROM afpo
INTO TABLE i_afpo
FOR ALL ENTRIES IN i_data_temp
WHERE aufnr = i_data_temp-aufnr.
IF sy-subrc = 0.
ENDIF.
retrieves values of appended fields and aufpl from afko table that
will be used as a look up in table afvv
SELECT aufnr "Order Number
gltrp "Basic finish date
gstrp "Basic start date
ftrms "Scheduled release date
gltrs "Scheduled finish
gstrs "Scheduled start
gstri "Actual start date
gltri "Actual finish date
ftrmi "Actual release date
gmein "Base unit of measure
plnty "Task list type
plnnr "Key for task groupKey
plnal "Group counter
aufld "Date of BOM routing transfer
aufpl "Routing number for operations
igmng "Yield confirmed order confirmation
iasmg "Scrap confirmed for order
FROM afko
INTO TABLE i_afko
FOR ALL ENTRIES IN i_afpo
WHERE aufnr = i_afpo-aufnr.
IF sy-subrc = 0.
ENDIF.
loop at i_data_temp.
CONCATENATE 'OR' i_data_temp-aufnr into i_jest_obj-objnr.
append i_jest_obj.
endloop.
retrieves appended fields from afvv table
SELECT aufpl "Routing number
ism03 "Previously confirmed activity
ile03 "Unit of measure
vgw02 "Standard value
vge02 "Unit of measure standard value
isdd "Actual start: Execution (date)
isdz "Actual start: Execution (time)
FROM zbw_afvv_c
INTO TABLE i_zbw_afvv_c
FOR ALL ENTRIES IN i_afko
WHERE aufpl = i_afko-aufpl.
IF sy-subrc = 0.
ENDIF.
retrieves ARBID from afvc table that will be used as a lookup in CHRD
table to get the workcenter
SELECT aufpl "Routing number for operations order
arbid "Object ID of the resource
FROM afvc
INTO TABLE i_afvc
FOR ALL ENTRIES IN i_afko
WHERE aufpl = i_afko-aufpl.
IF sy-subrc = 0.
ENDIF.
retrieves Work Center based on the arbid selected from afvc table
SELECT objid "Object ID of the resource
arbpl " Work Center
FROM crhd
INTO TABLE i_crhd
FOR ALL ENTRIES IN i_afvc
WHERE objid = i_afvc-arbid.
IF sy-subrc = 0.
ENDIF.
SELECT objnr "Object Number
stat "Status
FROM jest
INTO TABLE i_jest
for all entries in i_jest_obj
where objnr = i_jest_obj-objnr
AND ( stat EQ 'I0045' OR stat EQ 'I0076' OR stat EQ 'I0012' ).
IF SY-SUBRC = 0.
ENDIF.
ENDIF.
MAIN PROCESSING *****
i_afvc_d[] = i_afvc[].
SORT i_afvc BY aufpl ASCENDING.
SORT i_afvc_d BY aufpl DESCENDING.
SORT : i_afko BY aufnr,
i_afpo BY aufnr,
i_zbw_afvv_c BY aufpl.
LOOP AT i_t_data INTO ippord_bw.
itabix = sy-tabix.
clears work area
CLEAR: wa_afpo,
wa_afko,
wa_afvc,
wa_zbw_afvv_c,
wa_crhd.
read internal table i_afpo
READ TABLE i_afpo INTO wa_afpo
WITH KEY aufnr = ippord_bw-aufnr.
IF sy-subrc = 0.
ippord_bw-zzwemng = wa_afpo-wemng.
ippord_bw-zzamein = wa_afpo-amein.
ippord_bw-amein = wa_afpo-amein.
ippord_bw-zzpsamg = wa_afpo-psamg.
ippord_bw-zzpgmng = wa_afpo-pgmng.
ippord_bw-zzpamng = wa_afpo-pamng.
ippord_bw-zzpsmng = wa_afpo-psmng.
ippord_bw-psmng = wa_afpo-psmng.
ippord_bw-zzmeins = wa_afpo-meins.
ippord_bw-zzplnum = wa_afpo-plnum.
ippord_bw-zzablad = wa_afpo-ablad.
ENDIF.
read internal table i_afko
READ TABLE i_afko INTO wa_afko
WITH KEY aufnr = ippord_bw-aufnr.
IF sy-subrc = 0.
ippord_bw-zzftrms = wa_afko-ftrms.
ippord_bw-zzgstri = wa_afko-gstri.
ippord_bw-zzftrmi = wa_afko-ftrmi.
ippord_bw-zzgstrp = wa_afko-gstrp.
ippord_bw-zziasmg = wa_afko-iasmg.
ippord_bw-zzigmng = wa_afko-igmng.
ippord_bw-zzgmein = wa_afko-gmein.
ippord_bw-zzplnnr = wa_afko-plnnr.
ippord_bw-zzplnty = wa_afko-plnty.
ippord_bw-zzplnal = wa_afko-plnal.
ippord_bw-zzaufld = wa_afko-aufld.
ippord_bw-zzgltrs = wa_afko-gltrs.
ippord_bw-zzgstrs = wa_afko-gstrs.
ippord_bw-zzgltri = wa_afko-gltri.
ippord_bw-zzgltrp = wa_afko-gltrp.
read internal table i_afvv
READ TABLE i_zbw_afvv_c INTO wa_zbw_afvv_c
WITH KEY aufpl = wa_afko-aufpl.
IF sy-subrc = 0.
ippord_bw-ism03 = wa_zbw_afvv_c-ism03.
ippord_bw-ile03 = wa_zbw_afvv_c-ile03.
ippord_bw-vgw02 = wa_zbw_afvv_c-vgw02.
ippord_bw-vge02 = wa_zbw_afvv_c-vge02.
ippord_bw-isdd = wa_zbw_afvv_c-isdd.
ippord_bw-isdz = wa_zbw_afvv_c-isdz.
ENDIF.
*Pull first resource
READ TABLE i_afvc INTO wa_afvc
WITH KEY wa_zbw_afvv_c-aufpl.
IF sy-subrc = 0.
READ TABLE i_crhd INTO wa_crhd
WITH KEY objid = wa_afvc-arbid.
IF sy-subrc = 0.
ippord_bw-zzarbpl1 = wa_crhd-arbpl.
ENDIF. "read i_crhd
ENDIF. "read i_afvc
*Pull last resource
CLEAR: wa_afvc_d,
wa_crhd.
READ TABLE i_afvc_d INTO wa_afvc_d
WITH KEY wa_zbw_afvv_c-aufpl.
IF sy-subrc = 0.
READ TABLE i_crhd INTO wa_crhd
WITH KEY objid = wa_afvc_d-arbid.
IF sy-subrc = 0.
ippord_bw-zzarbpl2 = wa_crhd-arbpl.
ENDIF. "read i_crhd
ENDIF. "read i_afvc
ENDIF. "read i_afko
CLEAR v_objnr.
READ TABLE i_data_temp INDEX itabix.
SHIFT i_data_temp-aufnr LEFT BY 5 PLACES.
CONCATENATE 'OR00000' i_data_temp-aufnr INTO v_objnr.
TECO Status
READ TABLE i_jest INTO wa_jest
WITH KEY objnr = v_objnr
stat = 'I0045'.
IF sy-subrc = 0.
ippord_bw-zzteco = 'X'.
ENDIF.
Deletion Flag Status
READ TABLE i_jest INTO wa_jest
WITH KEY objnr = v_objnr
stat = 'I0076'.
IF sy-subrc = 0.
ippord_bw-zzdlfl = 'X'.
ENDIF.
Delivered Status
READ TABLE i_jest INTO wa_jest
WITH KEY objnr = v_objnr
stat = 'I0012'.
IF sy-subrc = 0.
ippord_bw-zzdlv = 'X'.
ENDIF.
MODIFY i_t_data FROM ippord_bw INDEX itabix.
ENDLOOP.
refreshes content of internal table
REFRESH: i_data_temp,
i_afko,
i_afpo,
i_afvc,
i_afvc_d,
i_jest,
i_zbw_afvv_c.
frees up the memory space containing the internal table
FREE: i_data_temp,
i_afko,
i_afpo,
i_afvc,
i_afvc_d,
i_jest,
i_crhd.
Also this select could be improved:
* retrieves Work Center based on the arbid selected from afvc table
SELECT objid "Object ID of the resource
arbpl " Work Center
FROM crhd
INTO TABLE i_crhd
FOR ALL ENTRIES IN i_afvc
WHERE objid = i_afvc-arbid.
IF sy-subrc = 0.
ENDIF.
Try:
* retrieves Work Center based on the arbid selected from afvc table
SELECT objid "Object ID of the resource
arbpl " Work Center
FROM crhd
INTO TABLE i_crhd
FOR ALL ENTRIES IN i_afvc
<b>WHERE OBJTY in ('A', 'AA', 'FH', 'H')</b>
WHERE objid = i_afvc-arbid.
IF sy-subrc = 0.
ENDIF.
Similar Messages
-
Plz help in optimizing the query
I have a query which is written to cater to the scenario that the entered start and end date do not overlap with the start and end date already present in the database records. Can someone help in optimizing this query. all inclusion and exclusion scenario's have to be taken care of.
the query is as follows:
SELECT COUNT(*) FROM CLAS WHERE TRIM(UPPER(CLAS_CDE)) =UPPER('timecheck') AND TRIM(UPPER(CLAS_TYPE_CDE))=UPPER('TEST_3')
AND TRIM(UPPER(LANG_CDE))=UPPER('en')
AND (
(END_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR
(START_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR (
(START_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
AND
(END_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR(('09/13/2007' BETWEEN TO_CHAR(START_DT,'MM/DD/YYYY') AND TO_CHAR(END_DT,'MM/DD/YYYY'))
AND ('09/15/2007' BETWEEN TO_CHAR(START_DT,'MM/DD/YYYY') AND TO_CHAR(END_DT,'MM/DD/YYYY'))
);I format your code in different way:
SELECT COUNT(*)
FROM CLAS
WHERE TRIM(UPPER(CLAS_CDE)) = UPPER('timecheck')
AND TRIM(UPPER(CLAS_TYPE_CDE))=UPPER('TEST_3')
AND TRIM(UPPER(LANG_CDE))=UPPER('en')
AND (
(END_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR
(START_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR (
(START_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
AND
(END_DT BETWEEN TO_DATE('09/13/2007','MM/DD/YYYY') AND TO_DATE('09/15/2007','MM/DD/YYYY'))
OR (
('09/13/2007' BETWEEN TO_CHAR(START_DT,'MM/DD/YYYY') AND TO_CHAR(END_DT,'MM/DD/YYYY'))
AND
('09/15/2007' BETWEEN TO_CHAR(START_DT,'MM/DD/YYYY') AND TO_CHAR(END_DT,'MM/DD/YYYY'))
);First thought that cross my mind it to check if changing this:
UPPER('timecheck') to simple:
'TIMECHECK' and do the same with other expressions with UPPER function.
Peter D. -
Search help for material code in VA01
Dear Experts,
In VA01 tcode in item level if user press f4 in the material code then we will get all the f4 helps for few fields.Now i need to add one more field mtart from mara table in the existing search help of material code.
plz suggest me how can i proceed.
If u have any documets regarding adding one more fied to existing search help plz send me.
Thanks & Regards,
farook.
Edited by: farook shaik on Aug 18, 2009 8:58 AMHi,
You can do that using search help exits you would find several threads already posted to the forum for this like below:
Link[Search Help Exits|Search Help Exit;
Regards,
Himanshu -
Help with html code - inserting video into Muse
I am seeking help writing the code to insert a video into Muse. I uploaded video into my Business Catalyst hosting. I need it to autoplay, loop and not show any controls or frames.
When I host video on Vimeo or YouTube, I see markings on the video that is why I am trying to just host in the same place that the files are stored for my website. If there is a way to host on youtube with out any markings showing up on the video I would be open to that too.
I don't want to see any play button or time bar.
Thanks in advance!!Hello,
Just as an FYI - we also have an HTML5 video tool over at MuseThemes.com that achieves this, but works on mobile devices as well. The link above looks like it uses Flash, which isn't common anymore since the release of HTML5 based video.
Simply drag the widget out onto your canvas, and link up your videos / set options like loop, controls visible, etc. It's quite a flexible widget, and there's a complete training video included so you don't get stuck
Check out the widget here
Just wanted to provide another alternative that could be helpful. Cheers!
Steve Harris
MuseThemes.com -
Need help in optimizing the process
I need help in optimizing my process. Here is what am I doing:
I have two tables table A and table B. table A has list of names and table B has name and ID. Right now I am loading name into cursor from table A and for each name from the cursor I try to match with name in table B to get the ID. This process takes very long to complete. I need help to replace PL/SQL with SQL if possible. I am using oracle utl_match to match the best possible record in table B. table B sometimes returns multiple matching records. I take the top nearest match name and ID for my use (there is not always one to one match)
Any idea or help will be appreciated. Thanksalways provide create table and sample data instert statements when asking a question. also, provide your database version.
because you're using utl_match, you can't really use an index, there must be a cartesian join on the two tables so it may always be slow.
however, here's a sample SQL that you may be able to make use of:
with n as (select 'KATHERINE' person_name from dual
union all
select 'STEVE' from dual
union all
select 'BRUCE' from dual)
,nid as (select 'CATHERINE' person_name, 1 NID FROM DUAL
union all
select 'STEFAN', 2 from dual
UNION ALL
select 'STEVEN', 2 from dual
union all
select 'CATHY',3 from dual)
select n_name, nid
from (
select n.person_name N_NAME
,nid.person_name
,nid.nid
,ROW_NUMBER() OVER (partition by n.person_name ORDER BY utl_match.jaro_winkler_similarity(n.person_name,nid.person_name) DESC) jws_ORDER
from n
join nid on (utl_match.jaro_winkler_similarity(n.person_name,nid.person_name) > 70)
where jws_order = 1; -
Need help in transcation code ime0
I need help in transaction code ime0. I mean to say what is this TCode doing? What different Drill-down program means? Where I can use this report?
Regards,
SubhasishHi
Please check the link for help
<a href="http://help.sap.com/saphelp_47x200/helpdata/EN/5c/8db33f555411d189660000e829fbbd/frameset.htm">CA - Drilldown Reporting</a>
Hope it helps
Anirban -
OWB 10.1 generates wrong code if Optimized Code is set to true
We have upgraded OWB 9.2 to 10.1 (up to Patchlevel 10.1.0.5) because of the database upgrade from 9 to 10.2. We want to migrate later to OWB 10.2. soon but for now we have to work with 10.1 .
If we switch "Optimized Code" to true, the generated code is partly wrong. Some columns are not inserted correctly. For instance owb generate "SPLITTER_INPUT_SUBQUERY"."BGRKZ$4" but correct was "SPLITTER_INPUT_SUBQUERY$0"."BGRKZ$4". He ommits $0. The problem can only corrected if the relevant column will be deleted in the mapping and reinserted. But we have 400 Mappings. Does anybody know a workaround for this problem?
Thanks in advance
AlexDon't switch to the "Optimized Code" :-)
-
Search help and Match code oject
How to create the search help in version 5.0 and 6.0 ? what is elementary search help,collective search help? what is the use of these search helps? where we use elementary and collective searsc helps? what is the difference between searc help and match code object? how to use in reports?where we use search help and F4IF_INT_TABLE_VALUE_REQUEST function module? what is the diffference between them?
Hi Rk,
1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).
2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.
3)An elementary search help defines the standard flow of an input help.
4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.
5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.
6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.
CREATION:
Go to SE11 Tcode
select search help
give the 'z' search help name and create
select the selection method ur table name eg : 'mara'
dialog module 'display value immediately'.
add the field whatever u want and lpos = 1 and spos = 1 and check import and export parameter.
where left position when displaying and spos = search position
and then save and activate ..
See the links:
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee38446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee45446011d189700000e8322d00/content.htm
pls go through this for search help creation
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
Search Help Exits:
Re: dynamic values for search help
Re: Dynamic search help
Thanks,
Reward If Helpful. -
Can you help with the code to publish Flash to my own domain.
Thank you for your help, I publish the my site to my own domain, I do not use .Mac, I tested your code and ity works well on .Mac, can you help with the code to publish to my own domain.
Thank you againYou appear to have just collected a variety of code snippets and thrown them together, including a section of AS2 code ( gage.onRelease = function() {... )
The suggestion I offered yesterday still stands. You should find a tutorial regarding AS3 and the atan2 function. Beyond that, what you show suggests this is a school assignment. You should seek help from your fellow students and instructor if that is the case. -
My macbook pro intel core duo 2 keeps restarting intermittenly. Help with error code.
I have run a Hardware Test, and it gives the follwing error code. Can anyone tell me what this is? I recently had my logic board replaced within the last 3 months, so it shouldn't be a problem there.
Thank you very much for any and all help.
Error code:
4SNS/I/40000000:TGOH-128.00Online references possible memory issue? Sensors?
https://discussions.apple.com/thread/3140607?start=0&tstart=0
Keep taking it back and they keep switching parts until the problem is gone. -
I need help with this code error "unreachable statement"
the error_
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errors
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Tools//tool class
private int numberOfToolItems;
private ToolItems[] toolArray = new ToolItems[10];
public Tools()//array of tool
numberOfToolItems = 0;
for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
toolArray[i] = new ToolItems();
}//end for loop
}//end of array of tools
public int search(int id)//search mehtod
int index = 0;
while (index < numberOfToolItems)//while and if loop search
if(toolArray[index].getID() == id)
return index;
else
index ++;
}//en while and if loop
return -1;
}//end search method
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0;
int index;
index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
}//end delete method
public void display()//display method
for(int i = 0; i < numberOfToolItems; i++)
//toolArray.display(g,y,x);
}//end display method
public String getRecord(int i)//get record method
// return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
}//end getrecod
}//end class
Edited by: ladsoftware on Oct 9, 2009 6:08 AM
Edited by: ladsoftware on Oct 9, 2009 6:09 AM
Edited by: ladsoftware on Oct 9, 2009 6:10 AM
Edited by: ladsoftware on Oct 9, 2009 6:11 AMladsoftware wrote:
Subject: Re: I need help with this code error "unreachable statement"
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errorsThe compiler is telling you exactly what the problems are:
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
int index;
index = search(id); //< -----------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
// <<== HERE where is the return statement?
}//end delete method
public String getRecord(int i)//get record method
// return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
}//end getrecod
}//end class -
Install Flex 4
Exit Code: 7
-------------------------------------- Summary --------------------------------------
- 0 fatal error(s), 3 error(s), 1 warning(s)
WARNING: Memory requirements not met for {74EF259F-1DC6-4DEE-866B-0707173D7654}
ERROR: Custom Action for payload {74EF259F-1DC6-4DEE-866B-0707173D7654} Adobe Flash Builder returned error. Failing this payload.
ERROR: The following payload errors were found during install:
ERROR: - Adobe Flash Builder: Install failed
My Pc
Pentium D CPU 2.80GHz, 2.80GHz
992 MB in RAM
HDD: 38.0GB, Used: 23.3GB, Free: 14.7GB
Sistem
Microsoft Windows XP Pro.
Ver. 2002
Service Pack 3
Help to install tehe Flex Build 4, plase.Hi,
I had a similar problem (see error details below) installing on Windows 7 Professional using a domain account which is in the local admin group. I think my problem was due to an @ character in one of the following environment variables:
APPDATA=C:\Users\my_username@my_company.com\AppData\Roaming
HOMEPATH=\Users\my_username@my_company.com
LOCALAPPDATA=C:\Users\my_username@my_company.com\AppData\Local
USERPROFILE=C:\Users\my_username@my_company.com
I solved the problem by creating a local account with a plalin alphabetical username, adding it to the local administrator group and re-running the installer under that account by right clicking and selecting "Run as Administrator".
I got this idea from the following blog posts:
http://www.niallodoherty.com/post.cfm/adobe-flash-builder-4-installation-error-exit-code-7
http://www.joebillman.com/blog/2010/04/flash-builder-4-install-error/
Hope that helps,
Carl
Exit Code: 7
-------------------------------------- Summary --------------------------------------
- 0 fatal error(s), 4 error(s), 0 warning(s)
ERROR: Custom Action for payload {74EF259F-1DC6-4DEE-866B-0707173D7654} Adobe Flash Builder returned error. Failing this payload.
ERROR: The following payload errors were found during install:
ERROR: - Adobe Flash Builder: Install failed
ERROR: - Adobe Flash Player 10 ActiveX: Install failed -
Need help with WMI code that will send output to db
'm new to WMI code writing, so I need some help with writing code that we can store on our server. I want this code to run when a user logs into their computer
and talks to our server. I also want the code to:
* check the users computer and find all installed patches
* the date the patches were installed
* the serial number of the users computer
* the computer name, os version, last boot up time, and mac address
and then have all this output to a database file. At the command prompt I've tried:
wmic qfe get description, hotfixid
This does return the patch information I'm looking for, but how do I combine that line of code with:
wmic os get version, csname, serialnumber, lastbootuptime
and
wmic nicconfig get macaddress
and then get all this to output to a database file?Thank you for the links. I checked out http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx and
found lots of good information. I also found a good command that will print information to a text file.
Basically what I'm trying to do is retrieve a list of all installed updates (Windows updates and 3rd party updates). I do like that the below code because it gives me the KB numbers for the Windows updates. I need this information so my IT co-workers &
I can keep track of which of our user computers need a patch/update installed and preferably which patch/update. The minimum we want to know is which patches / updates have been installed on which computer. If you wondering why we don't have Windows automatic
updates enable, that's because we are not allowed to.
This is my code so far.
#if you want the computer name, use this command
get-content env:computername
$computer = get-content env:computername
#list of installed patches
Get-Hotfix -ComputerName $computer#create a text file listing this information
Get-Hotfix > 'C:\users\little e\Documents\WMI help\PowerShell\printOutPatchList.txt'
I know you don't want to tell me the code that will print this out to a database (regardless if it's Access or SQL), and that's find. But maybe you can tell me this. Is it possible to have the results of this sent to a database file or do I need to go into
SQL and write code for SQL to go out and grab the data from an Excel file or txt file? If I'm understanding this stuff so far, then I suspect that it can be done both ways, but the code needs to be written correctly for this to happen. If it's true, then which
way is best (code in PowerShell to send information to SQL or SQL go get the information from the text file or Excel file)? -
BCM 2007 error: "To help prevent malicious code from running, one or more objects"
Recently we changed our e-mail accounts around to a new domain name. After this switch, BCM no longer allows adding, editing or any other manipulation of contact records. I get an error message saying "To help prevent malicious code from running, one
or more objects in this form were not loaded."
I have tried clearing the forms cache, uninstalling and reinstalling BCM and even adding the old e-mail address back into the Outlook profile and nothing works.
Is there something I have missed somewhere or am I looking at a complete reinstall of Outlook and BCM?
JonHi Jon
Thank you for the update. It could be another Active X Component - BCM 2007 calls several of them
On thing you could do is run a Process Monitor Log to see if perhaps another component is Blocked. To do that try the following:
1. Close Outlook and as many other programs as possible
2. Download and Extract Process Monitor from here -
http://technet.microsoft.com/en-us/sysinternals/bb896645
3. Start Process Monitor
4. Start Outlook
5. Reproduce the error in BCM
6. Stop Process Monitor by going to the File menu and unchecking "Capture Events"
At this point you can try filtering by clicking the Filter Icon (the Funnel) on the menu bar. Click on the Left Drop down at the top of the Dialog and Select "Path"
For the second dropdown select "Contacts" and then filter on "ActiveX Compatibility" (without the quotes)
in my lab, every GUID under HKLM\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility came up with a result of "Name Not Found"
On your system, are there any are present (the Result Column will show "Success")?
If so, then I would check the Compatibility Flag for that one (Hint - if you right-click on an Entry you can select "Jump To" to open Regedit to that location)
- or -
If you would like for me to take a look at it, in Process Monitor Go to the File > Save Menu and save it as a .PML file. Then send it to me at cts-larrymei at live.com
Note - Please ZIP the file prior to sending it
Thanks!
Larry - MSFT
Larry Meinstein -
I need help with my code..
hi guys. as the subject says I need help with my code
the Q for my code is :
write a program that reads a positive integer x and calculates and prints a floating point number y if :
y = 1 ? 1/2 + 1/3 - ? + 1/x
and this is my code
This program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 2; // n is suppose to control the number sign
int x; // a positive integer entered by the user
int m;
System.out.println("Enter a positive integer");
x = input.nextInt();
do
m = (int) Math.pow( -1, n)/i;
System.out.println(m);
n++;
i++;
while ( m >= 1/x );
} // end method main
} // end class Sh7q2 when I compile it there is no error
but in the run it tells me to enter a positive integer
suppose i entered 5
then the result is 1...
can anyone tell me what's wrong with my codeThis program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 1; // n is suppose to control the number sign
int x; // a positive integer entered by the user
double m;
int a = 1;
double sum = 0;
System.out.println("Enter a positive integer");
x = input.nextInt();
for ( i = 1; a <= x; i++)
m = Math.pow( -1, n+1)/i;
sum = sum + m;
n++;
a++;
System.out.print("y = " + sum);
} // end method main
} // end class Sh7q2is it right :S
Maybe you are looking for
-
Jasper report for pdf and html
Hi friends I am Gopi I am doing project in servlet and jasperreport in tomcat. I save my path jasperreport for Html and Pdf reports. when i click the jsp button Export to pdf and Export to Html, I need to open this files in new pdf application and ne
-
Can I use the Photoshop Creative Cloud on multiple computers?
I'm interested in buying Photoshop Creative Cloud, but work off of multiple computers. Will I be able to use the Photoshop on multiple computers via the Creative Cloud? How does this work? Mahalo.
-
Please Help! 10.6.8 Update and subsequent problems
On Friday, 2/10/2012, the Software Update popped up and informed me that new updates were ready to be installed on my MacBook Pro. I clicked the update button and the updater installed the following updates: iTunes v10.5.3 Security Update 2012-001 v1
-
How to get userinformation by passing userid
Hi All, I know how to get IUser Object for the current logged in user and get the user information like Job title, City, Time Zone, Country, Department etc.. The same details I want go get for a particular user (not current logged in user). Hence I a
-
Photoshop CS5 Install Help Please !!!!!!!!!!!
Exit Code: 6 -------------------------------------- Summary -------------------------------------- - 0 fatal error(s), 52 error(s), 51 warning(s) WARNING: OS requirements not met for {667C8B6C-3EAF-4646-A8EC-D85CCC4D3D84} WARNING: Payload cannot b