How to clear a line of ImageIcons like in tetris?

If I have a JPanel with different ImageIcons in it like tetris and if the line is filled it will be removed. Does anyone know how i can redraw the area occupied by the ImageIcons? should I redraw the entire panel "down " to overlap it? Thanks

Load your images with ImageIO.read(url_file_inputStream) to get BufferedImages.
There are two general approaches to something like this. One is using components: JLabels
set in a layout manager that forms a grid (eg, GridLayout or GridBagLayout). You set the
images in the labels with setIcon(new ImageIcon(image)). To get the image to disappear use
setIcon(null).
The other approach is a graphic approach in which you draw everything. Here is an example
of how you could put this together with this second approach:
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.BufferedImage;
import javax.swing.*;
public class DrawingControl extends JPanel {
    BufferedImage[] images;
    boolean[] showRows;
    int size = 5;
    final int PAD = 25;
    public DrawingControl() {
        initImages();
        showRows = new boolean[size];
        for(int j = 0; j < showRows.length; j += 2)
            showRows[j] = true;
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        int w = getWidth();
        int h = getHeight();
        // Draw a centered grid.
        double xInc = (double)(w - 2*PAD)/size;
        double yInc = (double)(h - 2*PAD)/size;
        g2.setPaint(Color.red);
        for(int j = 0; j <= size; j++) {
            double y = PAD + j*yInc;
            for(int k = 0; k <= size; k++) {
                g2.draw(new Line2D.Double(PAD, y, w-PAD, y));
        for(int j = 0; j <= size; j++) {
            double x = PAD + j*xInc;
            for(int k = 0; k <= size; k++) {
                g2.draw(new Line2D.Double(x, PAD, x, h-PAD));
        // Draw images in visible rows.
        int iw = images[0].getWidth();
        int ih = images[0].getHeight();
        for(int j = 0; j < size; j++) {
            if(!showRows[j])
                continue;
            for(int k = 0; k < size; k++) {
                int n = (j*size + k) % images.length;
                int x = (int)(PAD + k*xInc + (xInc-iw)/2);
                int y = (int)(PAD + j*yInc + (yInc-ih)/2);
                g2.drawImage(images[n], x, y, this);
    private void initImages() {
        int s = 40, type = BufferedImage.TYPE_INT_RGB;
        images = new BufferedImage[4];
        double theta = 0;
        AffineTransform at = new AffineTransform();
        for(int j = 0; j < images.length; j++) {
            images[j] = new BufferedImage(s, s, type);
            Graphics2D g2 = images[j].createGraphics();
            g2.setBackground(Color.orange);
            g2.clearRect(0,0,s-1,s-1);
            g2.setPaint(Color.blue);
            g2.drawRect(0,0,s-1,s-1);
            g2.setStroke(new BasicStroke(4f));
            at.setToRotation(theta, s/2, s/2);
            g2.setTransform(at);
            g2.setPaint(Color.green.darker());
            g2.drawLine(10,s/2,s/2,s-10);
            g2.drawLine(s/2,s-10,s-10,s/2);
            g2.dispose();
            theta += Math.PI/2;
    public static void main(String[] args) {
        DrawingControl test = new DrawingControl();
        test.addMouseListener(test.rowToggle);
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(test);
        f.setSize(400,400);
        f.setLocation(200,200);
        f.setVisible(true);
    private MouseListener rowToggle = new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
            Point p = e.getPoint();
            int w = getWidth();
            double h = getHeight();
            if(p.x > PAD && p.x < w-PAD && p.y > PAD && p.y < h-PAD) {
                double yInc = (h - 2*PAD)/size;
                int row = (int)((p.y - PAD)/yInc);
                showRows[row] = !showRows[row];
                repaint();
}

Similar Messages

  • How to clear the line items once posted...

    hello experts,
    i m workiing on Enhancements in fi/co...i m not able to get the actual exit..
    How to clear the line items once postings has been done...i.e. once v do postings in f-48 v assign an assignment with special GL a/c as 'A'(one line item generates)....and in Tr.code f-43 once the due as been settled i.e the payment as been done and same assignment has to be given(2nd line item generates) it has to clear with the transaction f.13.but it is not..there is a report program to check fbl1n(tr.code)...once it is cleared it is shown in cleared items else it is shown in open items.....can any one help me out...
    i m providing the tech names of the fields...
    same program for both the transactions-- sapmf05a screen no for f-48--304 and
    f-43 ---110....
    Assignment --- BSEG-ZUONR....AMOUNT ---(cluster table) BSEG-WRBTR....
    SPECIAL GL A/C RF05A-UMSKZ(structure)
    thanks n regards,
    vamshi

    The prerequisites are:
    1) In the customer master sales area data, shipping tab, there is a field called Order combination. u must tick that.
    2) for the two orders, the sold to party & ship to party must be same
    3) both orders must have created from same plant & shipping points
    4) the line items must have same loading grp.
    5) the both orders sheduline line date must be same.
    transaction code for the same is VL04.
    enter the required data and select the order nos to be processed.
    Do reward points if it is useful

  • How to clear the line items...

    hello friends,
    I am not able to clear line items with F.13 transaction for special G/L Account..i am inputing the values with the Transactions F-48 and F-43(In each transaction v have assigned the same assignment (BSIK-ZUONR)) line items has to be cleared based on Assignment....we can view the details in Tr.code-FBL1N.
    Can any one help me...plzzz
    vamshi

    Hi PK,
    1. Should we maintain OIM for all Excise G/Ls (BED, ECess, SHECess)?
    - Please DO NOT maintain OIM on BED, ECESS and HECESS, only to be maintained for Cenvat Clearing Account. Also note that clearing of Cenvat Clearing is not easy, as in standard SAP, the assignment field is not updated with the same information for the Dr. and cr. line items of Cenvat Clearing Account. You need to use an exit in Substitution for it to populate the P.O. no. and line item at the time of MIRO.
    2. How to clear the BED Excise GLs which is with OIM in our system, it is thru F.13 only?
    You can use F.13 only if the entries are matching not otherwise, else clear all of them manually if you have good control of your account balances.
    3. Can we activate or deactivate OIM any point of time, I mean can it be activated in case the G/L balance amount is not ZERO?
    OIM activation for a GL - Refer Note No.1356457.
    OIM Deactivation :  You can deactivate OIM after making the balance Zero on that Account and by changing the Message No. FH 190 to warning in OBA5.
    4. What is the use of T Code J2IUN, I have gone thru the SDN links, but I am not able to execute the screen. What parameter should we select while executing J2IUN, when we use Pay cenvat from ser tax cr and Pay ser tax from cenvat cr.
    J2IUN is to utllize Excise Duty. The liability of Excise duty is utilized from Excise balances of BED, PLA , Service tax etc.. as per business requirements.
    Hope this helps you.
    Regards,
    SAPFICO

  • How to clear overlay line

    I would like to clear a line drawn using IMAQ Overlay Line without clearing all overlays (using IMAQ Clear Overlay).  I tried using Overlay Line with the Transparent color (using the same line coordinates) and this did not work.  Anyone have any suggestions?
    Thanks

    Sandor a écrit:
    I would like to clear a line drawn using IMAQ Overlay Line without clearing all overlays (using IMAQ Clear Overlay).  I tried using Overlay Line with the Transparent color (using the same line coordinates) and this did not work.  Anyone have any suggestions?
    Thanks
    A simple trick is to copy the overlay to another empty image, and to copy back this overlay to erase any posterior modification. The attached vi demonstrate this solution. An alternative would be to construct an array in witch all the additions to the overlay would be stored, and to redraw the overlay from scratch using this array.
    Message Edité par chilly charly le 08-31-2005 05:38 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Save Overlay.vi ‏93 KB

  • Enhancement on fi/co to clear the line items...

    hello experts,
    i m workiing on Enhancements in fi/co...i m not able to get the actual exit..
    How to clear the line items once postings has been done...i.e. once v do postings in f-48 v assign an assignment with special GL a/c as 'A'(one line item generates)....and in Tr.code f-43 once the due as been settled i.e the payment as been done and same assignment has to be given(2nd line item generates) it has to clear with the transaction f.13.but it is not..there is a report program to check fbl1n(tr.code)...once it is cleared it is shown in cleared items else it is shown in open items.....can any one help me out...
    i m providing the tech names of the fields...
    same program for both the transactions-- sapmf05a screen no for f-48--304 and
    f-43 ---110....
    Assignment --- BSEG-ZUONR....AMOUNT ---(cluster table) BSEG-WRBTR....
    SPECIAL GL A/C RF05A-UMSKZ(structure)
    thanks n regards,
    vamshi
    **highly rewarded**

    hi Vamshi,
    chekc if on the selection screen of F.13 the special G/L transactions are properly selected. Also check the customizing for automatic clearing (i. e. which fields have to match).
    ec

  • My IMac has wavy lines covering the screen that look like multiple miniature calendars and I want to know how to clear them?

    My IMac has wavy lines that look like multiple quotatient marks or tiny calendars that cover the screen. How do I get rid of them?

    Does a command-shift-3 show the information in an image?  If it does, then post it here using this tip:
    https://discussions.apple.com/docs/DOC-6917

  • Does anyone know how to get a white line across text like the USA basketball logo?

    does anyone know how to get a white line across text like the USA basketball logo?

    Draw the shape which is to be knocked out (a line in the example) in a layer above the logo. The colour doesn't matter because it will be made invisible.
    Double-click in the space to the right of the layer's name in Layers panel to open its Layer Style window where advanced blending can be modified.
    Set Fill Opacity to zero and Knockout to "Deep" or "Shallow" depending on whether the knockout should be limited to a containing Group.

  • How do u get past network an password it says network not avalible on start up , bought on line showed up like this can't get in to reset

    How do u get past network an password it says network not avalible on start up , bought on line showed up like this can't get in to reset

    Try going to system preferences on the Apple menu,>start up disk.select mac osx hd restart.  If you can't get there, hold theoption key when you power up, this will open the start up manager, select the mac osx hd. click the arrow under i and it should boot to the internal drive.  If you don't the password, you will need the install disks to change it.

  • How can I get two lines mail list like Windows Live Mail and How can I get to, cc, bcc lines like Windows Live Mail?

    I wish to move Thunderbird. But i have two main problem.
    * I want two lines mail lis like Live Mail,
    * I want to, cc, bcc line like Live Mail. I mean when, I write an e-mail address I will key "," (or another character) then I will enter next email address. Auto address completion must work for each address which I enter the address line.
    Can i do those on Thunderbird?
    I searched on the internet and there are much people who want this features.
    Thanks..

    I see the dropdown menus for CC and BCC, but they don't work. I click on them and there is no response except the name I already had in the "TO" field disappears! The attached screenshots shows the name in the "to" field, then the result after choosing "add CC" - the "to" name disappears.

  • How to clear all overrides in a story

    Hi Everyone!
    I've been putting together a short script to clear all overrides in a story in which I have a cursor inserted. This is what I have so far:
    //Clear all overrides in the story of the text selection:
    app.selection[0].paragraphs.everyItem().clearOverrides();
    //Clear overrides in all cells of all tables of the story of the text selection:
    try {
      app.selection[0].parentStory.tables.everyItem().cells.everyItem().texts[0].clearOverrides();
    catch (e) {}
    It works well enough, but I have to select all to clear the overrides on paragraph styles. If I don't select anything, only the style overrides in tables are cleared.
    How would I modify line 2 to work the same as line 6? I've tried a few different things, but no dice!
    I'm going to make this another question:
    Can anyone suggest a good recent book or online resource to start learning scripting for Indesign?
    I've been loving what we can do with scripts, but I want to start understanding what I'm doing, not just how to do it.
    Thanks a bunch!
    Amy

    Hi,
    In case of modifying a code:
    clearOverrides() is a method ==> it means some procedure will be executed (simple or pretty complex).
    the target for this method is placed before it ==> here it is every paragraph which can be reached basing on selection.
    So your goal is to change a target to parentStory, I guesss.
    Modified line should look like:
    app.selection[0].parentStory.clearOverrides();
    It will work till selection has a property parentStory. A graphic frame - which also can be selected - has not, so code will end with an error.
    How to detect available object's properties and methods?
    Exam this huge help files published by [Jongware] here:
    Indesign JavaScript Help
    many help PDFs can be googled. Just try. I recommend Peter Kahrel books (any you can google out - in fact )
    Jarek

  • How to display horizontal line in top-of-page by using object oriented ALV?

    How to display horizontal line in top-of-page by using object oriented ALV.
    I am created top-of-page in object oriented alv.
    But not be successes in showing horizontal line in it.
    Can any one pls give solution for this..
    Thanks and regards..

    Hi
    Try like this
    data: gt_list_top_of_page type slis_t_listheader. " Top of page text. 
    Initialization. 
    perform comment_build using gt_list_top_of_page[]. 
    form top_of_page. 
    * Note to self: the gif must be loaded into transaction OAOR with 
    * classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions. 
    * I Loaded NOVALOGO2 into system. 
    call function 'REUSE_ALV_COMMENTARY_WRITE' 
         exporting 
    * I_LOGO = 'NOVALOGO2' 
    * i_logo = 'ENJOYSAP_LOGO' 
             it_list_commentary = gt_list_top_of_page. 
    endform. " TOP_OF_PAGE 
    form comment_build using e04_lt_top_of_page type slis_t_listheader. 
    data: ls_line type slis_listheader. 
          clear ls_line. 
          ls_line-typ = 'A'. 
          ls_line-info = 'Special'(001). 
          fgrant = xgrant. 
          concatenate ls_line-info fgrant 
          'Stock Option Report to the board'(002) 
                 into ls_line-info separated by space. 
                        condense ls_line-info. 
          append ls_line to e04_lt_top_of_page. 
    endform. " COMMENT_BUILD
    Use following syntex for footer print in alv:
    * For End of Page
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *  For End of Report
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    check this link
    http://abapprogramming.blogspot.com/
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
    Changing width of a custom container dynamically
    Display Page numbers in ALV
    Insert picture in selection screen.
    Logo in OO ALV Grid
    Reward all helpfull answers
    Regards
    Pavan

  • What is the purpose of F-03 clearing? How to clear GL account there in F-03

    HI,
    What is the purpose of F-03 clearing? How to clear GL account there in F-03.Please help me in understanding the concept.
    Thanks
    Supriya

    Hello,
    There are cases where you pass some manual entries which might not have cleared against the other related item, THOUGH the balance has been ZERO.  Like cases where you reverse logistics invoice through MR8M, then entry gets reversed but they are still open items. Like some GRIR accounts might have debit and credit entries for same purchase order and the balance MIGHT have become ZERO, but still they are open item. To clear all these open itesm (changing the status of the open items to cleared items, you need to use F-03)
    Please go to F-03 and give the GL account which want to manually clear the debit and credit items.
    Normally you will this kind of activity for clearing account, where there is no automatic clearing mechanism explained in OB74.
    now click on open items. (if you know any specific things like document number etc. you can fill them, then they will act as a FILTER and only those document numbers you feeded will be appeared)
    Now select the items you want to clear. Deselected all other you do not want to clear. Selected items will be in blue colour and the difference at the end of the screen MUST be ZERO to post (unless you configured otherwise)
    Click on save button.
    The entries passed will GL Account A Dr and GL Account B Cr. Meaning that there is no implication but posting the debit and crediting the same account and clearing the status of the line items from OPEN to CLEARED.
    Hope I am clear.
    Regards,
    Ravi

  • How to clear Vendor Debit item Through F110

    Hi All,
    I have a new requirement,
    I have a vendor for which transactions are posted in multiple currecies, like USD & EUR.
    I have 2 invoices for this vendor, one is in EUR, and other one is in USD, along with this i have a dabit balance for this vendor which generated through a credit note.
    now when iam trying to make the payament for this Vendor thrugh F110, and try to clear the debit amount also, the system is throwing one error message saying that "Enter incoming payment method for the debit amount "(whici is in USD)
    Please let me know how to solve this issue
    Thanks in advance

    Hi Robert,
    This is the content of SAP Note 164835 as follows:
    SAP Note 164835 - F110: Clearing credit memos and
    invoices
    Note Language: English Version: 14 Validity: Valid Since 29.05.2008
    Summary
    Symptom
    When you execute a payment run, you select credit memos and invoices for a
    customer or a vendor, but the system does not clear them together. In the
    payment (default) log, the system may generate the error message FZ
    347:"...none of the payment methods defined can be used for these items".
    Other terms
    F110, SAPF110S, clearing, FZ 347
    Reason and Prerequisites
    The items to be cleared do not match in particular fields (see below).
    Therefore, they are not paid together.
    You can set a payment method only for either outgoing or incoming payments.
    This explains the error message FZ 347.
    Example
    - Payment run is executed with payment method U for outgoing
    payment.
    - Credit memo is not cleared against invoice.
    - Invoice is paid with U.
    - Error message FZ 347 is generated for the credit memo.
    Solution
    The following explains in general how to clear, and describes some options
    for eliminating errors. The logic of the grouping in the payment program is
    independent of the type of the documents (for example, invoice, credit
    memo, down payment, cross-company code posting).
    General information
    o You can pay open items together using the automatic payment
    transactions, but only if certain fields are identical. The
    structure ZHLG1 specifies these fields. Important fields are:
    - Currency
    - Receiver
    - Payment method in the item
    - Bank details in the item
    o Whenever invoices and credit memos are in different payment groups,
    you cannot clear them together, even if the credit memo contains an
    invoice reference. If you set a payment group for a business
    27.12.2010 Page 2 of 4
    SAP Note 164835 - F110: Clearing credit memos and
    invoices
    partner (grouping key in the master record), then this is saved in
    structure ZHLG1 (field PAYGR). This way the invoice reference in
    the credit memo is overridden if they do not belong to the same
    payment group.
    o Invoice and credit memo must be due at the date of clearing. The
    due date of a credit memo without invoice reference (BSEG-REBZG) is
    the baseline date for payment (BSEG-ZFBDT), and for a credit memo
    with a fixed value date (BSEG-REBZG = 'V'), the due date is
    calculated in the same way as for an invoice. For credit memos with
    invoice reference, the due date of the invoice applies.
    o You cannot clear credit memos and invoices if the payment is
    supposed to be made using a payment method set for the POR
    procedure.
    Invoices are grouped with a POR number with the document number as
    an additional part of the grouping key so as to save the individual
    payment required for POR payment methods. Invoice-related credit
    memos for invoices with POR numbers receive the same grouping key
    as the related invoice. This ensures that the clearing is
    performed. However, you can no longer make payments using the POR
    payment method because this payment method allows only one item to
    be paid. However, you can make the payment using a different
    payment method.
    The POR procedure is only relevant for payment transactions with
    the Swiss Postal Service. Consequently, the relevant fields in the
    document and in the business partner master record are only of
    importance in Switzerland.
    What can you do?
    o Check the payment methods in the line items (field BSEG-ZLSCH). For
    clearing, these must be filled with the same value.
    o If you have entered a specific payment method for the items, then
    check Customizing for this payment method (transaction FBZP). The
    indicator "Single payment for marked item" should not be set there.
    o Check the field "Grouping key" in the master record of the business
    partner for payment transactions in the company code. If, for
    example, there is a grouping set according to assignment number,
    then the invoice and credit memo must have the same assignment
    number in the business partner line for clearing. Using transaction
    OBAP, you can define which fields of the key you want the system to
    use for grouping.
    o Check the indicator "Pay all items separately" (LFB1- or
    KNB1-XPORE) in the master record of the business partner for
    payment transactions in the company code. If this field is set,
    each open item for this business partner is paid separately.
    o If you have set the indicator "Separate payment for each Business
    Area" (T042-XGBTR) for the payment program (all company codes) in
    Customizing, check the business area in the items. They must match
    in this case.
    o Check the house bank in the line items (field BSEG-HBKID). The
    27.12.2010 Page 3 of 4
    SAP Note 164835 - F110: Clearing credit memos and
    invoices
    values must also match for clearing. A document without house bank
    can only be cleared with a document with house bank if this house
    bank is defined in the master record of the business partner
    (LFB1-HBKID or KNB1-HBKID).
    Make sure that the house bank from the payment program is filled
    for any reset clearing documents (see Note 159607).
    o Check the partner bank type in the line items (> Other data > field
    BSEG-BVTYP). These values must also match for clearing. You can
    specify the partner bank type in the master record of the business
    partner for general payment transactions.
    o For postings to one-time accounts, the address data is encoded and
    saved in field BSEC-EMPFG. The coding routine has been changed in
    Release 3.0E. Therefore, if you want to offset documents from an
    earlier release against documents from a later release (for
    example, after an upgrade) you need to check the contents of this
    field. These values must match for clearing. If this is not the
    case, the documents from the earlier release need to be reversed
    and be posted again. If reversal is not possible, contact SAP
    Support.
    o If you do not clear using a payment method set with POR procedure
    (with or without invoice reference in the credit memo), then check
    the contents of the fields BSEG-ESRNR, BSEG-ESRRE and BSEG-ESRPZ.
    They must not be filled if you do not enter a payment method in the
    item.
    o If you set a separate payment for each payment reference (for
    example separated by a CID number in Norway or reference number in
    Finland) (FBZP > Paying Company Codes > field T042B-XKIDS), then
    the items for a clearing in field BSEG-KIDNO must be the same. Note
    that the Customizing setting (T042B-XKIDS) is effective only if
    vendors are involved in the payments. When you separate the
    payments by payment reference, also take into account that no
    outgoing payment can be generated for a payment reference for which
    only credit memos exist.
    o Check the structure ZHLG1 in your system. If you have inserted
    additional fields there, the line items must also match in these
    fields. Contact your consultant.
    Header Data
    Release Status: Released for Customer
    Released on: 30.05.2008 10:55:56
    Master Language: German
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: FI-AP-AP-B Payment Progam / Payment transfer
    (DE, JP, US)
    Secondary Components:
    27.12.2010 Page 4 of 4
    SAP Note 164835 - F110: Clearing credit memos and
    invoices
    RE-RT Rental
    The Note is release-independent
    Related Notes
    Number Short Text
    1084325 FSCM-BD: Payment method for invoice-related credit memo II
    305414 F110: Unintelligible grouping of documents
    197626 Partner bank category in RAs and payment program
    159607 F110: Reset clearing is not offset against
    143311 F110:Incorr.due date for cred.memo w/ fix.val.date
    109233 F110: message FZ347 or several payment documents
    86578 Guidelines for F110 Payment Program (W/Check mgmt)
    33288 Payment methods for rental agreement
    22856 Customer credit memos are not paid
    20484 Payment program does not clear due items
    4904 Credit memo clearing or down pmnt clearing for POR

  • How to clear a private static class attribute once it's been created?

    <pre>I'm working with an instance of a complex Class object that has been created using the function module <br>HRXSS_CAT_APPLICATION_INIT. The Class object that I am trying to work with is<br> CL_XSS_CAT_BUSINESS_LAYER and in particular its Static Private component attribute PROFILE.<br>
    The issue that I am having is that the first call of this function module creates and populates the Static Private component attribute, <br>PROFILE, for the instance of this Class and I do not know how to initialize it once it's been created. The PROFILE attribute is an <br>object reference to an instance of Class CL_XSS_CAT_PROFILE. <br>
    I want to reset/intialize this Static Private component. I can then call a Class Method with<br> different parameters so that it repopulates PROFILE with different attributes. <br>There is no Public method to do this in CL_XSS_CAT_BUSINESS_LAYER and even the Private method<br> INIT_PROFILE, the logic first checks to see if the PROFILE component is initial before creating a new PROFILE<br> object instance. All the Attributes of the CL_XSS_CAT_PROFILE object are Static and Private.
    <br>
    I would appreciate any insight anyone might have in how to reset/initialize this Class component attribute.<br><br>
    Thanks much,<br>
    <br>
    Graham<br>
    Sample code snippet is as follows:
    <br><br>
    DATA: lr_cats_application_rfc TYPE REF TO IF_XSS_CAT_APPLICATION_RFC,
    lr_core TYPE REF TO IF_XSS_PT_APPLICATION_CORE,
    lr_core TYPE REF TO CL_XSS_CAT_1_APPLICATION_CORE,
    lr_instance TYPE REF TO CL_XSS_CAT_APPLICATION,
    lr_business_layer TYPE REF TO CL_XSS_CAT_BUSINESS_LAYER,
    lr_profile TYPE REF TO CL_XSS_CAT_PROFILE,
    lr_profile_temp TYPE REF TO cl_xss_cat_profile.
    DATA: l_employee TYPE pernr_d.
    DATA: l_employee_tab TYPE rhxss_cat_employee_t.
    CASE im_command.
    WHEN 'DATESELECTION_PRVPERIOD'.
    *-> navigate to object component reference for CL_XSS_CAT_PROFILE instance
    lr_cats_application_rfc = im_ref_to_parameter_cache->REF_TO_APPLICATION.
    *-> navigate to object component reference for CL_XSS_CAT_1_APPLICATION_CORE
    lr_core ?= lr_cats_application_rfc->get_core( ).
    *-> navigate to object component reference for CL_XSS_CAT_BUSINESS_LAYER
    lr_business_layer = lr_core->business_layer.
    *-> navigate to object component reference for CL_XSS_CAT_PROFILE
    lr_profile = lr_business_layer->get_profile( ).
    l_employee = im_ref_to_parameter_cache->pernr.
    append l_employee to l_employee_tab.
    <br><br>
    *THIS IS WHERE I AM HAVING ISSUES...I WOULD LIKE TO CLEAR/INITIALIZE THE STATIC PRIVATE COMPONENT<br> LR_BUSINESS_LAYER->PROFILE BEFORE CALLING THE METHOD INITIALIZE_FOR_TIME_RECORDING<br>
    <br>
    <br><br>*THE FOLLOWING LINE FAILS ON A SYNTAX CHECK WITH 'FIELD "PROFILE" IS UNKNOWN. IT IS NEITHER IN <br>ONE OF THE *SPECIFIED TABLES NOR DEFINED BY A "DATA" STATEMENT
    <br>
    clear: lr_business_layer->profile.
    CALL METHOD lr_business_layer->initialize_for_time_recording
    EXPORTING
    im_employee_tab = l_employee_tab
    im_profile_id = 'MODAPPR1'
    im_startdate = sy-datum
    EXCEPTIONS
    pernr_not_enqueued = 1
    no_pernr_for_user_found = 2
    profile_not_found = 3.</pre>
    Edited by: Matt on Aug 1, 2009 12:44 PM

    OK...I apologize but I did not dig deep enough to see that the Enhancement Framework allows for the addition of Methods to Classes/Interfaces. Most of this ABAP OO stuff is still quite new to me so I'm struggling with syntax and what is and isn't possible based on how everything is declared. I guess now that I know I can do this I am having some problems understanding how singleton Class objects work and how to 'reset' them.
    The Class instance based on CL_XSS_CAT_BUSINESS_LAYER has a Static Private attribute PROFILE that is an object reference to the singleton Class instance CL_XSS_CAT_PROFILE.
    The singleton Class instance of CL_XSS_CAT_PROFILE has all of its attributes set to Static Private. If you look at this Class in SE80 you see that one of its attributes is also called PROFILE and is an object reference variable to itself.
    So the issue I am having is how to go about 'initializing' this singleton object so that I can 'recreate' this singleton object using a copy of the existing S
    I used the enhancement framework to create a copy of the CL_XSS_CAT_BUSINESS_PROFILE Instance Private Method INIT_PROFILE , called in INIT_PROFILE2, but I am not sure how to 'clear/reset' the instance of the CL_XSS_CAT_PROFILE object.
    Since PROFILE is an attribute of the CL_XSS_BUSINESS_LAYER object, I thought that a simple CLEAR PROFILE would reset the object but this is not the case. Within this method the FREE clears the value of the reference variable PROFILE but as soon as you step into the method me->init_profile, the value of PROFILE goes back to what it was. I need for all of the CL_XSS_CAT_PROFILE instance attributes to be reset or initialized so I can fill them again. I think I'm getting confused on the scope of things...should I be enhancing the CL_XSS_CAT_PROFILE Class with 'setter' methods so I can initialize all of the Static Private attributes that way instead of trying to clear all the attributes at a higher call level?
    Any assistance with helping me with my thought process or approach to this would be much appreciated.
    METHOD INIT_PROFILE2.
    FREE PROFILE.  >>> is reset but it does not carry through to next method call and does not clear all the attributes of the object referenced in PROFILE
    CALL METHOD me->init_profile
    EXPORTING
    IM_PROFILE_ID = im_profile_id
    etc...

  • How to clear a  JList correctly.

    Hello,
    I haven't found yet how to clear a JList whitout raising an exception.
    I have defined a JList, that I initialize with a Vector. For example :
       JList mylist = new JList();
       Vector v =  new Vector(5);
       for (init i = 0; i<5; i++ )  v.add("Line " + i);
       mylist.setListData(v);
          .When the user needs to erase all lines, he has to click on a JButton. In the actionPerformed method, I'm doing the following
       Vector v = new  Vector();
       mylist.setListData(v);It works, but I got an ArrayOutBoundException. I tried many other things such as
    v.clear();
    mylist.setListData(v);
    but I got the same exception. So I was obliged to embed my instructions in a
    try-catch block:
       try
            Vector v = new  Vector();
            mylist.setListData(v);
      catch (Exception ex){}In fact , I do not like what I did , and I'm pretty sure it exists a much better way .
    Thanks in advance for any suggestion
    Gege

    This link has answer...
    http://forum.java.sun.com/thread.jspa?threadID=718897&messageID=4149627

Maybe you are looking for

  • BT Infinity Speed drops

     Hey guys,       So around a month or two ago, we had a stint of connection outages and instability, in which our connection dropped out several times a day over the course of a few days, which was then followed an occasional drop every other day or

  • *Inbound Web Service - Inactive*

    Hi, I am on Siebel 7.5 version I have created a Inbound web service and published when tested from soapUI it says There is no active Web Service with operation named 'http://siebel.com/asi/:SiebelSRQueryById'.(SBL-EAI-04313)+ Using ASI framework I ha

  • Enabling Virtualization Technology to Install Windows 8 on Virtual Machine?

    Hello-I have an HP HPE-310t Desktop computer that is currently running the 32-bit version of Windows 7. I'm interested in installing the Windows 8 Customer Preview on a virtual machine such as Virtual Box.  I've done a little bit of research on how t

  • .Gif files not supported

    Hi I was wondering if you could help me with a new presentation I am making. I am relativity new to ae and am getting annoyed when importing .gif ('s) as I am being told they are damaged or unsupported. Could really do with your help on trying to fix

  • Flash Builder for PHP 4.5.1

    So I own Flash Builder 4.5 and upgraded to Flash Builder for PHP 4.5. Yesterday Adobe released an update for Flash Builder 4.5.1 which includes support for delpying for iOS devices. So my question is how soon is Zend going to provide and update to Fl