Cleaning up my code
I am trying to condense and improve my java code. I have almost everything in one class and want to break it out into more manageable classes. So, I created this class:
public class MyTableModels extends DefaultTableModel {
public MyTableModels() {
class MySTableModel extends DefaultTableModel {
public MySTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 6) {
return false;
return true;
class MyOTableModel extends DefaultTableModel {
public MyOTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 0 || column == 4 || column == 5) {
return false;
return true;
class MyPTableModel extends DefaultTableModel {
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public MyPTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 7) {
return true;
return false;
class MyFTableModel extends DefaultTableModel {
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public MyFTableModel(Vector columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
return false;
}Now, I want to call MyFTableModel from my main class like this:
MyFTableModel modelF = new MyFTableModel(columnNamesF,0);The first class is in a file called MyTableModels.java and the call is in FDASFrame.java. They are both in the package sdh. Do I need to change the call to MyFTableModel or add some include or something? Thanks.
Allyson
I guess you are being sarcastic??? I am sorry. I guess my class is not written correctly??? Is this any better?:
public class MyTableModels extends DefaultTableModel {
class MySTableModel extends DefaultTableModel {
public MySTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 6) {
return false;
return true;
class MyOTableModel extends DefaultTableModel {
public MyOTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 0 || column == 4 || column == 5) {
return false;
return true;
class MyPTableModel extends DefaultTableModel {
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public MyPTableModel(Object[] columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (column == 7) {
return true;
return false;
class MyFTableModel extends DefaultTableModel {
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
public MyFTableModel(Vector columnNames, int numRows)
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
return false;
}I am just trying to create some new classes outside the main class that will make the program more readable. The whole main file is over 5000 lines long and I want to break it up into individual files of classes. Is this the wrong way to do it? Sorry for my confusion.
Allyson
Similar Messages
-
How to clean the html code multiple pages simultaneously with Dreamweaver or other soft ?
hello,
How to clean the html code multiple pages simultaneously with Dreamweaver or other soft ? I have hundreds of pages to clean
Thanks !I would start afresh. I would also use Dreamweaver's template system to make thing a lot easier. Have a look at the following, copy and paste into a new document and view in your favourite browser.
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" />
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<style>
.hline {
background: url(http://yannick.michelat.free.fr/barre.gif);
height: 10px;
margin-top: 10px;
margin-bottom: 10px;
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-7">
<img alt="" class="img-responsive pull-right" style="margin-top:20px;" src="http://yannick.michelat.free.fr/Calanques.gif" />
</div>
<div class="col-xs-5">
<img alt="" class="img-responsive center-block" style="margin-top: 40px;" src="http://yannick.michelat.free.fr/grandportfolio.gif" />
</div>
</div>
<div class="row hline"></div>
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-01.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-02.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-03.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-04.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-05.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-06.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-07.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-08.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-09.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-10.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-11.jpg" alt="" class="img-responsive"></a></div>
<div class="col-xs-6 col-sm-4 col-md-2"> <a href="#" class="thumbnail"> <img src="http://yannick.michelat.free.fr/vign__CalanquesConseil-12.jpg" alt="" class="img-responsive"></a></div>
</div>
<div class="row hline"></div>
</div>
</body>
</html> -
[svn] 1518: Minor update to clean up the code.
Revision: 1518
Author: [email protected]
Date: 2008-05-01 19:26:44 -0700 (Thu, 01 May 2008)
Log Message:
Minor update to clean up the code.
Modified Paths:
blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/qa/management/MBeanObjectNameResolver.javathe best way is to write several small class that work together and do not write a huge-mading-all-even-coffee-class
marvinrouge -
Hello,
I am new to Dreamweaver (from GoLive and/or just writing out
code).
We have a large site that we are trying to find a quick way
to clean up the code. What I mean by "cleaning" up the code is
getting it better organized on the page. Somewhere along the line,
the code has gotten moved around so that it is not in an easy to
read tabbed format. Things are bumped around, start/end tags at the
end of a line rather than on its own. That kind of stuff.
I had heard that Dreamweaver was friendly to writing code so
I was hoping that it had some type system that allowed to
straighten things up as well.
Even if there was a way to slam everything to the left would
be a help.
ThanksCOMMANDS | Apply Source Formatting.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"b. mclaughlin" <[email protected]> wrote in
message
news:f8asns$56k$[email protected]..
> Hello,
> I am new to Dreamweaver (from GoLive and/or just writing
out code).
> We have a large site that we are trying to find a quick
way to clean up
> the
> code. What I mean by "cleaning" up the code is getting
it better organized
> on
> the page. Somewhere along the line, the code has gotten
moved around so
> that it
> is not in an easy to read tabbed format. Things are
bumped around,
> start/end
> tags at the end of a line rather than on its own. That
kind of stuff.
>
> I had heard that Dreamweaver was friendly to writing
code so I was hoping
> that
> it had some type system that allowed to straighten
things up as well.
> Even if there was a way to slam everything to the left
would be a help.
>
> Thanks
> -
To improve the system performance of the code
Please help me to improve the system performance of the following program. its very urgent
report zsdr0125
no standard page heading
* LINE-SIZE 170 " SIR 061880
line-size 210 " SIR 061880
line-count 58
message-id zz.
** Report header ******************************************************
** Report name: Activity Costing Report
** Report id: RO-01148
** Designed/Coded. Tori Chandler. Reporting Team.
** Date: March 01, 2000.
** Original SIR: 016113
** Application Area: V - Sales & Distribution (OTC)
** Correction/Transport: D10K951579
** Description: It is normal business practice for logistics
** operations to charge business units for the activity
** incurred on their behalf. This is consistent with
** activity based costing principles between BU and
** shared resources. The activities involved are picking
** storage, shipping and receiving. The purpose of this
** report is to provide data for the first 3.
** QRB2 - 03/13/2000 - Tracy, Antoine, Christian, Tori
** History:
* 06/14/2001 SIR 032383 CTS Antoine Dailly
* A plant (WERKS) can have several Distrib points (VSTEL)
* SIGN = 032383
* Modification History:
* Date Modified by SIR CTS Description
*11/14/2001 J.CAMPION 034606 D10K979189 Logistics Activity report
* Logistics Activity reports
* We added fields ship to customer and country and we also make another
* total
* QRB2 Tracy L. Obrien
* Modification History:
* Date Modified by SIR CTS Description
*11/14/2001 J.CAMPION 37838 D10K982890 Select only
* material type HALB
*06/12/2002 T OBrien 38784 D10K988181
* Allow option to get material weight from Master data or
* from the delivery.
* Modified by SIR CTS Date
* Jim Harwood 42730 D10K993119 10 Oct 2002
* Description: Code amended to default the Goods Issue Date range to
* the previous month. Also amended to print out the Select Options.
* Modified by SIR CTS Date
* Jim Harwood 44381 D10K994598 18 Nov 2002
* Description: Correct date range processing. APPEND statement added
* so that record is added ot internal table S_WADAT. Also S_VKORG
* removed as it was NO DISPLAY and nothing was assigned to it. It's use
* in an SQL call may be causing the wrong optimization.
* Modified by SIR CTS Date
* Tori Chandler 45567 D10K995875 03 Jan 2003
* Description: Correct reporting of weights for non-pickable items
* when the Material Master Data radiobutton is selected. Also found
* from SIR 37838, that material type is hardcoded on the LIPS. I
* created a new select option and the person needing the report
* can control if they want only HALB or all line items. Also,
* because of this the delivery weight is obtain from header,
* changing to accumulate from LIPS to match which lines are selected
* QRB2: 1/15/2003: Eileen, Jerome and Tori
*{ INSERT D11K901833 1
* Modified by Sir CTS Date
* Sue Kastan 48712/054042 D11K901833 28 Aug, 2003
* Fix overcounting of records from LIPS
*} INSERT
* Modified by SIR CTS Date *
* Vijay Andea 061880 D11K918628 04/20/2006 *
* D11K946194 *
* Description: Enhence ZSDR0125 Activity Cost Driver Report to allow *
* Analysis by Product Groupings. *
*} INSERT
* Modified by SIR CTS Date *
* Prakash Arunachalam 091510 D11K950288 09/26/2006 *
* Description: Correct Activity Cost report - material weight *
* calculation *
* Modified by SIR CTS Date *
* Murali Krishna 301978 D50K903293 01/20/2008
* Description: Improve the system performance of this report and
* clean-up of code into various form routine
* Table declaration.
tables: likp, " SD Document: Delivery Header Data
lips, " SD document: Delivery: Item data
vepo, " SD Document: Shipping Unit Item (Content)
vekp, " SD Document: Shipping Unit Header
knvv, " Customer Master Sales Data
kna1, " General Data in Customer Master SIR 34606
marm, " Units of Measure
mara, " Material Master: General Data SIR 38784
t001l, " Stge locs
t001k, " Valuation area
tvswz, " Shipping Points per Plant
t134, " Material types
z0234. " Alternative Unit of Measure
*** Selection screen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_werks like t001l-werks obligatory memory id wrk.
select-options: s_lgort for t001l-lgort,
* S_VKORG FOR TVKO-VKORG NO-DISPLAY ," SIR 34606, 42730
* S_WADAT FOR LIKP-WADAT_IST OBLIGATORY NO-EXTENSION,
s_wadat for likp-wadat_ist no-extension, " SIR 42730
s_mtart for t134-mtart, " SIR 45567
s_lfart for likp-lfart no-display no intervals.
selection-screen skip 2.
selection-screen comment 1(21) text-002. " SIR 38784
parameters: p_delwt radiobutton group grp1, " SIR 38784
p_mstwt radiobutton group grp1. " SIR 38784
*--------------------------------------------------*Start of SIR 061880
selection-screen skip 2.
selection-screen comment 1(21) text-006.
parameters: p_voldl radiobutton group 2, " Volume from Delivery
p_volmd radiobutton group 2. " Volume from Master Data
*-----------------------------------------------------End of SIR 061880
selection-screen end of block b1.
*--------------------------------------------------*Start of SIR 061880
selection-screen begin of block b2 with frame title text-007.
select-options: s_cbuun for knvv-kvgr1 no intervals, " Customer BU
s_mbuun for mara-prdha+1(2) no intervals, " Material BU
s_lobus for mara-prdha+3(3) no intervals, " LOB
s_pac1 for mara-prdha+6(3) no intervals. " PAC1
selection-screen end of block b2.
*----------------------------------------------------*End of SIR 061880
*---Type Declaration for Internal Tables------------------------------*
types: begin of t_likp,
vbeln like likp-vbeln, " delivery
vstel like likp-vstel, " shipping point
lfart like likp-lfart, " delivery type
vkorg like likp-vkorg, " Sales organization
kunag like likp-kunag, " sold-to party
kunnr like likp-kunnr, " ship to party SIR 34606
btgew like likp-btgew, " Delivery weight
gewei like likp-gewei, " Unit of weight
anzpk like likp-anzpk, " Number of Packages SIR 61880
volum like likp-volum, " Delivery Volume SIR 61880
voleh like likp-voleh, " Volume Unit SIR 61880
vtwiv like likp-vtwiv, " Distribution channel
spaiv like likp-spaiv, " Division
wadat_ist like likp-wadat_ist, " actual goods issue date
del_flg(1) type c, "(+) SIR 301978
end of t_likp.
types: begin of t_lips,
vbeln like lips-vbeln, " delivery
posnr like lips-posnr, " delivery line
matnr like lips-matnr, " material
lgort like lips-lgort, " storage location
prodh like lips-prodh, " product hierarchy
meins like lips-meins, " base UoM
brgew like lips-brgew, " Material weight
gewei like lips-gewei, " Unit of weight
volum like lips-volum, " Material Volume SIR 61880
voleh like lips-voleh, " Volume Unit SIR 61880
lgmng like lips-lgmng, " actual delivery quantity
komkz like lips-komkz, " Indicator for picking control
mtart like lips-mtart, " Material type " SIR 37838
del_flg(1) type c, "(+) SIR 301978
end of t_lips.
types: begin of t_vepo,
venum like vepo-venum, " shipping unit number
vbeln like vepo-vbeln, " delivery
end of t_vepo.
types: begin of t_vekp,
venum like vekp-venum, " shipping unit number
brgew like vekp-brgew, " actual weight
gewei_max like vekp-gewei_max, " unit of weight
vpobjkey like vekp-vpobjkey, " key for assigned object
end of t_vekp.
types: begin of t_knvv,
kunnr like knvv-kunnr, " customer number
ktgrd like knvv-ktgrd, " acct assign group
kvgr1 like knvv-kvgr1, " customer group 1
end of t_knvv.
types: begin of t_kna1, " SIR 34606
kunnr like kna1-kunnr, " customer number " SIR 34606
land1 like kna1-land1, " contry " SIR 34606
end of t_kna1. " SIR 34606
types: begin of t_marm,
matnr like marm-matnr, " material
meinh like marm-meinh, " Alt unit of measure 032383
umrez like marm-umrez, " numerator
umren like marm-umren, " denominator
end of t_marm.
types: begin of t_mara, " SIR 38784
matnr like mara-matnr, " material " SIR 38784
prdha like mara-prdha, " Product Hierarchy " SIR 61880
brgew like lips-brgew, " gross weight " SIR 38784
gewei like mara-gewei, " Unit of weight " SIR 38784
volum like mara-volum, " Volume " SIR 61880
voleh like mara-voleh, " Volume Unit " SIR 61880
del_flg(1) type c, "(+) SIR 301978
end of t_mara. " SIR 38784
types: begin of t_tvswz,
vstel like tvswz-vstel, " shipping point
end of t_tvswz.
types: begin of t_z0234, "032383
vstel like z0234-vstel, " shipping point 032383
zpaluom like z0234-zpaluom," pallet unit of measure 032383
zcsuom like z0234-zcsuom," Case unit of measure 032383
end of t_z0234. "032383
types: begin of t_output_dt,
wadat_ist like likp-wadat_ist, " Goods issue date
ktgrd like knvv-ktgrd," acct assign group
bu like knvv-kvgr1," business unit
kunnr like kna1-kunnr," ship to location SIR 34606
land1 like kna1-land1," ship to location SIR 34606
d_btgew like likp-btgew," delivery weight
m_brgew like lips-brgew," material weight
a_brgew like vekp-brgew," actual weight of ship unit
num_del type i, " counter of deliveries
num_pallets type i, " number of pallets
num_cases type i, " number of cases
num_loose type i, " loose quantity
num_delln type i, " counter of delivery lines
* packages like likp-anzpk," Number of Packages " SIR 61880
packages(3) type p, " Number of Packages " SIR 61880
volume like lips-volum," Volume " SIR 61880
lobus(3) type c, " Line of Business " SIR 61880
pac1(3) type c, " PAC1 " SIR 61880
end of t_output_dt.
types: begin of t_output_ag,
ktgrd like knvv-ktgrd," acct assign group
bu like knvv-kvgr1," business unit
land1 like kna1-land1," country SIR 34606
d_btgew like likp-btgew," delivery weight
m_brgew like lips-brgew," material weight
a_brgew like vekp-brgew," actual weight of ship unit
num_del type i, " counter of deliveries
num_pallets type i, " number of pallets
num_cases type i, " number of cases
num_loose type i, " loose quantity
num_delln type i, " counter of delivery lines
* packages like likp-anzpk," Number of Packages " SIR 61880
packages(3) type p, " Number of Packages " SIR 61880
volume like lips-volum," Volume " SIR 61880
lobus(3) type c, " Line of Business " SIR 61880
pac1(3) type c, " PAC1 " SIR 61880
end of t_output_ag.
types: begin of t_output_gs, " SIR 34606
ktgrd like knvv-ktgrd," acct assign group " SIR 34606
bu like knvv-kvgr1," business unit " SIR 34606
d_btgew like likp-btgew," delivery weight " SIR 34606
m_brgew like lips-brgew," material weight " SIR 34606
a_brgew like vekp-brgew," actual weight " SIR 34606
num_del type i, " counter of deliv " SIR 34606
num_pallets type i, " number of pallets " SIR 34606
num_cases type i, " number of cases " SIR 34606
num_loose type i, " loose quantity " SIR 34606
num_delln type i, " counter of deliv " SIR 34606
* packages like likp-anzpk, " Number of Package " SIR 61880
packages(3) type p, " Number of Packages" SIR 61880
volume like lips-volum, " Volume " SIR 61880
lobus(3) type c, " Line of Business " SIR 61880
pac1(3) type c, " PAC1 " SIR 61880
end of t_output_gs. " SIR 34606
*-------------------------------------------------* Begin of SIR 061880
* Material Type
types: begin of t_mtart,
mtart like t134-mtart, " Material Type
end of t_mtart.
* Customer Business Unit.
types: begin of t_kvgr1,
kvgr1 like knvv-kvgr1, " Customer Group 1
end of t_kvgr1.
* sales Organization.
types: begin of t_lgort,
lgort like t001l-lgort, " Sales Organization
end of t_lgort.
* Begin of SIR 301978
* Header: Material Document
types: begin of t_mkpf,
vgart type mkpf-vgart,
xblnr type likp-vbeln,
end of t_mkpf.
* End of SIR 301978
*---------------------------------------------------* End of SIR 061880
*---Internal Tables---------------------------------------------------*
data: i_likp type t_likp occurs 0 with header line,
i_temp_likp type t_likp occurs 0 with header line,
v_likp type t_likp,
i_lips type t_lips occurs 0 with header line,
i_temp_lips type t_lips occurs 0 with header line,
v_lips type t_lips,
i_vepo type t_vepo occurs 0,
* V_VEPO TYPE T_VEPO,
i_vekp type t_vekp occurs 0,
v_vekp type t_vekp,
i_knvv type t_knvv occurs 0 with header line,
v_knvv type t_knvv,
i_kna1 type t_kna1 occurs 0, " SIR 34606
v_kna1 type t_kna1, " SIR 34606
i_z0234 type t_z0234 occurs 0, " 032383
v_z0234 type t_z0234, " 032383
i_z0234_uom type t_z0234 occurs 0, " 032383
v_z0234_uom type t_z0234, " 032383
i_marm type t_marm occurs 0 with header line," SIR 61880
i_marm_pallet type t_marm occurs 0 with header line,
v_marm_pallet type t_marm,
i_marm_case type t_marm occurs 0 with header line,
v_marm_case type t_marm,
*-------------------------------------------------* Begin of SIR 061880
* I_MARA TYPE T_MARA OCCURS 0, " SIR 38784
i_mara1 type t_mara occurs 0 with header line,
i_mtart type t_mtart occurs 0 with header line,
i_kvgr1 type t_kvgr1 occurs 0 with header line,
i_lgort type t_lgort occurs 0 with header line,
v_kvgr1 type t_kvgr1,
*---------------------------------------------------* End of SIR 061880
v_mara type t_mara, " SIR 38784
i_tvswz type t_tvswz occurs 0,
v_tvswz type t_tvswz, "(+) SIR 301978
i_output_dt type t_output_dt occurs 0,
v_output_dt type t_output_dt,
i_output_ag type t_output_ag occurs 0,
v_output_ag type t_output_ag,
i_output_gs type t_output_gs occurs 0, " SIR 34606
v_output_gs type t_output_gs, " SIR 34606
i_mkpf type table of t_mkpf with header line."SIR 301978
*** Data Declarations *
data: v_page(3) type c, " Page Counter
v_comp like t001k-bukrs, " zbsn0001 company code
v_title(24) type c, " zbsn0001 report title
v_rpttyp type c, " report type
v_ok type c, " control While... endwhile
v_diff_date type p, " days between selection
v_werks like t001l-werks, " plant
* v_z0234_zpaluom like z0234-zpaluom, " Pallet Unit of Measure
* v_z0234_zcsuom like z0234-zcsuom, " Case Unit of Measure
v_palwto type p decimals 6, " SIR 091510
* "like likp-btgew, " Weight after conversion
v_vekp_tabix like sy-tabix, " index on read
v_vekp_sum_brgew like vekp-brgew, " actual weight
v_pallet_qty like lips-lgmng, " calculated pallet qty
v_pallet_integer type i, " true pallet qty
v_case_qty like lips-lgmng, " calculated case qty
v_case_integer type i, " true case qty
v_qty_not_pallets like lips-lgmng, " calculated
v_num_pallets like lips-lgmng, " calculated nbr of pallets
v_num_pallets_int type i, " true nbr of pallets
v_num_cases like lips-lgmng, " calculated nbr of cases
v_num_cases_int type i, " true nbr of cases
v_total_case_qty like lips-lgmng, " case quantity
v_loose_qty type i, " calculated loose quantity
*-------------------------------------------------* Begin of SIR 061880
v_volume like lips-volum, " Volume After Convertion
v_cbuun like knvv-kvgr1, " Customer BU
v_mbuun like knvv-kvgr1, " Material BU
v_lobus(3) type c, " Line of Business
v_pac1(3) type c, " PAC1
v_flag type c. " Flag Indicator for No Data
*---------------------------------------------------* End of SIR 061880
* Begin of SIR 301978
* Ranges
ranges : r_vstel for tvswz-vstel.
* End of SIR 301978
* Constants
data: c_uom(3) type c value 'KG'. " Kilogram Unit of Meas.
data : c_vom like mara-voleh value 'M3'. " Metter Cube. " SIR 061880
constants : c_wl(2) type c value 'WL'. "(+) SIR 301978
* Initialization.
initialization.
s_lfart-sign = 'I'.
s_lfart-option = 'EQ'.
s_lfart-low = 'LF '.
append s_lfart.
s_lfart-low = 'NL '.
append s_lfart.
s_lfart-low = 'NLCC'.
append s_lfart.
s_lfart-low = 'ZLFI'.
append s_lfart.
* AT SELECTION-SCREEN.
at selection-screen.
* SIR 42730 - If no Goods Issue Date has been specified in the
* Select Options set the range to the previous month.
if s_wadat-low is initial.
s_wadat-sign = 'I'.
s_wadat-option = 'BT'.
s_wadat-high = sy-datum. " Today's date
s_wadat-high+6(2) = '01'. " First of this month
s_wadat-high = s_wadat-high - 1. " End of last month
s_wadat-low = s_wadat-high. " End of last month
s_wadat-low+6(2) = '01'. " First of last month
append s_wadat.
endif. " SIR 42730 IF S_WADAT-LOW IS INITIAL.
clear v_werks. "(+) SIR 301978
* Validate Plant/Storage Location from selection screen
select werks up to 1 rows into v_werks from t001l
where werks = p_werks and
lgort in s_lgort.
endselect.
if sy-subrc ne 0.
message e045 with text-e01.
endif.
* Validate Storage Location
if not s_lgort[] is initial.
select lgort from t001l into table i_lgort where lgort in s_lgort.
if sy-subrc ne 0.
message e045 with text-e09.
endif.
endif.
* Validate date range. do not allow more that 31 days
if not s_wadat-high is initial.
v_diff_date = s_wadat-high - s_wadat-low.
if v_diff_date >= '31'.
message e045 with text-e02.
endif.
endif.
*-------------------------------------------------* Begin of SIR 061880
* Validation for Material Type in Selection Screen
if not s_mtart[] is initial.
select mtart from t134 into table i_mtart where mtart in s_mtart.
if sy-subrc ne 0.
message e045 with text-e07.
endif.
endif.
at selection-screen on block b2.
* Validation for Material Business Unit and Customer Business Unit.
if s_cbuun-low is not initial and s_mbuun-low is not initial.
message e045 with text-e05.
endif.
* Validation for Possible combinations of Material BU, Line of Business
* and PAC1
if ( s_mbuun-low is not initial and s_lobus-low is not initial
and s_pac1-low is not initial )
or ( s_mbuun-low is not initial and s_lobus-low is not initial )
or ( s_lobus-low is not initial and s_pac1-low is not initial )
or ( s_mbuun-low is not initial and s_pac1-low is not initial ).
message e045 with text-e06.
endif.
* Validation for Customer Business Unit.
if not s_cbuun[] is initial.
select kvgr1 from tvv1 into table i_kvgr1 where kvgr1 in s_cbuun.
if sy-subrc ne 0.
message e045 with text-e08.
endif.
* free: i_kvgr1.
endif.
*---------------------------------------------------- End of SIR 061880
* TOP-OF-PAGE
* Top of the page routine to print the headers and columns
top-of-page.
format color col_heading on.
if v_rpttyp = 'D'.
v_title = text-h01.
else.
v_title = text-h02.
endif.
perform zbsn0001_standard_header " Standard Report Heading Form
using v_comp v_title 'U' v_page.
skip.
if v_rpttyp = 'D'.
perform write_dtlvl_headings.
else.
perform write_aglvl_headings.
endif.
* FORM WRITE_DTLVL_HEADINGS *
* for date detail level, print the column headers *
form write_dtlvl_headings.
write: /001 text-h03, " Acct
038 text-h04, " ------ P I C K I N G ------
105 text-h05, " ----- S H I P P I N G -----
/001 text-h06, " Group
007 text-h07, " Date
017 text-h08, " BU
021 text-h17, " ship to party 34606
030 text-h18, " country
039 text-h09, " Pallets
057 text-h10, " Cases
075 text-h11, " Loose
093 text-h12, " Lines
105 text-h13, " Material Kg
124 text-h16, " Delivery Kg
143 text-h14, " Actual Kg
161 text-h15, " Deliveries
*----------------------------------------------------Start of SIR 61880
173 text-h20, " Packages
189 text-h21, " Volume
201 text-h22, " LOB
207 text-h23. " PAC1
*-----------------------------------------------------*End of SIR 61880
skip.
endform. " end of write_dtlvl_headings.
* FORM WRITE_AGLVL_HEADINGS *
* for account group detail level, print the column headers *
form write_aglvl_headings.
write: /001 text-h03, " Acct
038 text-h04, " ------ P I C K I N G ------
105 text-h05, " ----- S H I P P I N G -----
/001 text-h06, " Group
017 text-h08, " BU
030 text-h18, " country SIR 34606
039 text-h09, " Pallets
057 text-h10, " Cases
075 text-h11, " Loose
093 text-h12, " Lines
105 text-h13, " Material Kg
124 text-h16, " Delivery Kg
143 text-h14, " Actual Kg
161 text-h15, " Deliveries
*---------------------------------------------------*Start of SIR 61880
173 text-h20, " Packages
189 text-h21, " Volume
201 text-h22, " LOB
207 text-h23. " PAC1
*-----------------------------------------------------*End of SIR 61880
skip.
endform. " end of write_aglvl_headings.
*-------------------------- SUBBROUTINES -----------------------------*
include zbsn0001. " Include to print all Standard Report Titles
include zsdn0004. " Print the Select Options
*** MAIN SELECTION. *
start-of-selection.
refresh: i_likp, i_temp_likp, i_lips, i_temp_lips, i_vepo,
i_vekp, i_knvv, i_marm_pallet, i_marm_case, i_tvswz,
i_output_dt, i_output_ag, i_mara1.
clear: v_likp, v_lips, v_vekp, v_knvv, v_mara,
v_marm_pallet, v_marm_case, v_output_dt, v_output_ag.
v_rpttyp = 'D'.
* SIR 42730 - Echo the Select Options to the output listing and print
* the Goods Issue Date range being used.
write: /,/. " SIR 43730 - Skip a couple of lines to centre it.
perform zsdn0004_print_select_options using sy-cprog ' '.
if s_wadat-high is initial.
write: /,/, text-003, 34 s_wadat-low.
else.
write: /,/, text-003, 34 s_wadat-low, 44 text-004, 47 s_wadat-high.
endif.
new-page.
* Main Processing. *
perform get_data.
if not i_lips[] is initial.
perform create_output.
endif.
* END-OF-SELECTION
end-of-selection.
*-------------------------------------------------* Start of SIR 061880
* PERFORM WRITE_REPORT.
if not i_output_dt[] is initial and not i_output_ag[] is initial and
not i_output_gs[] is initial.
perform write_report.
else.
skip 2.
write:/ text-e03.
skip 2.
uline.
clear: v_flag.
endif.
*---------------------------------------------------* End of SIR 061880
* FORM GET_DATA *
* build all of the internal tables needed for the report *
* selects on t001k, z0234, likp, lips, vepo, vekp, knvv & marm, mara *
form get_data.
perform get_data_t001k. " SIR 301978
perform get_data_tvswz. " SIR 301978
if sy-subrc = 0. " Build shipping point range
perform get_data_Z0234. " SIR 301978
if sy-subrc ne 0.
v_flag = 'X'.
* stop.
else.
sort i_z0234 by vstel. " 032383
endif.
* Begin of SIR 301978
* The data retrievalfrom LIKP has been modified for performance
* reasons
perform get_data_mkpf. " SIR 301978
if sy-subrc eq 0.
* Deleting data other than Goods issued for delivery
delete i_mkpf where vgart ne c_wl.
sort i_mkpf by xblnr.
endif.
* Deleting the data from the internal table i_likp by comparing
* shipping point
r_vstel-sign = 'I'.
r_vstel-option = 'EQ'.
clear : v_tvswz.
loop at i_tvswz into v_tvswz.
r_vstel-low = v_tvswz-vstel.
append r_vstel.
endloop.
if not i_mkpf[] is initial.
perform get_data_likp. " SIR 301978
endif.
if sy-subrc = 0.
delete i_likp where not lfart in s_lfart.
* End of SIR 301978
* Get data for the delivery lines
if not i_likp[] is initial.
perform get_data_lips. " SIR 301978
* Begin of SIR 301978
if i_lips[] is initial.
v_flag = 'X'.
message i089 with text-i02.
leave list-processing.
endif. " Return code for LIPS select
* End of SIR 301978
endif.
*-------------------------------------------------* Begin of SIR 061880
* Get Data From MARA (Material Master) to Read Material Weight and
* Material Voluem from Master Data.
if not i_lips[] is initial.
* Begin of SIR 301978
* Delete the duplicate material from delivery item table
i_temp_lips[] = i_lips[].
sort i_temp_lips by matnr.
delete adjacent duplicates from i_temp_lips comparing matnr.
perform get_data_mara. " SIR 301978
if sy-subrc = 0.
sort i_mara1 by matnr.
clear i_temp_lips.
refresh i_temp_lips.
* End of SIR 301978
else.
v_flag = 'X'.
message i089 with text-i01.
leave list-processing.
endif.
endif.
* Filter I_LIPS and I_MARA1 When Either material BU or Line of
* Business (LOB) or PAC1 are not left Balnk
perform filter_data_for_prdha.
* Get data for the sold-to customer
perform i_knvv_fill_data.
* Filter I_LIKP & I_LIPS & I_MARA for Cust-BU, When Cust-Bu is not
* left Blank.
perform filter_likp_lips_mara_custbu.
*---------------------------------------------------- End of SIR 061880
*-------------------------------------------------* Begin of SIR 034606
* Get data for the ship to party
i_temp_likp[] = i_likp[].
sort i_temp_likp by kunnr.
delete adjacent duplicates from i_temp_likp comparing kunnr.
perform get_data_kna1. " SIR 301978
if sy-subrc = 0.
sort i_kna1 by kunnr.
endif.
*---------------------------------------------------* End of SIR 034606
else.
v_flag = 'X'.
message i089 with text-i04.
leave list-processing.
endif. " return code to LIKP select
* endif. " SIR 061880
free: i_temp_likp.
endif. " return code for TVSWZ select
* Process table LIPS
if not i_lips[] is initial.
i_temp_lips[] = i_lips[].
sort i_temp_lips by vbeln.
delete adjacent duplicates from i_temp_lips comparing vbeln.
* Get actual weight
perform get_data_vepo. " SIR 301978
if sy-subrc = 0.
sort i_vepo by venum.
delete adjacent duplicates from i_vepo comparing venum.
perform get_data_vekp. " SIR 301978
sort i_vekp by vpobjkey.
endif.
free: i_vepo, i_temp_lips.
i_temp_lips[] = i_lips[].
sort i_temp_lips by matnr.
delete adjacent duplicates from i_temp_lips comparing matnr.
* Get Units of Measure for Material
perform read_data_from_marm. " SIR 061880
* Begin of SIR 032383
i_z0234_uom = i_z0234.
sort i_z0234_uom by zpaluom.
delete adjacent duplicates from i_z0234_uom comparing zpaluom.
* End of SIR 032383
clear i_marm_pallet. " SIR 061880
refresh i_marm_pallet. " SIR 061880
loop at i_z0234_uom into v_z0234_uom. "LOOP Z0234 032383
*-------------------------------------------------* Begin of SIR 061880
* Get Alternative Unit of Measure for Pallets
perform i_marm_pallet_fill.
endloop. "ENDLOOP Z0234 032383
** get alternative UoM for pallets
* SELECT MATNR " material
* MEINH " Alt unit of measure " 032383
* UMREZ " numerator
* UMREN " denominator
** into table i_marm_pallet " 032383
* APPENDING TABLE I_MARM_PALLET "032383
* FROM MARM
* FOR ALL ENTRIES IN I_TEMP_LIPS
* WHERE MATNR = I_TEMP_LIPS-MATNR AND
** meinh = v_z0234_zpaluom. " 032383
* MEINH = V_Z0234_UOM-ZPALUOM. " 032383
*---------------------------------------------------* End of SIR 061880
sort i_marm_pallet by matnr meinh.
free i_z0234_uom. "032383
i_z0234_uom = i_z0234. "032383
sort i_z0234_uom by zcsuom. "032383
delete adjacent duplicates from i_z0234_uom comparing zcsuom."32383
clear i_marm_case. " SIR 061880
refresh i_marm_case. " SIR 061880
loop at i_z0234_uom into v_z0234_uom. "LOOP Z0234 032383
*-------------------------------------------------* Begin of SIR 061880
* Get Alternative Unit of Measure for Cases
perform i_marm_case_fill.
endloop. "ENDLOOP Z0234 032383
*---------------------------------------------------* End of SIR 061880
sort i_marm_case by matnr meinh.
else.
v_flag = 'X'.
message i089 with text-i02.
* leave list-processing.
endif. " table LIPS is empty
endform. " get_data
* FORM CREATE_OUTPUT *
* process internal table LIPS, for each delivery/delivery lines create*
* an output record and collect into i_output internal table. Fields *
* used for header are goods issue date, acct assign, BU for customer, *
* total weight, total weight for shipping unit and count of *
* deliveries, the remaining fields will have a value of zero for the *
* collect. For each delivery line, fields used are goods issue date, *
* acct assign, BU for material, number of pallets, number of cases, *
* loose quantity and number of delivery lines. The remaining header *
* fiels will be zero for the collect. *
form create_output.
*-------------------------------------------------* Begin of SIR 061880
sort i_mara1 by matnr.
sort i_lips by vbeln posnr matnr.
sort i_likp by vbeln.
sort i_z0234 by vstel.
sort i_knvv by kunnr.
sort i_kna1 by kunnr.
sort i_vekp by vpobjkey.
sort i_marm_pallet by matnr meinh.
sort i_marm_case by matnr meinh.
* LOOP AT I_LIPS INTO V_LIPS.
loop at i_lips.
clear v_lips.
v_lips = i_lips.
*---------------------------------------------------* End of SIR 061880
at new vbeln.
perform collect_header_data.
endat.
if not v_lips-komkz is initial. " SIR 45567
perform collect_item_data.
endif. " SIR 45567
endloop.
endform. " create_output
* FORM COLLECT_HEADER_DATA *
* Fields used for header are goods issue date, acct assign, *
* BU for customer, total weight, total weight for shipping unit *
* and count ofdeliveries, the remaining fields will have a value of *
* zero for the collect. *
form collect_header_data.
clear: v_likp, v_knvv, v_vekp, v_vekp_sum_brgew.
v_ok = 'Y'.
read table i_likp into v_likp with key vbeln = v_lips-vbeln
binary search.
if sy-subrc = 0. " SIR 061880
clear v_z0234. "(+) SIR 301978
read table i_z0234 into v_z0234 "32383
with key vstel = v_likp-vstel "32383
binary search. "32383
read table i_knvv into v_knvv with key kunnr = v_likp-kunag
binary search.
if sy-subrc ne 0.
select single ktgrd kvgr1 into (v_knvv-ktgrd, v_knvv-kvgr1)
from knvv where kunnr = v_likp-kunag and
vkorg = v_likp-vkorg and
vtweg = '01' and " intercompany values
spart = '01'. " intercompany values
endif.
clear v_kna1. " SIR 34606
read table i_kna1 into v_kna1 " SIR 34606
with key kunnr = v_likp-kunnr " SIR 34606
binary search. " SIR 34606
read table i_vekp into v_vekp
with key vpobjkey(10) = v_likp-vbeln
binary search.
if sy-subrc = 0.
v_vekp_tabix = sy-tabix.
while v_ok = 'Y'.
if v_vekp-gewei_max ne c_uom.
perform z_unit_conversion
using v_vekp-brgew v_vekp-gewei_max c_uom v_palwto.
v_vekp_sum_brgew = v_vekp_sum_brgew + v_palwto.
else.
v_vekp_sum_brgew = v_vekp_sum_brgew + v_vekp-brgew.
endif.
v_vekp_tabix = v_vekp_tabix + 1.
read table i_vekp into v_vekp
index v_vekp_tabix.
if sy-subrc = 0.
if v_vekp-vpobjkey(10) ne v_likp-vbeln.
v_ok = 'N'.
endif.
else.
v_ok = 'N'.
endif.
endwhile.
endif.
endif. " SIR 061880
* populate output tables
clear: v_output_dt, v_output_ag,v_output_gs. " SIR 34606
v_output_dt-wadat_ist = v_likp-wadat_ist.
v_output_dt-ktgrd = v_knvv-ktgrd.
v_output_ag-ktgrd = v_knvv-ktgrd.
v_output_gs-ktgrd = v_knvv-ktgrd. " SIR 34606
*-------------------------------------------------* Begin of SIR 061880
* V_OUTPUT_DT-BU = V_KNVV-KVGR1.
* V_OUTPUT_AG-BU = V_KNVV-KVGR1.
* V_OUTPUT_GS-BU = V_KNVV-KVGR1. " SIR 34606
* Populate Business Unit,Line of Busness and PAC1 Values in Header Data
perform get_busunit_lobus_pac1_data1.
*---------------------------------------------------* End of SIR 061880
v_output_dt-kunnr = v_kna1-kunnr. " SIR 34606
* V_OUTPUT_AG-KUNNR = V_KNA1-KUNNR. " SIR 34606
v_output_dt-land1 = v_kna1-land1. " SIR 34606
v_output_ag-land1 = v_kna1-land1. " SIR 34606
v_output_dt-a_brgew = v_vekp_sum_brgew.
v_output_ag-a_brgew = v_vekp_sum_brgew.
v_output_gs-a_brgew = v_vekp_sum_brgew. " SIR 34606
if s_mbuun[] is initial and " SIR 61880
s_lobus[] is initial and " SIR 61880
s_pac1[] is initial. " SIR 61880
v_output_dt-num_del = 1.
v_output_ag-num_del = 1.
v_output_gs-num_del = 1. " SIR 34606
*-------------------------------------------------* Begin of SIR 061880
* Number of Packages
v_output_dt-packages = v_likp-anzpk.
v_output_ag-packages = v_likp-anzpk.
v_output_gs-packages = v_likp-anzpk.
else.
clear: v_output_dt-num_del,
v_output_ag-num_del,
v_output_gs-num_del,
v_output_dt-packages,
v_output_ag-packages,
v_output_gs-packages.
endif.
*---------------------------------------------------* End of SIR 061880
collect v_output_dt into i_output_dt.
collect v_output_ag into i_output_ag.
collect v_output_gs into i_output_gs. " SIR 34606
endform. " collect_header_data
* FORM COLLECT_ITEM_DATA *
* For each delivery line, fields used are goods issue date, *
* acct assign, BU for material, number of pallets, number of cases, *
* loose quantity and number of delivery lines. The remaining header *
* fiels will be zero for the collect. *
form collect_item_data.
clear: v_pallet_qty, v_pallet_integer,
v_case_qty, v_case_integer,
v_num_pallets, v_num_pallets_int,
v_num_cases, v_num_cases_int,
v_qty_not_pallets, v_total_case_qty, v_loose_qty.
read table i_marm_pallet into v_marm_pallet
with key matnr = v_lips-matnr
meinh = v_z0234-zpaluom binary search."32382
if sy-subrc = 0.
v_pallet_qty = v_marm_pallet-umrez / v_marm_pallet-umren.
* round down partial pallets
v_pallet_integer = v_pallet_qty - '.499'.
endif.
read table i_marm_case into v_marm_case
with key matnr = v_lips-matnr
meinh = v_z0234-zcsuom binary search."32382
if sy-subrc = 0.
v_case_qty = v_marm_case-umrez / v_marm_case-umren.
* round down partial cases
v_case_integer = v_case_qty - '.499'.
endif.
if v_pallet_integer > 0.
v_num_pallets = v_lips-lgmng / v_pallet_integer.
v_num_pallets_int = v_num_pallets - '.499'.
endif.
v_qty_not_pallets = v_lips-lgmng -
( v_num_pallets_int * v_pallet_integer ).
if v_case_integer > 0.
v_num_cases = v_qty_not_pallets / v_case_integer.
v_num_cases_int = v_num_cases - '.499'.
endif.
v_total_case_qty = v_num_cases_int * v_case_integer.
if v_qty_not_pallets = v_total_case_qty.
v_loose_qty = 0.
else.
v_loose_qty = 1.
endif.
* populate output tables
clear: v_output_dt, v_output_ag, v_output_gs. " SIR 34606
v_output_dt-wadat_ist = v_likp-wadat_ist.
v_output_dt-ktgrd = v_knvv-ktgrd.
v_output_ag-ktgrd = v_knvv-ktgrd.
v_output_gs-ktgrd = v_knvv-ktgrd. " SIR 34606
v_output_dt-kunnr = v_kna1-kunnr. " SIR 34606
* V_OUTPUT_AG-KUNNR = V_KNA1-KUNNR. " SIR 34606
v_output_dt-land1 = v_kna1-land1. " SIR 34606
v_output_ag-land1 = v_kna1-land1. " SIR 34606
*-------------------------------------------------* Begin of SIR 061880
* V_OUTPUT_DT-BU = V_LIPS-PRODH+1(2).
* V_OUTPUT_AG-BU = V_LIPS-PRODH+1(2).
* V_OUTPUT_GS-BU = V_LIPS-PRODH+1(2). " SIR 34606
* Populate Business Unit,Line of Business and PAC1 Values for Item Data.
perform get_busunit_lobus_pac1_data2.
if V_OUTPUT_DT-BU is initial.
clear V_OUTPUT_DT.
exit.
endif.
*---------------------------------------------------* End of SIR 061880
* get delivery weight from delivery lines instead of header " SIR 45567
if v_lips-gewei = c_uom.
v_output_dt-d_btgew = v_lips-brgew.
v_output_ag-d_btgew = v_lips-brgew.
v_output_gs-d_btgew = v_lips-brgew. " SIR 34606
else.
perform z_unit_conversion
using v_lips-brgew v_lips-gewei c_uom v_palwto.
v_output_dt-d_btgew = v_palwto.
v_output_ag-d_btgew = v_palwto.
v_output_gs-d_btgew = v_palwto. " SIR 34606
endif.
* Get material weight from delivery (LIPS)(IF P_DELWT = 'X')" SIR 38784
if p_delwt = 'X'. " SIR 38784
if v_lips-gewei = c_uom.
v_output_dt-m_brgew = v_lips-brgew.
v_output_ag-m_brgew = v_lips-brgew.
v_output_gs-m_brgew = v_lips-brgew. " SIR 34606
else.
perform z_unit_conversion
using v_lips-brgew v_lips-gewei c_uom v_palwto.
v_output_dt-m_brgew = v_palwto.
v_output_ag-m_brgew = v_palwto.
v_output_gs-m_brgew = v_palwto. " SIR 34606
endif.
else. " SIR 38784
* Get material weight from Master data (MARA) " SIR 38784
read table i_mara1 into v_mara " SIR 38784
with key matnr = v_lips-matnr " SIR 38784
binary search. " SIR 38784
if v_mara-gewei = c_uom. " SIR 38784
v_output_dt-m_brgew = v_mara-brgew * v_lips-lgmng. " SIR 38784
v_output_ag-m_brgew = v_mara-brgew * v_lips-lgmng. " SIR 38784
v_output_gs-m_brgew = v_mara-brgew * v_lips-lgmng. " SIR 38784
else. " SIR 38784
perform z_unit_conversion " SIR 38784
using v_mara-brgew v_mara-gewei c_uom v_palwto. " SIR 38784
v_output_dt-m_brgew = v_palwto * v_lips-lgmng. " SIR 38784
v_output_ag-m_brgew = v_palwto * v_lips-lgmng. " SIR 38784
v_output_gs-m_brgew = v_palwto * v_lips-lgmng. " SIR 38784
endif. " SIR 38784
endif. " SIR 38784
*-------------------------------------------------* Begin of SIR 061880
* To Get the Volume Data.
perform get_volume_data.
*---------------------------------------------------* End of SIR 061880
v_output_dt-num_pallets = v_num_pallets_int.
v_output_ag-num_pallets = v_num_pallets_int.
v_output_gs-num_pallets = v_num_pallets_int. " SIR 34606
v_output_dt-num_cases = v_num_cases_int.
v_output_ag-num_cases = v_num_cases_int.
v_output_gs-num_cases = v_num_cases_int. " SIR 34606
v_output_dt-num_loose = v_loose_qty.
v_output_ag-num_loose = v_loose_qty.
v_output_gs-num_loose = v_loose_qty. " SIR 34606
*{ INSERT D11K901833 1
* Sir 054042/48712 insert code to put in 0 instead of 1 for collect
* value for delivery lines
if v_lips-lgmng = 0.
v_output_dt-num_delln = 0.
v_output_ag-num_delln = 0.
v_output_gs-num_delln = 0.
else.
* end of insert for 054042/48712
*} INSERT
v_output_dt-num_delln = 1.
v_output_ag-num_delln = 1.
v_output_gs-num_delln = 1.Since this is your first post, let me clue you in. This forum is meant for asking very short and specific questions. For example, if you've asked, how could you improve a particular one SELECT statement, I'm sure many people would have helped you.
But you cannot seriously expect someone on this forum to spend his/her time and review such a long program. For this people are normally getting paid, you know. -
Warning this is very long code but i need help to see if I am on right trac
I have done all the following code myself and it is the buisiness layer for my application. I have tried to follow recommendations on previous posts and I would like to be told where I can clean up my code and how? This is not complete and it looks very long to me but I need help in order to be better. There are 4 button vlivks and I have not completed them all. The criteria for application is that phonebook will accept new entries if they have names surnames and phone numbers that are not longer than 10 characters for display purposes but can change this. No duplicates are allowed. No editing of a existing entry must lead to a duplicate entry either. No new entry or edit may result in a new contact having no phone numbers.
Many thanks for your time in advance,.....
import javax.swing.JOptionPane;
import java.util.ArrayList;
public class Contact
{// Start of the Contact class
ArrayList<ContactDetails> phoneList = new ArrayList<ContactDetails>(); // To hold all the contacts
ArrayList<ContactDetails> searchList = new ArrayList<ContactDetails>(); // To hold all contacts that return true on search
ArrayList<ContactDetails> list = new ArrayList<ContactDetails>();
String newName; // To hold the new name
String newSurname; // to hold the new surname
String newHome; // To hold the new home number if any
String newWork; // To hold the new work number
String newCell; // To hold the new cell number
final int MAX_LENGTH = 10;
public boolean addToPhoneList; // Sets to false if there is an invalid entry
public boolean addToSearchList; // Sets to false if there is an invlid search
public boolean modifyContact; // Sets to false if there is an invalid modification
// Method to create a new contact
public void createNew()
{// Start of create new()
addToPhoneList = true; // Set boolean to true each time the method is executed
getNewContactsName(); // Get new name
if(addToPhoneList == false)
createNew();
return;
getNewContactsSurname(); //Get new surname
if(addToPhoneList == false)
createNew();
return;
String checkName = newName; //Creates copies to be used in the checkIfDuplicate method
String checkSurname = newSurname;
addToPhoneList = checkIfDuplicate(checkName, checkSurname); //Check if the entries are duplicate
if(addToPhoneList == false)
createNew();
return;
getNewContactsHomeNum(); // Get new home number
if(addToPhoneList == false)
createNew();
return;
getNewContactsWorkNum(); // Get new work number
if(addToPhoneList == false)
createNew();
return;
getNewContactsCellNum(); // Get new cell number
if(addToPhoneList == false)
createNew();
return;
checkAtLeastOneNumEntered(); // Check that at least one phone number was entered
if(addToPhoneList == true)
updateListWithNew();
}// End of createNew()
// Method to search for an existing contact
public void searchExisting()
{// Start of searchExisting()
addToSearchList = true; // Set the boolean true
searchList.clear(); // Clear list from any previous searches
if(phoneList.size() > 0) // Check if any contacts are in the list
getExistingDetailsAndSearch(); // If there are entries then continue to search
else
JOptionPane.showMessageDialog(null,"There are no contacts to search for. Please use this option when you have added a contact to the list.","Error",JOptionPane.ERROR_MESSAGE);
}// End of searchExisting()
// Method to modify an existing contact
public void modifyExisting()
{// Start of modifyExisting()
modifyContact = true; // Set the boolean to true
if(phoneList.size() <= 0) // Check if the phonelist is not empty
JOptionPane.showMessageDialog(null,"There are no contacts to modify. Please use this option when there have been contacts added to the list.","Error",JOptionPane.ERROR_MESSAGE);
else
getExistingDetailsAndModify(); // If phonelist not emty continue to modify method
}// End of modifyExisting()
//Method to delete a contact from the list
public void deleteExisting()
//Method to get new contacts name
public void getNewContactsName()
newName = JOptionPane.showInputDialog("Please enter the new contacts name or press cancel to exit without saving.");
if(newName == null)
finish();
if(newName.trim().length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newName, "name");
//Method to get a new contacts surname
public void getNewContactsSurname()
newSurname = JOptionPane.showInputDialog("Please enter the new contacts surnname or press cancel to exit without saving.");
if(newSurname == null)
finish();
addToPhoneList = checkLengthValid(newSurname, "surname");
//Method to get a new contacts home number
public void getNewContactsHomeNum()
newHome = JOptionPane.showInputDialog("Please enter the new contacts home number or press cancel to exit without saving.");
if(newHome == null)
finish();
if(newHome.trim().length() > 0)
try
Long homeNum = Long.parseLong(newHome);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid phone number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newHome, "home number");
//Method to get a new contacst work number
public void getNewContactsWorkNum()
newWork = JOptionPane.showInputDialog("Please enter the new contacts work number or press cancel to exit without saving");
if(newWork == null)
finish();
if(newWork.trim().length()> 0)
try
Long workNum = Long.parseLong(newWork);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newWork, "work number");
//Method to get a new contacts cell number
public void getNewContactsCellNum()
newCell = JOptionPane.showInputDialog("Please enter the new contacts cell number or press cancel to exit without saving");
if(newCell == null)
finish();
if(newCell.trim().length() > 0)
try
Long cellNum = Long.parseLong(newCell);
catch(Exception e)
JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
return;
addToPhoneList = checkLengthValid(newCell, "cell number");
//Method to get the details for an existing contact
public void getExistingDetailsAndSearch()
String existingName = getExistingName("search for");
if(existingName == null)
addToSearchList = false;
return;
if(existingName.length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
addToSearchList = false;
searchExisting();
String existingSurname = getExistingSurname();
if(existingSurname == null)
return;
if(addToSearchList == true)
searchAndAddIfFound(existingName, existingSurname);
//Method to get existing details and modify contact
public void getExistingDetailsAndModify()
String existingName = getExistingName("modify");
if(existingName == null)
modifyContact = false;
return;
if(existingName.length()<=0)
JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
modifyContact = false;
modifyExisting();
String existingSurname = getExistingSurname();
if(existingSurname == null)
return;
if(modifyContact == true)
getContactBySearch(existingName.trim().toUpperCase(), existingSurname.trim().toUpperCase());
//Method to get the contact from list and modify details
public void getContactBySearch(String currentName, String currentSurname)
int count = 0;
int numFound = 0;
for(ContactDetails cd: phoneList)
cd = phoneList.get(count);
if((cd.name.equals(currentName))&&(cd.surname.equals(currentSurname)))
numFound ++;
changeDetails(cd);
count ++;
if(numFound <= 0)
JOptionPane.showMessageDialog(null,"No contacts matching the name and surname you entered found. Press the modify button to try again.","Information",JOptionPane.INFORMATION_MESSAGE);
//Method to get existing contacts name
public String getExistingName(String whatWasClicked)
String name = JOptionPane.showInputDialog("Please enter the contacts name that you wish to "+whatWasClicked);
return name;
//Method to get an existing contacts surname
public String getExistingSurname()
String surname = JOptionPane.showInputDialog("Please enter the contacts surname.");
return surname;
//Method to change the details of contact
public void changeDetails(ContactDetails conToChange)
String currentName = conToChange.name;
String currentSurname = conToChange.surname;
String currentHome = conToChange.home;
String currentWork = conToChange.work;
String currentCell = conToChange.cell;
String newNameForContact = getNewModName(currentName);
if(modifyContact == false)
modifyExisting();
return;
String newSurnameForContact = getNewModSurname(currentSurname);
if(modifyContact == false)
modifyExisting();
return;
String newHomeForContact = getNewModHome(currentHome);
if(modifyContact == false)
modifyExisting();
return;
String newWorkForContact = getNewModWork(currentWork);
if(modifyContact == false)
modifyExisting();
return;
String newCellForContact = getNewModCell(currentCell);
if(modifyContact == false)
modifyExisting();
return;
if(modifyContact == true)
conToChange.name = newNameForContact;
//Method to get the modified name
public String getNewModName(String currentName)
String newModifiedName = JOptionPane.showInputDialog("Please enter the new name for contact or press cancel to keep it as is.");
if(newModifiedName == null)
return currentName;
if(newModifiedName.trim().length() <= 0)
JOptionPane.showMessageDialog(null,"You may not replace the existing name with a blank name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
modifyContact = false;
return currentName;
modifyContact = checkLengthValid(newModifiedName, "modified name");
return newModifiedName;
//Method to get the modified surname
public String getNewModSurname(String currentSurname)
String newModifiedSurname = JOptionPane.showInputDialog("Please enter the new surname for the contact or press cancel to keep it as is.");
if(newModifiedSurname == null)
return currentSurname;
modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
if(modifyContact == false)
JOptionPane.showMessageDialog(null,"Surname not changed.","Information",JOptionPane.INFORMATION_MESSAGE);
return currentSurname;
modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
return newModifiedSurname;
//Method to search and update the list with a succesfull search
private void searchAndAddIfFound(String name, String surname)
int count = 0;
int numFound = 0;
for(ContactDetails cd: phoneList)
cd = phoneList.get(count);
if(cd.name.equals(name.trim().toUpperCase()))
numFound ++;
searchList.add(cd);
count ++;
if(numFound <= 0)
JOptionPane.showMessageDialog(null,"No contacts were found matching the dat you entered.","Information",JOptionPane.INFORMATION_MESSAGE);
else
list.clear();
list.addAll(searchList);
//Method that check all entries are a valid logical length
//Method is based on assumption that a normal name, surname, and phone numbers are not longer than 10 characters long.
//IF This method is changed please change the layout in the GUI as this is also set to fit with the layout that gives a neat //apperance
private boolean checkLengthValid(String detailEntered, String whatWasEntered)
boolean validLength = true;
if(detailEntered.trim().length() >= MAX_LENGTH)
JOptionPane.showMessageDialog(null,"The " +whatWasEntered+" you entered is too long. Please try again and use a "+whatWasEntered+" that is less than "+MAX_LENGTH+" characters long.","Error",JOptionPane.ERROR_MESSAGE);
validLength = false;
return validLength;
private void finish()
System.exit(0);
//Method to update the list with a new entry
private void updateListWithNew()
try
ContactDetails cd = new ContactDetails();
cd.name = newName.trim().toUpperCase();
cd.surname = newSurname.trim().toUpperCase();
cd.home = newHome.trim();
cd.work = newWork.trim();
cd.cell = newCell.trim();
phoneList.add(cd);
JOptionPane.showMessageDialog(null,"Contact succesfully entered. To save this change press exit to save or use the save option in the toolbar menu.","Information",JOptionPane.INFORMATION_MESSAGE);
catch(Exception e)
JOptionPane.showMessageDialog(null,"Failed to add contact to list. If problem persists please contact the software developer.","Error",JOptionPane.ERROR_MESSAGE);
list.clear();
list.addAll(phoneList);
//Method to check for duplicate
public boolean checkIfDuplicate(String nameToCheck, String surnameToCheck)
int count = 0;
boolean valid = true;
for(ContactDetails cd : phoneList)
cd = phoneList.get(count);
if(((nameToCheck.trim().toUpperCase()).equals(cd.name))&&((surnameToCheck.trim().toUpperCase()).equals(cd.surname)))
JOptionPane.showMessageDialog(null,"You may not enter a duplicate contact. Please try again and change the name and surname.","Error",JOptionPane.ERROR_MESSAGE);
valid = false;
break;
count ++;
return valid;
//Method to check that at least one phone number exists for contact
public void checkAtLeastOneNumEntered()
if((newHome.trim().length()<=0)&&(newWork.trim().length()<=0)&&(newCell.trim().length()<=0))
JOptionPane.showMessageDialog(null,"You have not entered any phone number at all. You must enter at least one phone number for a new contact.","Error",JOptionPane.ERROR_MESSAGE);
addToPhoneList = false;
//Method that returns the list to the GUI
public ArrayList<ContactDetails> getList()
return list;
}Should I start over from scratch? Can I get help with links to tutorials on following? How to create a java CRUD application (google not useful) and how to layer in java(google not useful)
This is my pres layer as is is this wrong too?
Filename: ContactsListInterface.java
Date: 16 March 2008
Programmer: Yucca Nel
Purpose: Provides a GUI for entering names and contact numbers into a telephone directory.
Also allows options for searching for a specific name and deleting of data from the record
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.io.*;
import java.util.*;
import java.text.*;
public class Phonebook1 extends JFrame implements ActionListener
{ //start of class
// construct fields, buttons, labels,text boxes, ArrayLists etc
JTextPane displayPane = new JTextPane();
JLabel listOfContacts = new JLabel("List Of Contacts"); // creates a label for the scrollpane
JButton createButton = new JButton("Create");
JButton searchButton = new JButton("Search");
JButton modifyButton = new JButton("Modify");
JButton deleteButton = new JButton("Delete");
Contact c = new Contact();
ArrayList<ContactDetails> contactList = c.getList();
// create an instance of the ContactsListInterface
public Phonebook1()
{ // start of cli()
super("Phonebook Interface");
} // end of cli()
public JMenuBar createMenuBar()
{ // start of the createMenuBar()
// construct and populate a menu bar
JMenuBar mnuBar = new JMenuBar(); // creates a menu bar
setJMenuBar(mnuBar);
JMenu mnuFile = new JMenu("File",true); // creates a file menu in the menu bar which is visible
mnuFile.setMnemonic(KeyEvent.VK_F);
mnuFile.setDisplayedMnemonicIndex(0);
mnuFile.setToolTipText("File Options");
mnuBar.add(mnuFile);
JMenuItem mnuFileExit = new JMenuItem("Save And Exit"); // creates an exit option in the file menu
mnuFileExit.setMnemonic(KeyEvent.VK_X);
mnuFileExit.setDisplayedMnemonicIndex(1);
mnuFileExit.setToolTipText("Close Application");
mnuFile.add(mnuFileExit);
mnuFileExit.setActionCommand("Exit");
mnuFileExit.addActionListener(this);
JMenu mnuEdit = new JMenu("Edit",true); // creates a menu for editing options
mnuEdit.setMnemonic(KeyEvent.VK_E);
mnuEdit.setDisplayedMnemonicIndex(0);
mnuEdit.setToolTipText("Edit Options");
mnuBar.add(mnuEdit);
JMenu mnuEditSort = new JMenu("Sort",true); // creates an option for sorting entries
mnuEditSort.setMnemonic(KeyEvent.VK_S);
mnuEditSort.setDisplayedMnemonicIndex(0);
mnuEdit.add(mnuEditSort);
JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name"); // to sort entries by name
mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
mnuEditSortByName.setDisplayedMnemonicIndex(8);
mnuEditSortByName.setToolTipText("Sort entries by first name");
mnuEditSortByName.setActionCommand("Name");
mnuEditSortByName.addActionListener(this);
mnuEditSort.add(mnuEditSortByName);
JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname"); // to sort entries by surname
mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
mnuEditSortBySurname.setToolTipText("Sort entries by surname");
mnuEditSortBySurname.setActionCommand("Surname");
mnuEditSortBySurname.addActionListener(this);
mnuEditSort.add(mnuEditSortBySurname);
JMenu mnuHelp = new JMenu("Help",true); // creates a menu for help options
mnuHelp.setMnemonic(KeyEvent.VK_H);
mnuHelp.setDisplayedMnemonicIndex(0);
mnuHelp.setToolTipText("Help options");
mnuBar.add(mnuHelp);
JMenuItem mnuHelpHelp = new JMenuItem("Help"); // creates a help option for help topic
mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
mnuHelpHelp.setDisplayedMnemonicIndex(3);
mnuHelpHelp.setToolTipText("Help Topic");
mnuHelpHelp.setActionCommand("Help");
mnuHelpHelp.addActionListener(this);
mnuHelp.add(mnuHelpHelp);
JMenuItem mnuHelpAbout = new JMenuItem("About"); // creates a about option for info about api
mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
mnuHelpAbout.setDisplayedMnemonicIndex(4);
mnuHelpAbout.setToolTipText("About this program");
mnuHelpAbout.setActionCommand("About");
mnuHelpAbout.addActionListener(this);
mnuHelp.add(mnuHelpAbout);
return mnuBar;
} // end of the createMenuBar()
// create the content pane
public Container createContentPane()
{ // start of createContentPane()
//construct and populate panels and content pane
JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
labelPanel.setLayout(new FlowLayout());
labelPanel.add(listOfContacts);
JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
setTabsAndStyles(displayPane);
displayPane = addTextToTextPane();
displayPane.setEditable(false);
JScrollPane scrollPane = new JScrollPane(displayPane);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
scrollPane.setPreferredSize(new Dimension(400,320));
displayPanel.add(scrollPane);
JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
workPanel.setLayout(new FlowLayout());
workPanel.add(createButton);
createButton.setToolTipText("Create a new entry");
createButton.addActionListener(this);
workPanel.add(searchButton);
searchButton.setToolTipText("Search for an entry by name number or surname");
searchButton.addActionListener(this);
workPanel.add(modifyButton);
modifyButton.setToolTipText("Modify an existing entry");
modifyButton.addActionListener(this);
workPanel.add(deleteButton);
deleteButton.setToolTipText("Delete an existing entry");
deleteButton.addActionListener(this);
labelPanel.setBackground(Color.red);
displayPanel.setBackground(Color.red);
workPanel.setBackground(Color.red);
// create container and set attributes
Container c = getContentPane();
c.setLayout(new BorderLayout(30,30));
c.add(labelPanel,BorderLayout.NORTH);
c.add(displayPanel,BorderLayout.CENTER);
c.add(workPanel,BorderLayout.SOUTH);
c.setBackground(Color.red);
// add a listener for the window closing and save
addWindowListener(
new WindowAdapter()
public void windowClosing(WindowEvent e)
int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
if(answer == JOptionPane.YES_OPTION)
System.exit(0);
return c;
} // end of createContentPane()
protected void setTabsAndStyles(JTextPane displayPane)
{ // Start of setTabsAndStyles()
// set Font style
Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
Style regular = displayPane.addStyle("regular", fontStyle);
StyleConstants.setFontFamily(fontStyle, "SansSerif");
Style s = displayPane.addStyle("bold", regular);
StyleConstants.setBold(s,true);
} // End of setTabsAndStyles()
public JTextPane addTextToTextPane()
{ // start of addTextToTextPane()
int numberOfEntries = contactList.size();
int count = 0;
Document doc = displayPane.getDocument();
try
{ // start of tryblock
// clear previous text
doc.remove(0,doc.getLength());
// insert titles of columns
doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
for(ContactDetails cd : contactList)
cd = contactList.get(count);
doc.insertString(doc.getLength(),cd.name+"\t"+cd.surname+"\t"+cd.home+"\t"+cd.work+"\t"+cd.cell+"\n",displayPane.getStyle("regular"));
count ++;
} // end of try block
catch(BadLocationException ble)
{ // start of ble exception handler
System.err.println("Could not insert text.");
} // end of ble exception handler
return displayPane;
} // end of addTextToTextPane()
// code to process user clicks
public void actionPerformed(ActionEvent e)
{ // start of actionPerformed()
String arg = e.getActionCommand();
// user clicks create button
if(arg.equals("Create"))
c.createNew(); // method to create a new Contact
addTextToTextPane();
if(arg.equals("Search"))
c.searchExisting(); // method to search for an existing entry
addTextToTextPane();
if(arg.equals("Modify"))
c.modifyExisting(); // method to modify contact
addTextToTextPane();
if(arg.equals("Delete"))
c.deleteExisting();
addTextToTextPane();
if(arg.equals("Exit"))
} // end of actionPerformed()
// method to create a new contact
public static void main(String[] args)
{ // start of main()
// Set look and feel of interface
try
{ // start of try block
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} // end of try block
catch(Exception e)
{ // start of catch block
JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
} // end of catch block
Phonebook1 pb = new Phonebook1();
pb.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
pb.setJMenuBar(pb.createMenuBar());
pb.setContentPane(pb.createContentPane());
pb.setSize(520,500);
pb.setVisible(true);
pb.setResizable(false);
} // end of main()
} //end of class -
How do i get my code to be applicable in a certain case
Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments i.e. pass execution onto SAP so to speak.
Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
Code:
method if_ex_hrbas00infty~before_output.
Ensure that this validation only occurs for this user
check sy-uname = 'LMANDIMIKA'.
If the function code is an insert then continue or stop otherwise
check pppar-fcode = 'INSE'.
*Data declarations
data: lt_hrp1001 type table of hrp1001,
ls_hrp1001 type hrp1001,
lv_sobid type sobid,
lv_sclas type sclas,
lv_rsign type rsign,
lv_relat type relat,
lv_plvar type plvar,
lv_otype type objid.
Clear the local table and local variables
refresh lt_hrp1001.
clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
*Take our data declarations and insert data elements from the new relationship which we are trying to create.
lv_sclas = old_innnn-vdata+0(2). "target object type
lv_sobid = old_innnn-vdata+2(10). "target object ID
lv_rsign = old_innnn-subty+0(1). "relationship direction
lv_relat = old_innnn-subty+1(3). "relationship type
lv_otype = old_innnn-otype.
lv_plvar = old_innnn-plvar. "planned version
*Check for existing relationships between a BP of that type with other external objects
select * from hrp1001 into table lt_hrp1001
where plvar = old_innnn-plvar
and sobid = lv_sobid
and sclas = lv_sclas
and rsign = lv_rsign
and relat = lv_relat
and otype = lv_otype.
*Loop through the table and compare the existing relationship with the new one
loop at lt_hrp1001
into ls_hrp1001.
Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
exit.
endif.
endloop.
endmethod.Hello kpmolinarivera,
The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/HT1311
Cheers,
Allen -
How do i get my code to be applicable in a certain case only
Greetings ABAPers. I would like to know the various ways in which i can get my code to be applicable in a certain case. Ive include the code below. I want the code to execute only when the object type is 'BP' for business partner. That is, i want my logic (code) to execute only when the object type is an external object (BP) otherwise it should be handled normally the way SAP handles internal objects. The tricky part for me isnt the actual check because i could have used the CHECK statement. The tricky part is how do i tell it to handle it the way SAP handles normal internal object assignments.
Any suggestions as to how i can clean up my code and improve my commenting is also greatly appreciated.
Code:
method if_ex_hrbas00infty~before_output.
Ensure that this validation only occurs for this user
check sy-uname = 'LMANDIMIKA'.
If the function code is an insert then continue or stop otherwise
check pppar-fcode = 'INSE'.
*Data declarations
data: lt_hrp1001 type table of hrp1001,
ls_hrp1001 type hrp1001,
lv_sobid type sobid,
lv_sclas type sclas,
lv_rsign type rsign,
lv_relat type relat,
lv_plvar type plvar,
lv_otype type objid.
Clear the local table and local variables
refresh lt_hrp1001.
clear: lv_sobid, lv_sclas, lv_rsign, lv_relat, ls_hrp1001, lv_plvar, lv_otype.
*Take our data declarations and insert data elements from the new relationship which we are trying to create.
lv_sclas = old_innnn-vdata+0(2). "target object type
lv_sobid = old_innnn-vdata+2(10). "target object ID
lv_rsign = old_innnn-subty+0(1). "relationship direction
lv_relat = old_innnn-subty+1(3). "relationship type
lv_otype = old_innnn-otype.
lv_plvar = old_innnn-plvar. "planned version
*Check for existing relationships between a BP of that type with other external objects
select * from hrp1001 into table lt_hrp1001
where plvar = old_innnn-plvar
and sobid = lv_sobid
and sclas = lv_sclas
and rsign = lv_rsign
and relat = lv_relat
and otype = lv_otype.
*Loop through the table and compare the existing relationship with the new one
loop at lt_hrp1001
into ls_hrp1001.
Check that the end date for the existing relationship is after (greater than) the start date for the new relationship.
if ls_hrp1001-endda > old_innnn-begda and ls_hrp1001-begda < old_innnn-endda.
message e004(/cco/a3_msg) with lv_relat lv_sobid '' ''.
exit.
endif.
endloop.
endmethod.
Edited by: Lovemore Mandimika on May 14, 2008 10:36 AMHello kpmolinarivera,
The iTunes Store country can be changed in Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/HT1311
Cheers,
Allen -
The company that i work for has recently acquired a new
product and I have been assigned to work on the documentation. The
legacy docs that we have received ar so big that I've never come
across such big help files. For example, there's one project that
has about 1400 topics and it's total size is 265 mb. Thetre are at
least 10 more projjects.
I opened one topic and realized that the people who worked on
it before me embedded the style info in the HTM code.Before i add
the new features etc. I would like to trim the file sizes. Cleaning
up each file manually is going to take a lifetime, can you guys
suggest some automated tasks that will make my task a bit easier?
Much Appreciate.Hi dsind and welcome to the RH community.
Your task of cleaning up the code could be difficult and time
consuming. You may be able to use a find and replace tool (
FAR is my own personal
favourite) but the problem you will have in the syntax of the
styles used in the code. Is there a pattern to the code used? if
not, the easiest option may be to manually go through each topic.
You could "trap" the majority of topics using a find and replace
tool first and then look at those topics that are trapped.
BTW 1400 topics is not particularly big so don't
worry. -
Remove white space and indent code in Dreamweaver CS5
Ive inherited some code which has loads of randomly placed spaces and line breaks. With Dreamweaver CS5 is it possible to clean up the code so its nicely indent like this?:
<div>
<div>
<div>
</div>
</div>
</div>Yes, you can have Dreamweaver indent your code by going to the "Format Source Code" button on the toolbar and selecting "Apply Source Formatting".
You can edit the way that your text is formatted in Preferences > Code Format -
Does Flex Builder remove unused code?
Hi, I have alot of dead code in app that is resulting in an unnecessarily large SWF. Is there a way to make the flex compiler remove unused functions?
Although tedious, drkstr_1 has the plan of action. Generally you should need to clean up orphaned code and remove all trace statements. I often see the tracing statements of other Flash Player products when doing development and some are quite revealing if not embarrasing.
Also "unnecessarily large swf" begs the question what is large? If in Flash IDE did you run the bandwidth report to see exactly what makes it "unnecessarily large swf". You see this option in the publish settings.
Typically code is not going to make a "unnecessarily large swf" but rather digital assets embedded and fonts embedded. Code could make it "unnecessarily large swf" if there are lots of libraries you are using and you are only using some tiny part of the library which you could refactor or find a snippet on the net.
Last "unnecessarily large swf" in relation to what bandwidth? Do you have a targeted minimum bandwidth to make the assessment "unnecessarily large swf"? -
How to beautify Java source code
Hello!
I'm mostly a Java developer, and I recently moved my projects to XCode. I was using jEdit previously, with a lot of plugins. I specially miss:
* the ability to do vertical selections (jEdit, TextMate)
* Gruntspud CVS plugin - but this can be run standalone, and I configured the default action to be /usr/bin/open so it opens the source and project files in Xcode.
* and JavaStyle !!! This plugin "beautifies" Java source code. Sometimes, tabs are messed up and I want to clean up the code.
Is there any JavaStyle-like plugin for XCode?* the ability to do vertical selections (jEdit,
TextMate)
Supposedly you can install 3rd party editors in Xcode. I have never done it though.
* Gruntspud CVS plugin - but this can be run
standalone, and I configured the default action to be
/usr/bin/open so it opens the source and project
files in Xcode.
Xcode comes with a CVS plug in. Have you tried turning on SCM for your project?
* and JavaStyle !!! This plugin "beautifies" Java
source code. Sometimes, tabs are messed up and I want
to clean up the code.
I expect that a Java tool like JavaStyle would run from the command line. If so, you can probably wrap it in a script and install it in Xcode's script menu. -
CSS code completely fouled up by CSS designer
I'm having a bunch of bugs with Dreamewaver CC. Inserting images in code view or in design view always places them in the wrong place. For example inserting an image using Cmnd/Ctrl + Alt/Option + i with the cursor placed before paragraph 1 will insert the image after the last paragraph in the document or some other random place in the page. The only thing that kind of works is that the insert stays in the right div.
That's not the worst of it. I made a few edits to a fluid layout using the new CSS design panel and all of the line feeds and line breaks have dissapeared making the code extremely hard to read, troubleshoot and edit. Has anyone seen this?
Here's what the code looks like now:
@charset "UTF-8";
/* Simple fluid media Note: Fluid media requires that you remove the media's height and width attributes from the HTML http://www.alistapart.com/articles/fluid-images/ */
img, object, embed, video { max-width: 95%; margin-left: auto; margin-right: auto; display: block;}/* IE 6 does not support max-width so default to width 100% */.ie6 img { width:100%; }/* Dreamweaver Fluid Grid Properties ---------------------------------- dw-num-cols-mobile: 4;dw-num-cols-tablet: 8;dw-num-cols-desktop: 14;dw-gutter-percentage: 15;Inspiration from "Responsive Web Design" by Ethan Marcotte http://www.alistapart.com/articles/responsive-web-design and Golden Grid System by Joni Korpi http://goldengridsystem.com/*/body { background:#333; }.fluid { clear: both; margin-left: 0; width: 100%; float: left; display: block; }.fluidList { list-style:none; list-style-image:none; margin:0; padding:0; } /* Mobile Layout: 480px and below. */ .gridContainer { margin-left: auto; margin-right: auto; width: 96.7391%; padding-left: 1.6304%; padding-right: 1.6304%; clear: none; float: none;}#mainHeader { width: 100%; border-bottom: thin dotted #666666; background-color: #FFFFFF;} #headerHome { width: 100%; margin-left: 0; } #mainTitle { width: 100%; margin-left: 0; clear: both; display: none; }#mainNav { width: 100%; clear: both; margin-left: 0; }#mainNavList { width: 100%; margin-left: 0; }.manNavBtn { width: 48.3146%; clear: none; margin-left: 3.3707%; }#sideNav { width: 100%; background-color: #FFFFFF; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;}#mainArticle {
width: 100%;
clear: both;
background-color: #FFFFFF;
}#adSide { width: 100%; clear: both; margin-left: 0; background-color: #FFFFFF;}# mainFooter {}#footer {}.zeroMargin_mobile {margin-left: 0; }.hide_mobile {display: none; }/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */@media only screen and (min-width: 481px) {.gridContainer { width: 93.451%; padding-left: 0.7744%; padding-right: 0.7744%; clear: none; float: none; margin-left: auto; }# div1 {}#mainHeader { width: 100%; border-bottom: thin dotted #666666; }#headerHome {width: 36.464%; margin-left: 0; }#mainTitle {width: 61.8784%; clear: none; margin-left: 1.6574%; display: block; }#mainNav { width: 61.8784%; margin-left: 1.6574%; clear: none; float: right; }#mainNavList {width: 100%; margin-left: 0; }.manNavBtn {width: 17.8571%; margin-left: 2.6785%; clear: none; }#sideNav {width: 11.0497%; }#mainArticle {width: 61.8784%; margin-left: 1.6574%; clear: none; }#adSide {width: 23.7569%; margin-left: 1.6574%; clear: none; }#mainFooter {}#footer {}.hide_tablet {display: none; }.zeroMargin_tablet {margin-left: 0; }}/* Desktop Layout: 769px to a max of 1232px. Inherits styles from: Mobile Layout and Tablet Layout. */@media only screen and (min-width: 769px) {.gridContainer { width: 94.1149%; max-width: 1000px; padding-left: 0.4425%; padding-right: 0.4425%; margin: auto; clear: none; float: none; margin-left: auto; }#div1 {}#mainHeader {width: 100%; }#headerHome {width: 20.6896%; margin-left: 0; }#mainTitle {width: 78.3699%; clear: none; margin-left: 0.9404%; display: block; }#mainNav { width: 78.3699%; clear: none; margin-left: 0.9404%; float: right; }#mainNavList {width: 100%; margin-left: 0; }.manNavBtn {width: 17.2%; clear: none; margin-left: 1.2%; }#sideNav {width: 20.6896%; }#mainArticle {width: 49.5297%; clear: none; margin-left: 0.9404%; }#adSide {width: 27.8996%; clear: none; margin-left: 0.9404%; }#mainFooter {}#footer {}.zeroMargin_desktop {margin-left: 0; }.hide_desktop {display: none; }}#mainArticle img { border: thin solid #333333; border-radius: 6px; -webkit-box-shadow: 0px 0px; box-shadow: 0px 0px; padding: 5px 5px 8px; background-color: #E9E9E9;}
Does anyone have any ideas about how to fix this and turn it back into readable code without going through each line and looking for natural breaks?
What a mess.
Mac, OSX 10.8.4, Dreamweaver 13.0 Build 6391
NOTE: If I use something like Styleneat to clean up this code it seems to break the styles for the Mobile and Tablet layouts and causes Dreamweaver to crash every time I turn on or off the fluid grid layout display.Does anyone have any ideas about how to fix this and turn it back into readable code without going through each line and looking for natural breaks?
What a mess.
mg, object, embed, video { max-width : 95%;
margin-left : auto;
margin-right : auto;
display : block;
.ie6 img {
width : 100%;
body {
background : #333;
.fluid {
clear : both;
margin-left : 0;
width : 100%;
float : left;
display : block;
.fluidList {
list-style : none;
list-style-image : none;
margin : 0;
padding : 0;
.gridContainer {
margin-left : auto;
margin-right : auto;
width : 96.7391%;
padding-left : 1.6304%;
padding-right : 1.6304%;
clear : none;
float : none;
#mainHeader {
width : 100%;
border-bottom : thin dotted #666666;
background-color : #FFFFFF;
#headerHome {
width : 100%;
margin-left : 0;
#mainTitle {
width : 100%;
margin-left : 0;
clear : both;
display : none;
#mainNav {
width : 100%;
clear : both;
margin-left : 0;
#mainNavList {
width : 100%;
margin-left : 0;
.manNavBtn {
width : 48.3146%;
clear : none;
margin-left : 3.3707%;
#sideNav {
width : 100%;
background-color : #FFFFFF;
border-bottom-right-radius : 4px;
border-bottom-left-radius : 4px;
#mainArticle {
width : 100%;
clear : both;
background-color : #FFFFFF;
.zeroMargin_mobile {
margin-left : 0;
.hide_mobile {
display : none;
@media only screen and (min-width:481px) {
#mainHeader { width : 100%;
border-bottom : thin dotted #666666;
#headerHome {
width : 36.464%;
margin-left : 0;
#mainTitle {
width : 61.8784%;
clear : none;
margin-left : 1.6574%;
display : block;
#mainNav {
width : 61.8784%;
margin-left : 1.6574%;
clear : none;
float : right;
#mainNavList {
width : 100%;
margin-left : 0;
.manNavBtn {
width : 17.8571%;
margin-left : 2.6785%;
clear : none;
#sideNav {
width : 11.0497%;
#mainArticle {
width : 61.8784%;
margin-left : 1.6574%;
clear : none;
#adSide {
width : 23.7569%;
margin-left : 1.6574%;
clear : none;
.hide_tablet {
display : none;
.zeroMargin_tablet {
margin-left : 0;
@media only screen and (min-width:769px) {
.gridContainer { width : 94.1149%;
max-width : 1000px;
padding-left : 0.4425%;
padding-right : 0.4425%;
margin : auto;
clear : none;
float : none;
margin-left : auto;
#mainHeader {
width : 100%;
#headerHome {
width : 20.6896%;
margin-left : 0;
#mainTitle {
width : 78.3699%;
clear : none;
margin-left : 0.9404%;
display : block;
#mainNav {
width : 78.3699%;
clear : none;
margin-left : 0.9404%;
float : right;
#mainNavList {
width : 100%;
margin-left : 0;
.manNavBtn {
width : 17.2%;
clear : none;
margin-left : 1.2%;
#sideNav {
width : 20.6896%;
#mainArticle {
width : 49.5297%;
clear : none;
margin-left : 0.9404%;
#adSide {
width : 27.8996%;
clear : none;
margin-left : 0.9404%;
.zeroMargin_desktop {
margin-left : 0;
.hide_desktop {
display : none;
#mainArticle img { border : #333333 solid thin;
border-radius : 6px;
box-shadow : 0 0;
padding : 5px 5px 8px;
background-color : #E9E9E9; -
Trying to delete widget code and stop Error message
I am a little new to CS4: and receiving an validation error message on a page about a accordion widget still being on my page and ppotential problems at runtime. I look and it is greyed out so i am not able to remove(delete) the error offending line. I had originally removed the accordion widget on purpose but in the process of removing everything else ( script, etc.) I think I did the removal in the wrong sequence or something.
Can anyone please give me suggestions on how I might fully remove this widget error line so I can clean up my code and ensure a clean run.
thxhere is the message I receive when I open the page in CS4
This document contains javascript code of a widget that no longer exists.
If you don't remove the code, the browser might displayjavascript errors when loading the page.
would you like Dreamweaver to find all instances of this code for you???
widget:var Accordion1=newSpry.Widget.Accordion("cmp_panningcards")
then shows line inside code, but grayed out so I cannot delete.... -
Flash-style Dreamweaver code formatter?
Is there some formatter I can use to visually clean up my
code in the same way that flash indents certain tags? Maybe a html
text editor someone can recommend or even something hidden within
dreamweaver?
ThanksCOMMANDS Apply Source Formatting
"15266" <[email protected]> wrote in message
news:e69euq$3ek$[email protected]..
> Is there some formatter I can use to visually clean up
my code in the same
> way
> that flash indents certain tags? Maybe a html text
editor someone can
> recommend
> or even something hidden within dreamweaver?
>
> Thanks
>
Maybe you are looking for
-
Inserting/ deleting a line item in MIGO Transaction ( Goods Issue )?
Hi, Can anyone help me with the logic for Inserting / deleting a line item in MIGO Transaction? Thanks, cs
-
CO46/MD4C - see 2 receipt elements (ShipNt & PchOrd) for one demand
Scenario: Production Order for 10 ea for 'A' with a purchased material 'x'. The supplier confirms 5 ea of material 'x' have left the dock and I make a shipping notiication calculating expected delivery date and update MRP. I now have 2 receipt elemen
-
Shuffle within playlist?
Is it possible to shuffle songs just within a playlist? I have lots of other songs on Ipod, but wanted to just shuffle through one of my playlists. Any help appreciated! Thanks
-
I was charged $21.09 for an application which I thought was $1.99. Where should or how can a rectify this purchase?
-
Facetime can't find my camera on a MBA original
I have 10.6.4 installed and when I run Facetime it says "Facetime requires a supported camera". I have an original MacBook Air. I also rebooted after installing FT.