Change Label Type dynamically

Hi All,
I want to change the label type in the screen dynamically based on a condition .
Like in screen I want to change the label type for a field '1.field1' from field1.
How can I proceed?
Thanks,
Nandini

Hello,
You can do so by using the following steps:
1. Create another Object Type in SPRO->UI Framework->UI Framwork Definition->Define Object Types.
2. Just Enter any name (such as 'ZTEST' )in object type field and its description
2. Use this role key for creating your personalized configuration with different labels for particular views.
3. Enhance method DO_CONFIG_DETERMINATION and check your conditions here. Based on the conditions, call your personalized config dynamically by specifying your new Role Config Key. You can see following code for youre reference. Hope it helps.
method DO_CONFIG_DETERMINATION.
*CALL METHOD SUPER->DO_CONFIG_DETERMINATION
EXPORTING
   IV_FIRST_TIME = ABAP_FALSE
CALL METHOD SUPER->DO_CONFIG_DETERMINATION
    EXPORTING
      IV_FIRST_TIME = ABAP_FALSE.
  data : lv_objtype         type bsp_dlc_object_type
                            value cl_bsp_dlc_xml_storage2=>default_object_sub_type.
  lv_objtype = space.
Check your conditions here
  if sy-uname = 'ABC' or sy-uname = 'DEF' .
      lv_objtype = 'ZTEST'.
  endif.
  if lv_objtype is not initial.
cater for create mode
      me->set_config_keys( iv_object_type          = lv_objtype
                           iv_object_sub_type      = <DEFAULT>
                           iv_propagate_2_children = abap_false ).
    endif.
  endif.
endmethod.
Hope it helps.
Thanks
Vishal

