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...

Similar Messages

  • In LiveCycle Designer ES4 how do you remove tabs within a page once they have been created?

    In LiveCycle Designer ES4 how do you remove tabs within a page once they have been created?

    Emma,
    Take a look at the troubleshooting tips on this page from the Infosemantics website:
    http://www.infosemantics.com.au/adobe-captivate-widgets/drag-and-drop/troubleshooting-widg et-issues
    Pay particular attention to the section entitled: "My drag and drop question works correctly sometimes, but not other times. "
    From the appearance of your slide, it looks like you may have removed some of the components from the quiz slide that are necessary for it to function correctly.  Try the test that this section of the troubleshooting suggests so that you can see if this is the case.  If it turns out that you have deleted some items, you'll need to recreate your quiz slide to get them back again.
    Hope this helps.

  • Attributes of private static class - private or package private?

    Consider the following code:
    public class Outer {
        // Remainder omitted
        private static class Nested {
            int someInt           = 10;
            String someString = "abc";
    }The nested class Nested is declared private, as it is only used by the Outer class... now I wonder... should I declare Nested's attributes private oder package private... either way, they can't be accessed from the outside... any ideas?

    stevops wrote:
    either way, they can't be accessed from the outsideThat is true. However, when in addition the members of class Nested are declared as private, you will not be able to access them also from within the class Outer as well, i.e. int i = Nested.someInt; will give you compliation errorsAs a matter of fact, at most it'll generate some warnings, for it (the compiler) will generate synthetic accessor methods for Nested's fields.
    All in all, if you plan to access private class members from an enclosing (or inner) class, you really only have two options: make them explicitly package-private, or make them implicitly so.

  • Private static class

    hi, what is the point of having a private static class, as you cannot acces it outside the scope of a class?

    hi, what is the point of having a private static
    class, as you cannot acces it outside the scope of a
    class?There are lots and lots of uses. The private implementation can actually be exported outside of the outer class if implements a public interface.

  • How can I recover my deleted web history once it has been cleared?

    in the Tools tab, there is a Clear Recent History function. In this, you can choose the time stipulant which you would like to be cleared... Once this is done, how can I recover the Recent history to see what has been browsed?

    Once deleted it can not be recovered.

  • How to insert condition on PO once GR has been created

    Hi all,
    I want to allow users to insert conditions on Purchase Order once Goods Received has been created. How do I do that?
    Thanks,
    Nas

    Hi
    You can add conditions in change mode ME22N.But it will not change the your Material documents that are already posted.Conditions applicable for balalnce quantity.
    You have to cancel your material documents and do fresh GR to reflect the changes for already GR done quantity.
    Regards
    Ramakrishna

  • How do i get things off the desktop once it has been put in the trash? it shows that its in the trash, but it wont get off my desktop!!!!!It wont open from the desktop either!!!!

    How do i get things off the desktop once i put it in the trash? it shows in the trash but it wont get off my desktop..... it wont open from the desktop either????

    There are several ways. The two easiest are to click the Junk icon to turn it off or right click the message and select Mart As-Not Junk.

  • With more than one tab open in private browsing, how do I leave private browsing all at once?

    Before the latest Firefox update I was able to close a private browsing session by selecting the STOP menu item and checking the appropriate selection in a pop up dialogue box. Now, when I have more than one tab open in private browsing, I can't end the session by selecting STOP. The dialogue box opens and offers a START option instead of a STOP option. The same is true using CONTROL+SHIFT+P. To work around the situation I need to close all but one tab and then stop the session. I want to go back to the way it was before the update and opt out of a private session entirely, regardless of how many windows or table are open, with the former two-step process.

    Create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.com/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    If that new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • How to close PR automatically once Contract has been created?

    Dear All,
    Please help me with this issue. The requirement here is from PR (with WBS Element) --> Contract --> PO (partial payments, total will be contract value which is adopted from PR)
    How do i automatically close PR once this PR has been adopted into a contract and saved.

    hi
    set message 06 076 as error in customization
    sproMaterials ManagementPurchasingEnvironment DataDefine Attributes of System Messages
    Vishal...

  • How to have real time data in a lookup or how to update a lookup once it has been created?

    Hi,
    I have created a lookup from an existing table and am using it to match incoming data. I would like to refresh the lookup once  a day. Is this possible. If yes how do I go about it?
    Regards
    Prabha

    If you are looking up onto staged data, just snapshot the data once a day.
    Or you could just do an External Lookup, where there is no need to refresh the data as you can just look it up dynamically.
    You will not get any 'fuzziness' with this approach.

  • How to see the data of the table once it has been published

    Hi
    How can we access the data of the table in the data model which has been successfully deployed on Apache Axis2 using OC4J.
    Thanks

    Hi Brad,
    Thanks a lot for your reply.
    I found StartPointbaseConsole.cmd file at following location .
    C:\BEA\weblogic81\common\bin
    C:\BEA\weblogic81\common\eval\pointbase\tools
    C:\BEA\weblogic81\samples\domains\end2end
    C:\BEA\weblogic81\samples\domains\portal
    C:\BEA\weblogic81\samples\domains\integration
    C:\BEA\weblogic81\samples\domains\workshop
    C:\BEA\user_projects\domains\<mydomain>
    I opened the the pointbase console and in each case i am getting the message while executing the query "select * from PF_PORTLET_DEFINITION"
    "Invalid table name".
    I am new to weblogic portal please provide me some more information regarding this.
    Regards,
    Sandeep K
    Edited by: user10952751 on Jul 15, 2009 8:34 AM

  • Its stupid but how do I download my pre-ordered songs once they have been purchased and released?

    I'm not very good at using itunes and recently I have pre-ordered an album, it has become avaliable to buy today and it says I have purchased it along with every song in the album so how do i download this alum/these songs to my libary?

    Perhaps?
    Downloading (using iOS or computer) past purchases from the App Store, iBookstore, and iTunes Store - http://support.apple.com/kb/ht2519

  • HT201317 How do I edit a photo stream name once I've already created it

    I can't edit my photo stream name once I created before I downloaded the OS 7 I could

    Figured it out

  • How do you re-edit a lens flare once it's been added?

    I Added a lens flare but now I want to change some of the options for that particular lens flare. I clicked lens flare again but it just adds a new one. Is there an edit tool anywhere?
    (the reason why I want to edit it is because it produced an after effect where black lines are propagating from an image on my canvas.)

    From now on, always use an empty layer when applying an effect like a lens flare. That way, you can toggle the layer on/off as well as get rid of it altogether so you won't affect any other layer.

  • Private static nested class

    Hi everyone,
    I'm practicing nested classes. I've written this simple class:
    public class OuterClass {
      private static class InnerClass {
         private InnerClass() {
            System.out.println("in constructor" }
    } and another simple class to test:
    public class TestClass {
      public static void main(String[] args) {
            OuterClass.InnerClass in=   new OuterClass.InnerClass();
    }All classes compile and main method runs with no problem. Now I wonder what is the meaning of the private modifier here ??
    Thanks

    Ok, I'm using Oracle's JDeveloper 3.2 ( jdk1.2.2). The code I posted compiles and runs with no errors in Jdeveloper.
    However, I tested this on the command line ( using javac directly ) and it does not compile !

Maybe you are looking for

  • Can I get a list of all binary files and what they do?

    I'm a newbie to Oracle. Needless to say I'm blindly muddling my way through the experiance of installations/setup and managing my first database. I realize that there is a three tier system and for my system all three of the tiers are on the same pc!

  • Why don't AutoCAD drawings converted by Acrobat 9.1.2 Pro print?

    I have been using Adobe Acrobat 6.01 Professional to make PDF files from my AutoCAD 2002 drawings. I email these PDF files to a client who prints them. My drawings are 2D with a 24 x 36 inch sheet size. The Adobe conversion buttons were automatically

  • Inventory 0IC_C03 Cube Transformations issue BI 7

    Hi Experts, we are Installing Inventory Cube 0IC_C03, with In dataflow options in BI 7, 2LIS_03_BF transformtions is in Active State, while 2LIS_03_BX transformtion and 2LIS_03_UM transformtions are in Active. and for most of the Keyfields in Cube ar

  • Profit Centers for Raw Materials

    Hi Experts, I would like to know in general which profit center will be used in raw materials. For example raw material, say sugar, it can be used in finished product A and finished product B, its like a shared service, in this case which profit cent

  • Vonteera Browser hijacker in about:config, how to remove?

    Hello, I have been infected by a Browser Hijacker, which posts ads on websites. It shows "ads by Volaro" and by doing some reading on the net, Vonteera is involved/ the cause. I have tried to clean the registry and removed several suspicious files fr