Should I create setters for static fields ?

Hi all,
I don't know if here is the right forum for this question, but I'd like to know if is recommended to create setters for static fields of a class or if I can directly assign a value to those fields.
Thanks.

No question, you can assign to static fields, it's more a question of style and thoughts about future requirements. At some point in the future maybe you'll want such setting to have side effects. Personally I think using getters and setters everywhere (even on isntance fields) can be a bit obsessive.
On the whole, there's not that many occasions where accessing static fields that directly from outside the class makes sense. It's usually better, to my mind, to use a singleton pattern for global values. For me, static variables are more likely to either be constants, or things like instance lists more likely to be accessed through an Iterable interface.

Similar Messages

  • Inspection lot should be created only for particular vendor

    Hi
    Can anyone please help in achieving the below scenario:
    *Material  has been assigned to the inspection type A (one time inspection) has been set as preffered and active  in the inspection set up in the material master.
    *Quality level has been created for material and vendor  such that inspection should be carried out when next stage is 1 and no inspection should carried out when next stage is 2.
    *Tasklist   has been assigned with material and vendor .
    Material can be supplied by different vendors,For this material,  inspection should be done only for one vendor  and for other vendors there should  not be any inspection to be done and no inspection lot should be created.i.e Inspection lot should be created only for one vendor say AA whereas now inspection lot is getting created when  goods receipt is done for the purchase order  with other vendor BB.
    My requirement is  the inspection lot should not be created when goods receipt is done with other vendors say BB  except AA.
    Is there any other way other than using quality info record to achieve this.
    I can try with DMR  but the thing is there should not be inspection lot created  while posting GR.
    can anyone suggest me any other way to achieve this requirement.

    There are user exits when you create an inspection lot.  One of those could be used to suppress the inspection lot.  Have you looked at these?  Have you researched any QM user exits yourself yet?  This isn't the first time this specific question has been asked over the years.
    It's not hard and there are lists of QM user exits available all over the internet.
    Please do some research.
    You can also assign vendors to inspection plans with a DMR that requires one inspection, and than after that creates all skip lot inspections which you automatically close by a batch job.  The first lot can be manually forced closed.  Thereaftter all receipts would be skipped.  Not 100% but pretty darn close.  This requires that you know which vendors to assign to which plan.  Probably as much data maintenance as maintaing the Q-info records.
    And yes.. your client needs to come up with better reasons than "I don't wanna..".  It's part of a consultants job to convince them.
    Craig

  • HT204053 My wife and I get our iPhone 4s tomorrow.  Should we put them both on the same Apple ID, or should I create one for her.  All our apple products are on mine at this time.

    My wife and I get our iPhone 4s tomorrow.  Should we put them both on the same Apple ID, or should I create one for her.  All our apple products are on mine at this time.

    The answer to this kind of depends on what you both want to do. Apple IDs can be used for multiple Apple services. For example you could both have your own iCloud Apple IDs (which I would suggest), but have only one iTunes Store Apple ID.
    So think about how you will each use the iPhones then make your decision. Keep in mind that if you both use the same iCloud Apple ID you will receive each other's texts and emails and all the email, contacts and calendars will be the same.

  • You should also create directories for and mount any other partitions

    Hi,
    I've downloaded archlinux-2012.12.01-dual.iso and wrote it to USB. I've booted from that USB and set up partititons using command cfdisk.
    /dev/sda5 ==> /boot
    /dev/sda6 ==> /
    /dev/sda7 ==> swap
    /dev/sda8 ==> /home
    I don't remember if I've created /mnt or if it was already there. I've created two directories: /mnt/boot and /mnt/home as per instructions:
    "https://wiki.archlinux.org/index.php/Installation_Guide
    Mount the partitions
    We now must mount the root partition on /mnt. You should also create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) if you want them to be detected by genfstab."
    I've mounted /dev/sda6 on /mnt
    and now there are no /mnt/boot and /mnt/home under the /mnt
    I don't understand what to do now because instructions state that I should create directories /mnt/boot and /mnt/home and mount them but now that I've mounted / on /mnt the /mnt/boot and /mnt/home are not available to mount partitions /dev/sda6 and /dev/sda8
    Regards

    mount /dev/sda6 /mnt
    mkdir /mnt/boot
    mount /dev/sda5 /mnt/boot
    Then do pacstrap etc. Add /home to fstab before you reboot.
    Alternatively you can mkdir /mnt/home and mount /sda8 there too, then genfstab will add the entry in fstab for it for you.
    Last edited by Mr.Elendig (2012-12-18 14:27:48)

  • Create Rule for "Boolean" field attribute

    Hi all,
    I'm having a problem creating a Rule which references the value from a Checkbox in my User Form (hence, Boolean).
    I know how to create Rule to reference string values. But, apparently, the syntax is not the same when referencing a *"checkbox*" value.
    Here is the Rule I created :
    *<Rule name='Rule for Checkbox'>*
    *<switch>*
    *<ref>checkboxvalue</ref>*
    *<case>*
    *<isTrue>*
    *<ref>checkboxvalue</ref>*
    *</isTrue>*
    *<setvar name='MyTextField'>*
    *<s>Yes</s>*
    *</setvar>*
    *</case>*
    *<case>*
    *<isFalse>*
    *<ref>checkboxvalue</ref>*
    *</isFalse>*
    *<setvar name='MyTextField'>*
    *<s>No</s>*
    *</setvar>*
    *</case>*
    *</switch>*
    *<MemberObjectGroups>*
    *<ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>*
    *</MemberObjectGroups>*
    *</Rule>*
    In other words : if the Checkbox in my User Form is ticked (meaning, if the value is TRUE), then IDM should automatically allocate a value of "*YES"* to that text field in my user form *(MyTextField)*
    If the checkbox is not ticked, then the value of *"NO"* should be displayed in the Text Field.
    Is my syntax wrong?
    Thanks

    It depends on how you're generating the email. If you use a workflow it is relatively easy.
    Change the rule to (note that I added the rule argument, it's not really necessary, it just cleans the code up):
    <Rule name='Get To Address'>
        <RuleArgument name="boxvalue"/>
         <cond>
             <isTrue>
                 <ref>boxvalue</ref>
             </isTrue>
             <s>[email protected]</s>
             <s>[email protected], [email protected]</s>
         </cond>
    <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
    </Rule>Using the workflow service directly.
    <Activity>
        <Variable name="to">
            <!-- this assumes the checkboxvalue variable is already set -->
            <rule name="Get To Address">
              <argument name="boxvalue">
                  <ref>checkboxvalue</ref>
              </argument>
            </rule>
        </Variable>
      <Action id='0' application='com.waveset.provision.WorkflowServices'>
        <Argument name='op' value='notify'/>
        <Argument name='template' value='yourtemplate'/>
        <Argument name='to' value='$(to)'/>
        <Argument name="from" value="[email protected]"/>
        <Argument name="some_template_argument">
            <s>some value</s>
        </Argument>
        <Argument name='catch' value='notificationException'/>
      </Action>
    </Activity>Using the notify workflow subprocess is nearly identical. (I recommend this because retries are taken care of for you but it's up to you.)
    Finally your template is simple again. IDM should fill in the to value on based on the "to" variable you provided in the "to" argument. The "to" variable in turn was set by the rule.
    <EmailTemplate
    id="#ID#EmailTemplate:yourtemplate"
    name='yourtemplate'
    smtpHost='$(smtpHost)' 
    htmlEnabled='false'
    authEnabled='$(authEnabled)'
    userId='$(userId)'
    password='$(password)'
    ssl='$(ssl)'
    ignoreCert='$(ignoreCert)'>
    <!-- IDM provides the above values -->
      <subject>Your Subject</subject>
      <body>
    Hello.  The argument was $(some_template_argument).
    </body>
      <MemberObjectGroups>
        <ObjectRef type='ObjectGroup' id='#ID#All' name='All'/>
      </MemberObjectGroups>
    </EmailTemplate>

  • Creating OVS for a field

    Hi All ,
    I am trying to add the OVS for a particular field in my web dynpro application and for this I have done the folllowing:
    1. I added the component WDR_OVS to my component interface.
    2. I then added the following to my component controller
    OVS     WDR_OVS                                 System Component for OVS Input Help
    OVS     WDR_OVS     INTERFACECONTROLLER     Generic Input Help
    3. I set the input help mode as 'Object Value Selector' and OVS Component usage as 'OVS' for the attribute 'Alternate_payee'.
    4 . I then created a even handler type method ON_OVS in the main view and inserted the following code to it:
    DATA: lifnr TYPE lfa1-lifnr,
            f4lfb1_z TYPE lfb1,
            filkd TYPE bseg-filkd,
            t_zemtab TYPE STANDARD TABLE OF izemtab,
            w_zemtab  LIKE LINE OF t_zemtab.
      DATA: lt_value_set TYPE TABLE OF wdr_context_attr_value,
                ls_value_set LIKE LINE OF lt_value_set.
      SELECT SINGLE * FROM  lfb1 INTO f4lfb1_z
                      WHERE lifnr = w_lifnr
                      AND   bukrs = '001'.
      CALL FUNCTION 'FI_VENDOR_ALTERN_PAYERS_READ'
        EXPORTING
          i_lifnr            = w_lifnr
          i_filkd            = filkd
          i_bukrs            = '001'
          i_lfb1_head_office = f4lfb1_z
        TABLES
          t_zemtab           = t_zemtab.
    data w_alt_emp_string type string.
      LOOP AT t_zemtab INTO w_zemtab.
        concatenate w_zemtab-empfb ' ' w_zemtab-name1 ' ' w_zemtab-ORT01 ' ' w_zemtab-STRAS ' ' w_zemtab-PFACH into w_alt_emp_string RESPECTING BLANKS.
        ls_value_set-text = w_alt_emp_string.
        ls_value_set-value = w_alt_emp_string.
    append ls_value_set to lt_value_set.
      ENDLOOP.
    DATA lo_nd_alt_payee_info TYPE REF TO if_wd_context_node_info.
    DATA lo_nd_alt_payee TYPE REF TO if_wd_context_node.
    lo_nd_alt_payee = wd_context->get_child_node( name = wd_this->wdctx_alt_payee ).
    lo_nd_alt_payee_info = lo_nd_alt_payee->get_node_info( ).
             lo_nd_alt_payee_info->set_attribute_value_set(
                name =  `ALERNATE_PAYEE`
                value_set = lt_value_set ).
    Now when I run the application and do F4 on the desired field I am getting the short dump as ''OVS: Methode SET_OUTPUT_TABLE Cannot Be Called "
    Can you please tell me what am I missing here?
    Edited by: rajatg on Jul 27, 2011 9:42 PM

    Hello,
    WDR_OVS->OVS event follows a phase model approach. Once you create a event handled method for the OVS, the code template will be auto generated and it will look like this
    * declare data structures for the fields to be displayed and
    * for the table columns of the selection list, if necessary
      types:
        begin of lty_stru_input,
    *   add fields for the display of your search input here
          field1 type string,
        end of lty_stru_input.
      types:
        begin of lty_stru_list,
    *   add fields for the selection list here
          column1 type string,
        end of lty_stru_list.
      data: ls_search_input  type lty_stru_input,
            lt_select_list   type standard table of lty_stru_list,
            ls_text          type wdr_name_value,
            lt_label_texts   type wdr_name_value_list,
            lt_column_texts  type wdr_name_value_list,
            lv_window_title  type string,
            lv_group_header  type string,
            lv_table_header  type string.
      field-symbols: <ls_query_params> type lty_stru_input,
                     <ls_selection>    type lty_stru_list.
      case ovs_callback_object->phase_indicator.
        when if_wd_ovs=>co_phase_0.  "configuration phase, may be omitted
    *   in this phase you have the possibility to define the texts,
    *   if you do not want to use the defaults (DDIC-texts)
          ls_text-name = `FIELD1`.  "must match a field name of search
          ls_text-value = `MYTEXT`. "wd_assist->get_text( `001` ).
          insert ls_text into table lt_label_texts.
          ls_text-name = `COLUMN1`.  "must match a field in list structure
          ls_text-value = `MYTEXT2`. "wd_assist->get_text( `002` ).
          insert ls_text into table lt_column_texts.
    *      lv_window_title = wd_assist->get_text( `003` ).
    *      lv_group_header = wd_assist->get_text( `004` ).
    *      lv_table_header = wd_assist->get_text( `005` ).
          ovs_callback_object->set_configuration(
                    label_texts  = lt_label_texts
                    column_texts = lt_column_texts
                    group_header = lv_group_header
                    window_title = lv_window_title
                    table_header = lv_table_header
                    col_count    = 2
                    row_count    = 20 ).
        when if_wd_ovs=>co_phase_1.  "set search structure and defaults
    *   In this phase you can set the structure and default values
    *   of the search structure. If this phase is omitted, the search
    *   fields will not be displayed, but the selection table is
    *   displayed directly.
    *   Read values of the original context (not necessary, but you
    *   may set these as the defaults). A reference to the context
    *   element is available in the callback object.
          ovs_callback_object->context_element->get_static_attributes(
              importing static_attributes = ls_search_input ).
    *     pass the values to the OVS component
          ovs_callback_object->set_input_structure(
              input = ls_search_input ).
        when if_wd_ovs=>co_phase_2.
    *   If phase 1 is implemented, use the field input for the
    *   selection of the table.
    *   If phase 1 is omitted, use values from your own context.
          if ovs_callback_object->query_parameters is not bound.
    ******** TODO exception handling
          endif.
          assign ovs_callback_object->query_parameters->*
                                  to <ls_query_params>.
          if not <ls_query_params> is assigned.
    ******** TODO exception handling
          endif.
    *     call business logic for a table of possible values
    *     lt_select_list = ???
          ovs_callback_object->set_output_table( output = lt_select_list ).
        when if_wd_ovs=>co_phase_3.
    *   apply result
          if ovs_callback_object->selection is not bound.
    ******** TODO exception handling
          endif.
          assign ovs_callback_object->selection->* to <ls_selection>.
          if <ls_selection> is assigned.
    *        ovs_callback_object->context_element->set_attribute(
    *                               name  = `COLUMN1`
    *                               value = <ls_selection>-column1 ).
    *      or
    *        ovs_callback_object->context_element->set_static_attributes(
    *                               static_attributes = <ls_selection> ).
          endif.
      endcase.
    you need to adapt this code to pass the required structure and data.
    BR, Saravanan

  • Should I create outlines for a type logo before saving as a pdf?

    I have designed a logo in Illustrator (CS3) which has three elements:  the company symbol, company name, and a tagline.  I did not alter the typeface in any way, but I set it with some very tight custom kerning.  The tagline is in a small size italic.  I need to create a pdf of this logo for the client, who will then send it on to various printers to drop into several different publications.
    My question is: should I create an outlined version of the type before making the pdf?  This option is probably the "safest" for insuring the correct result from unknown printers, but I really hate the thicker look of outlined type.  I know Illustrator embeds a subset of the fonts along with the pdf, but I'm not sure if this is enough to avoid problems from printers who do not have the font installed on their own system.
    I have read several discussions on this forum regarding the pros and cons of outlining type, but the issues usually involve text type rather than a single logo with only a few words.  While I prefer to avoid outlined type, I know some printers request it.  What are the best pdf presets to use if I do not outline the type?  Thank you for any advice.

    Yes. A logo is a graphic. Treat it as such. You don't want replication of an identity mark to ever be dependent upon a system condition (presence of a font) that may or may not be there. A robust logo is deliverable in multiple formats. Not everything can import a PDF as a spot graphic (far from it).
    For just one obvious example: Most true logos are going to be rendered on a sign. That necessitates its being cut on a vector plotter. Industry standard vinyl plotters can't do that with a font that's embeded in a PDF.
    Whether the tagline itself should be treated as an actual element of the logo proper is another matter. One would have to see the specifics to advise on that.
    JET

  • Java Dictionary Project + create autonumber for KEY field?

    Hi there,
    I would like to create a Java Dictionary project that has a table with an AUTONUMBER as the key field.
    I know exactly how to do this in SQL Server using the IDENTITY field but cannot see an option when using the Java Dictionary project?
    Any ideas?
    Thanks for the help
    Lynton

    Has there been an update to this recently?  I am in need of exactly the same information.  The FAQ lists this:
    <i>Can I deploy a Java Dictionary table along with the table content?
    Yes. You can deliver the Java Dictionary table along the table content. There are two possibilities:
    Export from a reference database
    Specification of the table entries in an XML file (since SP5)
    Note that there is no modification support for table entries that are delivered in this way. Therefore, you can deliver table entries with program character or for examples, but not for templates or customizing data.</i>
    Now, I may be reading the note incorrectly, but it makes it sound like if you do populate a table with a XML file, the records cannot be modified thereafter.  Is this true?
    I'd also like to know how to develop the XML and where to put it, etc.  I've had no luck searching for this information.
    Thanks!

  • Abap query: Create selections for extras field

    Hi,
    I have a custom query and Infosets where I have defined customer fields in Extras tab (infosets).
    Now I want create (into Infosets) a selections field (select-options) to filter the extras field created but I receive message AQ120 that say I can't do that !
    You know some trick to do this ?
    (I don't have any database table to join with selections)
    Thanks,
    Daniels

    Hi
    U can use the extrafield in the selection-screen of the query, why do u need to create a SELECT-OPTION in the infoset?
    Max

  • Creating calender for a field in a form

    hi,
    We have a date field in our form.We would like to implement it with a calendar.kindly help
    tahks and regards

    If you are talking of a date picker in a form, there is no ready-made solution. However, if you can generate the dates through a sql query, you can create a dynamic LOV and make the form field of type POPUP and attach the LOV to it. But the popup lov can show only 10 values at a time.
    Infact, there are lot of postings on date picker in this forum. If you perform a search, I am sure you will come out with good hits. Otherwise, lot of javascript sites have ready-made date-picker codes.
    If you come across such code, you can incorporate the same by generating the same code using htp.p() in a pl/sql block in the additional pl/sql section.
    While building the form, you can choose to build a custom form and then you can create an image link that calls the javascript you generate in the additional pl/sql section.
    Or,
    If you have some code that generates the dates in a browser window, you can create a procedure and call it through the link field in the form.

  • What should be the data type for a field in ztable?

    i am desing a ztable , wht should be the datatype for a field if i want to enter values like -1.5 and -2.5 , negative values with decimals what should be the data type???

    declare as P type. TYPE P DECIMALS 1
    Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
    You can use type P data for such values as distances, weights, amounts of money, and so on.
    Also check this link.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
    Regards,
    Maha

  • Default value for a field in Purchase order

    I want that while creating purchase order system should suggest one value for the field ' prior vendor ' in retail tab. I don't want to use user exit. Can anybody help?

    Hi,
    if that button is clicked then give the values in the work area of  table control and then append it to the table control
      in pai of the screen.
      if r_rad eq 'X'.
        fs_tab = ur value.
    append fs_tab to it_tab.
    endif.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:39 PM

  • How to schedule multiple reports with different local to change static field language ?

    Hi all,
    we have requirement that we will place multiple schedule request on same server ,This schedule request will be different local setting with parameter value like: en-GB,en-US,Chinese...etc .We used translation Manager for this and it takes this parameter and change report language for static fields.
    problem is that ,on server it is not working properly,we tested for one report .if we pass prompt value to change local setting in report the we need to log off and login again in CMC to reflect new local or on BI Launchpad we need to refresh page then it shows new language.
    How we can do this with multiple scheduled report which will have different local value like en-GB,en-US,Chinese,German....?These schedule request are getting placed in server by one user .
    Please help us with sample code.
    Thanks
    Madan

    Hi,
    The only approach I can think of is to create a template report which uses variables
    For each column you would need to variable
    v_columnAName and v_columnAValue
    v_columnAName would have a if statement in it
    =if([client]="clientA" or [client]="clientC";NameOf([firstName]);if([client]="clientB";NameOf([SSN]);NameOf([lastName]));
    v_columnA would have a if statement in it
    =if([client]="clientA" or [client]="clientC";[firstName];if([client]="clientB";[SSN],[lastName]));
    This would only work when you had a small set of clients.
    This might be more managable if it was done in the universe
    Regards
    Alan

  • F4 help for Time field in Webdynpro Screen

    Hi Experts,
    I'm using TIMS data type for my Time field. In ECC we will have F4 function for the same data element, but in Webdynpro screen, am not getting the F4 help.
    I got some information from SCN that I need to go for some custom search help. But with which reference to the table, am I want to create it.
    Please let me know, is there any other possible way to create F4 for time field for webdynpro.
    Even I tried to use some standard search help, but am getting an error as 'Sending of dynpro ' ' not possible. No window system type specified'.
    Expecting valuable information from you experts.
    With Regards,
    RAM.

    Hi RAM,
    For time field, there is no SAP delivered search help in WDA , so we need to go for freely programmed search help.
    Please refer the below link, in which Mr. Thomas, has provided the links for search help document you can follow and create new search help component
    and also nugget of the component which can be imported using ZSAPLINK program.
    search help for time
    Regards,
    Rama

  • List of characters not supported for a field search of type char

    Hi,
    I have a field of type char.
    When we create entries for that field in a table we use special characters like &, etc. When searched it is not supported and not displayed in results.
    I suppose it might be because SAP can support for characters of specific ASCII codes.
    If you have any list of the ASCII codes supported in search, kindly let me know.
    Thanks and Regards,
    Jaisish

    Hi Jaisish,
    as far as I know, there are two "special" characters that act as jokers in a field search
    +: standing for one character
    *: standing for zero or more characters
    You can search for these characters into the content of a field, if you "escape" them. The symbol for escaping is "#" (before the special character + or *).
    For example, if you search for "#*", this will search all entries with an asterisk in its content.
    I hope this helps. Kind regards,
    Alvaro

Maybe you are looking for

  • Can I move workbooks from one database to another in discoverer 4?

    We have discoverer desktop/administration 4.1 We have two databases. One for real time, and one that is a copy of that for use by the business that gets cloned in the morning. This copy database is where users are able to create there own reports. Ev

  • I'm thinking about buying iPod Video, should i wait for a new iPod or?

    I was thinking about getting myself a Video iPod, but then i would hate it if i was to get one let's say this month and next month a new iPod will come out, so should i buy a Video or is there a new iPod coming out anytime soon? Thanks.

  • Removing in characters in styles

    I am trying to find a way of removing the last 6 characters from the end of a line using styling of some description. I have created a contact sheet using a text variable linking to each image and showing the name of that image, each image I am using

  • How to refresh frame1.jsp from frame2.jsp?

    Hi, I have main.jsp that holds frameset that contains "frame1.jsp" and "frame3.jsp". on submit at "frame3.jsp" it goes to "frame2.jsp", now I want to refresh "frame1.jsp" p.s. I don't mind to refresh the "main.jsp", I guess that will refresh the fram

  • Photoshop CS5 pop-ups (Dialog boxes) will not stay / stick in place

    My pop-up / dialog boxes have always opened in the same place as I had placed them from the previous time I had used them. All of a sudden they will no longer stick / stay, they open in the center of the page. For example when I first open PS and I c