Similar Messages

  • Change data type "dynamical​ly"

    Hello,
    I will try to explain my question, please tell me if it's not enough clear.
    I read a text file wich describe me how to read datas in a product (their size, name, adress, type ...).
    There is a lot of type (U8, U16, U32, STRING, DATE, I8, DBL ...).
    The problem is I can't have an output in my VI for each type.
    My goal is to make a VI with an output that adapt itself to the data type and I don't know how.
    Maybe if it's possible to change the output declared dynamically depending on the type ... ?
    An other idea is to create a cluster with all the data and just write in the good box with a condition structure but it's not the goal here.
    Thank you in advance !!

    From your question (reading data from a text file), I'm assuming that (a) you can tell when one "piece of data ends and another begins" (for example, it might be a CSV file, with commas separating the fields, or there might be tabs or spaces between entries, or they might be all fixed width, e.g. 8 characters), and (b) you might know "in advance" the type of each piece of data.
    If Assumption (a) is not true, then you may have real difficulties, so I'll assume it's true.  If Assumption (b) is also true, then you need a bunch of sub-VIs, "Read Integer", "Read Float", "Read String", maybe "Read Boolean".  Note that, depending on what you want to do with the data, you might not need a separate "Read I32", "Read I8", "Read U8" routine, as you could read everything as I32 and "coerce" it to the correct type when you go to use it.  Similarly, read all Floats as "Dbl".  I'm assuming that you "know" the appropriate "use" for each variable, such as "The Fifth Variable is the first name of the Account Holder", so you'd want to use "Read String" and output a String when processing the fifth "chunk of data" from the file.
    If Assumption (b) is not true, you can still (sometimes) do a pretty good job reading/parsing the data.  I've done this for data I've read from an Excel Workbook.  What you do is apply some "rules", and hope that the data conforms to the rules.  Here's an algorithm to illustrate what I mean.
    Read in the data (as a string).
    Does it "conform to an integer number" (i.e. consist of possibly a leading + or - followed by only digits)?  Then it is an integer.
    Does it "conform to a float" by also having a single period?  Then it is a float.
    Otherwise it is a String.
    Note you could ask about being "True" or "False" if you need to process Booleans.
    BS

  • Business Graphics UI SimpleSeries Changing Label Dynamically

    Hi guys, I am using the business graphic UI element in one of my WD4A component. My BG has 2 simple series and one category. As I can see, using simple series, the label property cannot be bound against a context node attribute. I have to find a way to set this property dynamically.
    According to this link: click after on the simple series
    [http://help.sap.com/saphelp_nw70/helpdata/EN/ed/258841a79f1609e10000000a155106/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/ed/258841a79f1609e10000000a155106/frameset.htm]
    It seems we can change the label property dynamically, maybe using the API but how?
    I found the interface IF_WD_BUSIN_GRAPHICS_MTD_HNDL, but I don't know how to use it!
    thanks
    Alex

    Hi Alexandre,
    have a look at the Web Dynpro component WDR_TEST_EVENTS, view BG_SIMPLE_IN_MPANE, method WDDOMODIFYVIEW.
    Here is a snippet for setting additional customizing or data for a business graphics view-element. Call this from method WDDOMODIFYVIEW.
    DATA lr_bg TYPE REF TO cl_wd_business_graphics.
    DATA lr_bg_method_handler TYPE REF TO if_wd_busin_graphics_mtd_hndl.
    DATA lr_add_cust_xml TYPE REF TO if_ixml_document.
    lr_bg ?= ir_view->get_element(  <your viewid of business graphic>  ).
    lr_bg_method_handler ?= lr_bg->_method_handler.
    lr_add_cust_xml =  get_<your additional customizing/data>.
    lr_bg_method_handler->add_direct_customizing(
    i_customizing = lr_add_cust_xml
    Kind regards,
    Silke

  • Typecast Variables Changing Types Dynamically

    OK... this is a relatively simple app that is database driven... the problem comes in when didSelectRowAtIndexPath executes... here is the code:
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSUInteger row = [indexPath row];
    MyAppDelegete *appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
    MyController *myvariable = [[MyController alloc] init];
    myvariable = (MyController *)[appDelegate.myArray objectAtIndex:row];
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setObject:myvariable.myArrayMember forKey:kConstantValue];
    [myvariable release];
    What's happening is that when "myvariable" is cast to be a pointer to MyController, is is set correctly, and the type of the variable reflects correctly in the debugger. When the next line is executed, however, where the array is index by the row selected, and the results are assigned to myvariable, the TYPE of myvariable CHANGES from (MyController *) to (UICGColor *).
    I've checked to make sure that the array is declared correctly (the debugger says that after being loaded from the database, there are 39 objects in it), and that it is not being released too early (it is released in the MyAppDelegate's Dealloc method).
    Does anyone have any ideas why this may be getting re-cast?
    Message was edited by: Incognitii Formatting is all screwed up here... don't know why.

    Hi Incognitii , and welcome to the Dev. Forum!
    There are at least two bad things going on here, based on the code you posted and your description of an unexpected object type. Instead of focusing immediately on fixing the code, I think I can help you much more by clearing up some misunderstandings.
    1) A type cast doesn't change the type of an object. The cast merely turns off the compiler's type checking. Here's an example:
    UILabel *label = (UILabel*)[[UIViewController alloc] init];
    Without the cast, the compiler will yell at you: "Hey!! You just stored the address of a new controller object in a variable intended for the address of a label! That's an accident waiting to happen, Dude. Don't do it!!".
    With the cast, the compiler keeps it's mouth shut. In effect you're saying, "I know this looks kinky to you, but remember you're just a machine and I'm the programmer. I know what I'm doing, so zip it up or I'll trade you in for Visual Studio!".
    But either way, a UIViewController object was made on the right side of the above statement, and a pointer to that object has been stored in the 'label' var. So we can pretend the object is a label if it makes us happy, but it's still a view controller.
    Type casts are to be avoided whenever possible. Don't put any type casts into the first draft of your code. Then, if you get a Type Mismatch warning from the compiler, think long and hard about telling the compiler to shut up. Sometimes the type cast will be the correct decision, but more ofter than not, when you're first learning Cocoa, the compiler is right and you need to fix your code.
    2) Here's a common error that comes up when we forget that an object pointer variable just stores an address that can be replaced by another address any time we put the var on the left side of an assignment statement:
    Citizenship *citizenNew = [[Citizenship alloc] init]; // Line 1 - store addy of new object
    citizenNew = (Citizenship *)
    [appDelegate.citizenship objectAtIndex:row]; // Line 2 - replace that addy
    [citizenNew release]; // Line 3 - release object in array
    + In line 1 a new object of type Citizenship is made and its address is stored in citizenNew. So far so good.
    + In Line 2, the address of a second object is obtained from the citizenship array and stored in citizenNew. The address of the second object has thus replaced the address of the new object. The address of the new object is no longer stored anywhere so that object can never be released.
    + In Line 3, the object whose address is stored in citizenNew is released. The address in citizenNew points to the object at index row in the array, so that object is released.
    3) Note that NSArray objects save pointers of type 'id'. This means the array doesn't know or care what type of object is being referenced by each pointer. It's up to the programmer to know what types of object pointers are stored in the array, or dynamically classify the objects if necessary.
    I've checked to make sure that the array is declared correctly.
    This doesn't tell us anything about what types of object pointers have been stored in the array. Going back to point no. 1, a misunderstanding about the power of a type cast may have given you a false sense of security. If the array was loaded from a data base, consider the possibility that there could be most anything in it.
    One way to get a handle on what's in an array is to use NSLog(). Some semi-permanent logging can alert you to side effects after your attention has moved on to some other module:
    // put this somewhere that only runs once after any change to
    // the array; if the array wants to be too big for logging, it might
    // not hurt to keep it small until you know what's going on.
    NSLog(@"citizenship=%@", appDelegate.citizenship);
    // then in the code block:
    citizenNew = [appDelegate.citizenship objectAtIndex:row]; // cast shouldn't be needed here, btw
    NSLog(@"row=%d citizenNew=%@", row, citizenNew);
    I hope the above gives you the tools to sort things out!
    - Ray
    p.s.: To format your code see the yellow alert post that's first on the topic page:
    Paste your code here.

  • How to change a item type dynamically?

    Is it possible to change a item type dynamically?
    For example.
    I've got a page with 2 items. The first is a select list and the second is a date picker. The select list contains two values, 1 and 2.
    If value 1 is selected the second item needs to remain a date picker. If value 2 is selected the second item needs to become a Text Field (disabled saves state).
    Anyone got an idea?
    Thx. Frank.

    Frank,
    It's not possible to change the item type dynamically as you describe it below. However, to achieve a similar effect you could do the following:
    1) Make the Select List a Select List With Submit.
    2) Have a Date Picker AND a Text Field on the page.
    3) Make the display of the Date Picker item conditional on the relevant value having been chosen from the Select List.
    4) Make the display of the Text Item conditional on the other value having been chosen from the Select List.
    Andy
    http://atulley.wordpress.com/

  • How to change Table Cell Field Type Dynamically?

    Hi All,
    I am fetching some news data from backend DB and displaying them in a WD Table. Now one News Item may or may not have a URL behind it. If I find the URL as null then I want to display the news as simple TextView otherwise as LinkToUrl. How can I change this input type dynamically for each row in the runtime?
    If I use LinkToUrl all the time then the items which has URL as null gets displayed as normal text, but they are of very faint color and I can not change the text design. Whether if I user TextView I can set some text design like Header2, Header 3 etc.
    Can anybody please help with some code block? My main requirement is how to change the table cell input type dynamically.
    Thanks in Advance.
    Shubhadip

    Hi Shubhadip,
    This is the sample code for creating and adding a table cell editor table dynamically.
    public static void wdDoModifyView
    (IPrivateDynamicTableCreationView wdThis, IPrivateDynamicTableCreationView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
    //@@begin wdDoModifyView
    /*** 1.Create Table **/
    IWDTable table =
    (IWDTable) view.createElement(IWDTable.class, "table1");
    table.setWidth("100%");
    table.setVisibleRowCount(data.length);
    /*** 2.Create nameColumn **/
    IWDTableColumn nameColumn =
    (IWDTableColumn) view.createElement(IWDTableColumn.class, "Name");
    IWDCaption colHeader =
    (IWDCaption) view.createElement(IWDCaption.class, "NameHeader");
    colHeader.setText("–¼‘O");
    nameColumn.setHeader(colHeader);
    IWDTextView nameViewer =
    (IWDTextView) view.createElement(IWDTextView.class, "NameViewer");
    nameViewer.bindText(nameAtt);
    IWDTableCellEditor editor = (IWDTableCellEditor) nameViewer;
    nameColumn.setTableCellEditor(editor);
    table.addColumn(nameColumn);
    IWDTableColumn nationalityColumn =
    (IWDTableColumn) view.createElement(
    IWDTableColumn.class,
    "Nationality");
    IWDTableCellEditor nationalityEditor =
    (IWDTableCellEditor) nationalityViewer;
    nationalityColumn.setTableCellEditor(nationalityEditor);
    table.addColumn(nationalityColumn);
    /** 3. Bind context to table **/
    table.bindDataSource(nodeInfo);
    //@@end
    Bala
    Kindly reward appropriate points.

  • Dynamically change data type of a field

    Hello,
    I'm trying to dynamically create a SQL statement which will insert record sin to my SQL data base.
    I dynamically bring field name sand values. then concatenate them in a string and then Execute the SQL string in a native SQL eXEC statement.
    It all worked fine till I used signle quotes for all field values.
    but now I wante dto insert a field of type "Money" is SQL which is nothing but AMount/currency in SAP.
    Now If I remove this quotes it is working fine. but If I have a negative number the "-" sign comes in the end in my abap code and gives a short dump in insert statement.
    now I wante dto make that variable dynamic in to currency rather than String.
    Please let me know how Can I change it dynamically.
    EG: w_field_value = 3000.25-  (value in SAP / w_field_value is of TYPE String)
    Before I concatenate this , I wanted to change its type to AMOUNT ...
    thanks.

    Just Use the field Symbols.
    Regards
    Rusidar S

  • Why can't I change the frame label type?

    In a movie clip, I have several frame labels applied. The type of label is set to Name, which is the default. I want to change some of them to Anchor (to use as named anchors with fscommand), but the Type drop-down list is grayed out. Anyone know why? I can't find any info on named anchors, not even in the Help. Yes I know that anchors don't work everywhere, but this is for a specific client.

    Well, that's strange.
    In all the named frames of Video MC, I wanted to change the frame label type from Name to Anchor. The drop-down list was grayed-out, and clicking it didn't do anything. That is.......until I exited Flash and restarted it. Now, I can click the drop down list and select anything I want. I suppose I should have thought of that earlier.
    Thanks, and I hope I didn't take too much of your time!

  • Dynamically change the type of a field

    Hello,
    After finishing reading the adobe documentation and looking at almost all the samples in the Adobe website, i still have no clues how to do the dynamic type changing in the E-Forms.
    Do you think it's possible to change dynamically the type of a field at runtime or during the generation of the pdf?
    Example:
    i send a table to the PDF with the following information:
    Table X line 1 column1 --> textfield type
    Table X line 2 column1 --> Numeric field type
    The result must be the generation of the table X with at the first line a text field and at the second line a Numeric. Of course those field will be editable.
    Possible ?? or not?
    Thx for your help,
    Pelaez Lopez Philippe

    Let me guess, you would like to work with Adobe as you would work with WD. You cannot generate forms from scratch. And that is equal to create a single field, than dynamically duplicate it, distribute it all around the paper and change the types to the right ones. This is not possible. You can only create a superbig form and use hiding.
    If you would like to see a super-big-crazy example, check form MEDRUCK delivered by SAP. This form is superbig, but your output can contain only few fields according to the print type you need.
    If you form is that complicated you cannot build it this way, then the requirement is probably not structured and goes against the meain stream (which needs the structure:))
    Otto

  • Change Label in Overview

    Hey Guys
    I have a problem which I hope is peanuts for you.
    I have a xml overview and I want to change its label dynamicly.
    I tried to put an function instead of the string at the initialization, put that did'nt worked, so I need to chage it at runtime.
    My code looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <vc:ManagedOverview label="Preferences" allowCallsFrom="[ch.test]"
      xmlns:mx="http://www.adobe.com/2006/mxml" type="{Preferable}" types="{[Preferable,Product,Component,Containable,ComponentCategory, ProductCategory]}"
      xmlns:vc="ch.marsdencatering.foodcomposer.viewcontrol.*" searchIndex="4"
      xmlns:cp="ch.marsdencatering.foodcomposer.view.component.*">
      <mx:Script>
      <![CDATA[
      override public function onViewControlModelChanged(caller:IManagedView):void {
            if (caller is test) {
                 searchIndex =caller.currView;
                //Likes
                 if(searchIndex == 0){
                        //Change label here to "Likes"           
                //Dislikes
                }else if(searchIndex == 1){
                        //Change label here to "Dislikes"
      ]]>
      </mx:Script>
    </vc:ManagedOverview>
    Is that possible or should I try it on an other way?
    thanks for your help!!!
    Jochen89

    Your comment wasn't exactly what I was looking for, but it gave me the right hint. :-)
    I have to put a function directly to the initiation part of the overview AND end it with a semikolon.
    <?xml version="1.0" encoding="utf-8"?>
    <vc:ManagedOverview label="{create_label();}" allowCallsFrom="[ch.test]"  
    xmlns:mx="http://www.adobe.com/2006/mxml" type="{Preferable}" types="{[Preferable,Product,Component,Containable,ComponentCategory, ProductCategory]}"  
    xmlns:vc="ch.marsdencatering.foodcomposer.viewcontrol.*" searchIndex="4"  
    xmlns:cp="ch.marsdencatering.foodcomposer.view.component.*">  
    <mx:Script>  
    <![CDATA[
    public function test():String {
          return "Likes";

  • How to calculate the Percent change in a dynamic

    hi All,
    I'm trying to get the percent increase/change of two dynamic
    colums.  In my report, the user has a checkbox where he can select two colums to calculate the percent growth.
    My DataSet is PilarName, Calification(is a decimal value) and Period (this is a string).  I created the Matrix this way:
    PilarName [Period]
    [PilarName] [Calification]
    Which give me these values:
    So, now I need to create another column to calculate the percentage change between these two colums.  I tried this:
    I added a Adjacent column group for Period column and I grouped by the calculated column "ColumnDiff".  Add the following expression.
    =(SUM(Fields!Calificacion.Value)- Previous(SUM(Fields!Calificacion.Value),"ColumnDiff"))/Previous(SUM(Fields!Calificacion.Value),"ColumnDiff")
    After that I get: 
    I'm getting the sum of the two columns instead.
    Any clue about what I'm doing wrong? Please help me, I've been looking for the answer but any solution works for me.
    Luis Carlos

    Hi Luis,
    According to your description, you have a report with different dynamic columns. Now what you want is show your user percentage growth in your matrix report after your user select two of those columns (I think you may use parameter to achieve your “checkbox”
    function). Is my understanding correct?
    In Reporting Service, we can’t calculate dynamic columns with our build-in arrogation functions. So we need to add custom code into our report, and call those functions which defined in custom code in our expression. We have tested your scenario in our local
    environment. Here are steps and screenshots for your reference.
    Go to your Report Properties, add the custom code below into your report:
    Dim Shared Num1 As Double
    Dim shared Num2 As Double
    Public Function GetCalification(Calification as Double,Type as String,Type2 as String) 
    If Type = Type2 Then
       Num1=Calification
    Else
       Num2=Calification
    End If 
    Return Calification 
    End Function
    Public Function GetPec()
    Return (Num2-Num1)/Num1
    End function
    Create a matrix. Put PilarName into Row field, put Period into Column field. In Data field, put the expression below into the textbox:
    =Code.GetCalification(Fields!Calification.Value,Fields!Period.Value,Parameters!Period.Value(0))
    In our sample report, we created a parameter (named Period) for selecting two columns. You can replace “Parameters!Period.Value(0)” with your own parameter.
    Add an outside column at right (%Growth), put the expression below into the textbox:
    =Code.GetPec()
    Save and preview. The matrix and result looks like below:
    Reference:
    Custom Code and Assembly References in Expressions in Report Designer (SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to change VO's dynamically for a item for each row in advanced table?

    Hi All,
    We had a requirement to filter the employees based on the search criteria table. I am using advanced table for developing search criteria.
    In that table I am having three columns. Operator (messagechoice), Criteria Type (messagechoice), and Criteria value (messageLovInput). Also 'Add Another Row' functionality is available.
    My requirement is:
    First Row:(Initial Row)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    Second Row: (when the user selects Add Another Row button)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    The problem I am facing here is, the Criteria Value column is pointing to only one VO at design time. But wee need to change that VO dynamically without disturbing other rows depending on the Criteria Type value.
    Is it possible to do so?
    Note: User can add n number of conditions as he want.
    Can anyone help how to acheive this.
    Regards,
    Sundeep.

    Check Dynamic Poplist section under Standard Web Widgets in Chapter 4 of OA Framework Developers guide.

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • Changing labels in JFileChooser

    Hello,
    for a multi-language application I need to change the text dynamically in a JFileChooser. Changing the text of the buttons works well with
    UIManager.put("FileChooser.cancelButtonText","desired text");. But I don't know how to reach the labels ("Save in", "Filename", "Filetype"). Does anybody know how to proceed?
    Thanks
    J�rg

    Tag Torsten,
    well, it's particular annoying if you look at the sources (as I did) but overlook the important things. The famous tomatoes on the eyes or the board in front of your head. ;-) Sounds nice in Ebnglish, doen't it?
    Maybe my recent trial to influence the labeling is of interest to you. I thought: Why not changing the default locale instead of explicitly setting each and every label, button and tooltip? So I did a
        System.setProperty("user.country","US");
        System.setProperty("user.language","en");
        Locale.setDefault(new Locale("en"));
        Locale lo= Locale.getDefault();
        System.out.println(lo.getLanguage());but it has not the desired effect. So there seems no other way than setting the text for all components.
    Bye
    Joerg

  • I loaded Mac OS X v10.7 Lion yesterday. Everything's running fine, except for a simple problem. Any time I want to copy a file, JPEG, etc., I am prompted "Finder wants to make changes. Type your password to allow this." I don't want this!! Is there a way

    I loaded Mac OS X v10.7 Lion yesterday. Everything’s running fine, except for a simple problem. Any time I want to copy a file, JPEG, etc., I am prompted “Finder wants to make changes. Type your password to allow this.” I don’t want this!! Is there a way to unlock “Finder” or rid this process?

    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. You can demote it back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. If you don’t have a login password, you’ll need to set one before you can run the command.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    resetpassword
    That's one word, all lower case, with no spaces. Then press return. A Reset Password window will open. You’re not going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

Maybe you are looking for