How to avoid hard coding

hello experts,
in one of the requirements i asked to design the selection screen with some of the fields, those fields are having some constant values while filtering the data.
to avoid that hard coding they asked me to design the selection screen with those fields can anyone suggest me how to do that...?
thanks a lot for your anticipation...
SRI

hi
good
you can create a f4 search helo,store those hard coded values in a internal table and fetch those interal table value into that f4 help.
thanks
mrutyun^

Similar Messages

  • How to avoid hard coding in Programming

    Hi,
    For preparing a Sales report we need to fetch Excise, Tax and
    Education cess.
    While doing the programming condition types of excise, tax and education cess were given to technical consultants.
    It is like hard coding the programming. In future if a new condition type is created then it wont be calculated.
    What are the ways to avoid hard coding?
    regards,
    sathya

    You can create a Z-Table that you are using for referencing your data e.g. condition type. This way this is customizable.
    In a project I worked before we even had a more sophisticated way for avoiding hardcoding. We had one generic table including Program name, "Function to be exextued" (e.g. determination of condition) and the key value. And we had a function module reading these parameters from the gerneric table. Everytime you would need a specific value from this table you called this table via the function module.This way you had a customizable table and no more hardcoding was needed, the function module provided you with the values.

  • Tips on avoiding hard coded paths and make a java app platform independent

    HI all,
    I would like to gather some tips on how to avoid hard coded file paths, which are plenty in the application I work on and which I inherited from previous programmers.
    Also, when deploying to the production server, my app goes from a Windows platform to a Linux machine.
    I am curious to know what tricks and tools other programmers find useful in similar contexts.
    I am sure many of us would benefit from the discussion.
    Thank you !

    Actually, Java does this for you; you can use unix-style paths and they will still work, even on Windoze. To wit:
    public static void main(String[] args) {
            File f = new File("/");
            System.out.println(f.getAbsolutePath());
    }Yields: C:\
    public static void main(String[] args) {
            File f = new File("/Program Files");
            System.out.println(f.getAbsolutePath());
    }Yields: C:\Program Files

  • How to print hard-coded data in multiple language in sapscript.

    Hi All,
    How to print hard-coded data in multiple language in sap-script, here the requirement is when printing the output
    we can see the window heading, description which are mostly hard-coded here I want to print these in both language as fallows,
    Goods to be delivered: = Morada de Entrega:
    Total net value excl. tax = Valor Total (IVA não Incluído)
    Description = Descrição
    Item = linha
    here I want to print in both languages like----       Goods to be delivered:/ Morada de Entrega:
    and the above headings in English are hard-coded.
    Kindly suggest me on this.
    Thanks in advance.
    Arun.

    Hi Arun,
    Use Standard text ade those text elements. Then use those in SAP script using different languages.
    Regards,
    Amitava

  • In TOTALYTD function is it possible to avoid hard-coding year_end_date?

    Suppose you have a fiscal year of 9/30. The TOTALYTD function looks like:
      YTD Actual $:=TOTALYTD( [Actual $], 'Date'[Date], ALL('Date'), "9/30")
    But I want to avoid hard coding "9/30", and assuming I have a settings table from where I can get a date with the yearend, I tried this: 
      YTD Actual $:=TOTALYTD ([Actual $], 'Date'[Date], ALL('Date'), DISTINCT( 'Settings'[YearEndDate]))
    I get no errors but it calculates like "12/31". I tried to use Format but with no luck.
    Is there a way to make this work?

    I didn't try it, but I guess a max should work (assuming that there is only one date in the settings table).
    YTD Actual $:=TOTALYTD ([Actual $], 'Date'[Date], ALL('Date'), MAX( 'Settings'[YearEndDate])
    Can you try it out?
    Cheers,
    Jason | www.SqlJason.com
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

  • Parse schema name - Avoiding hard-coded schema names

    Hi all,
    I have been trying to find a similar thread but had no luck. I want to avoid hard-coding schema names in my reports. I have tried to use a Substitution string but I don't seem to be able to reference it by just doing :default_schema. I already reference the parsing schema like this: #OWNER# which is saving me a lot of time. Is there any way to create additional variables like that one instead of those substitution strings that can't be parsed in a query?
    Thanks a lot for your help.
    Regards,
    werot.

    Werot wrote:
    I have been trying to find a similar thread but had no luck. I want to avoid hard-coding schema names in my reports. I have tried to use a Substitution string but I don't seem to be able to reference it by just doing :default_schema. I already reference the parsing schema like this: #OWNER# which is saving me a lot of time. Is there any way to create additional variables like that one instead of those substitution strings that can't be parsed in a query?
    Will you actually get any benefit from using substitution strings? They are also hard-coded at design time. You could use application items if you need something dynamic.
    Bind variable syntax (:default_schema) will not work for lexical substitution of substitution string and application item values in report queries. You have to use static text (&DEFAULT_SCHEMA.) references (and be aware of the potential for SQL injection that this exposes).
    I wouldn't recommend using schema qualifiers directly in APEX applications. I would use grants, synonyms and views at the database level.

  • How can I avoid hard-coding this where clause in the inner select?

    This is extremely fast, but I have to hard-code the inner-most where clause, and I obviously can't do that. I know how to work-around it by creating a function that takes the CUSTOMER_ID and returns the ORDER_ID from the most recent payment, and that's reasonably fast, but I thought it would be worthwhile to see if there was a way to do this in straight SQL. I also know that better design could make the problem go away.
    Very much appreciate it if you could take a look and let me know if there's any way to get this kind of performance without hard-coding.
    Thanks,
    create or replace view customer_view as
    select customer.customer_id,
              customer.customer_name,
                   select t.order_id
                        from (
                                  select payment.order_id
                                       from payment
                                       where payment.customer_id = 1 -- <-- Here's the line where I'm hard-coding the customer_id. Is there any way to reference the customer_id without hard-coding this?
                                       order by payment.payment_date desc
                             ) t
                        where rownum = 1
              ) as latest_order_id
         from customer
    select * from customer_view where customer_id = 1; <-- I want that inner-most select to use this customer_id, without having to hard-code it.

    Hi Matt,
    Something like this could be a possibility (Not tested)
    create or replace view customer_view as
      select customer.customer_id,
             customer.customer_name,
             (select min (t.order_id)
                       keep (dense_rank first order by payment.payment_date desc)
              from   payment
              where  payment.customer_id = customer.customer_id)
               as latest_order_id
      from   customer;Regards
    Peter

  • Is is possible to avoid hard-coding the Item in a shared Select List Query?

    I created a "Select List" in the Shared Components area as follows:
    My goal is to create a shared select list that can be used on any form for a particular Field.
    IF :P10_FK_RSTA_CODE is NULL THEN
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_active_ind = ''Y''';
    ELSE
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_code_pk = :P10_FK_RSTA_CODE';
    END IF
    Which works great, but how can I make the select list work for the same column on a different form?
    Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
    (I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
    Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?
    Also, I am very new at this, so if there is a better way to do this, I would greatly appreciate any input.
    Thanks in advance.
    MF

    >
    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "956902".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    I created a "Select List" in the Shared Components area as follows:
    My goal is to create a shared select list that can be used on any form for a particular Field.
    IF :P10_FK_RSTA_CODE is NULL THEN
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_active_ind = ''Y''';
    ELSE
    RETURN
              'select col_description, col_code_pk
              from CODE_TABLE
              where col_code_pk = :P10_FK_RSTA_CODE';
    END IF
    Which works great, but how can I make the select list work for the same column on a different form?
    Because :P10_FK_RSTA_CODE is hard-coded in the function, I can't reuse this Function from a different form.
    (I could rename the Field on every form to the same name, but I'm hoping there is a better way.)
    Is there a way I can pass in a variable from the Field Item to make this dynamic where I can use it on any form?Reference the value of an application item rather than a page item in the LOV query, setting the value using a process or computation on each form page.

  • How to overcome Hard Coding JSP page

    This is my original code for a User JSP page:
    <p>User Profile </p>
    How do I overcome hard coding it to my IP add at 192.168.0.4?

    Try this :
    Scheme:<%=request.getScheme()%><br>
    ServerName:<%=request.getServerName()%><br>
    ServerPort:<%=request.getServerPort()%><br>

  • IBM QMF 9.1 - How to handle hard coded .ini and .xml files

    Hi All,
    I've been trying to sequence ibm QMF for workstation.     The app has 2 gotchas in that there seems to be 2 config files that it uses to execute an eclipse environment.
    C:\Program Files (x86)\IBM\DB2 Query Management Facility\QMF for Workstation\configuration\config.ini
    has a path statement which cannot be resolved
    [email protected]/Application Data/IBM/QMF for Workstation/settings
    C:\Users\%USERID%\AppData\Roaming\IBM\QMF for Workstation\repositories.xml
    has several path statements looking back at the program files directory   (note I sequenced on an x86 machine, it doesn't work on x86 either)
    <location id="1517929232917419009" url="C:\Program Files\IBM\DB2 Query Management Facility">
    <property name="base-dir" value="C:\Program Files\IBM\DB2 Query Management Facility"/>
    I can make the app work by copying in the directories to the PC and then editing the config files and changing the paths to something inside the app-v package.   
    What methods do folks use to get around this???

    With hard-coded paths like that, you need to sequence on the same 'bitness' as the client.
    If the app is trying to read or write to that location under program files, then it should be redirected to the virtualised paths.
    VFS issues can happen if:
    The exe queries Windows to ask where it is running from, gets the virtual location, and finds an unexptected mismatch to the location expected in the config file.
    The application uses WMI (or some other external service) to query if the folder exists, which then cannot find the folder.
    You sequenced to the PVAD, as a result the folder is hidden in the virtual file system, and the app cannot see the install folder.
    If you sequenced to the PVAD, I would try again setting a dummy PVAD location - or just sequence it with SP3.
    If that does not help, does just creating those empty directories in the real file system do the trick?
    If none of the above help, then creating a symbolic link under program files pointing to the virtual location may work.
    Dan Gough - UK App-V MVP
    Blog: packageology.com
    Twitter: @packageologist
    LinkedIn

  • BufferedImage type parameter -- way to avoid hard-coding?

    My situation:
    I'm creating a new BufferedImage, then populating it with the Graphics of
    a component. I'm using the Component's height and width as two of
    the paramters, but I also need to specify the type. Right now I've got
    TYPE_INT_RGB hard-coded, but I seem to recall this is a Bad Idea.
    My question:
    Is there a (more) correct way to identify/specify the type when creating my
    BufferedImage?
    final BufferedImage myImage =
        new BufferedImage(myComponent.getWidth(), myComponent.getHeight(),
            BufferedImage.TYPE_INT_RGB);
    final Graphics2D g2d = myImage.createGraphics();
    myComponent.paint(g2d);

    Hm. I totally missed that method. Unfortunately, I really need a BufferedImage. I'm invoking ImageIO.write() later on, and that requires a RenderedImage, of which BufferedImage is the only implementation.
    Thanks, though. I'll definitely keep that method in mind for later!

  • How can I avoid hard coding this width?

    I have something like this:
    <s:SkinnableDataContainer
                                  width="200"
                                  itemRenderer="MyItemRenderer"
                                  dataProvider="{ dp }">
    If I have 4 items each 50px wide, I would set the width to 200px.
    However, I want to avoid hardcoding the width.
    How can I extract the width from the item renderer?

    You might want to try not setting a width and setting requestedColumnCount on the layout instead.
    <s:List>
        <s:layout>
            <s:HorizontalLayout requestedColumnCount="2" />
        </s:layout>
        <s:dataProvider>
            <s:ArrayList>
                <fx:String>0000</fx:String>
                <fx:String>1000</fx:String>
                <fx:String>2000</fx:String>
                <fx:String>3000</fx:String>
            </s:ArrayList>
        </s:dataProvider>
    </s:List>

  • Avoid hard coding

    This following section:
    boolean shownewUserLoc( JRTkNetworkInterface ajrtkNI ) throws LogicError {
             System.out.println( "####################################################" );
             System.out.println( "# Performing Action: Locations Screen (other User) #" );
             System.out.println( "####################################################" );
             System.out.println( "\t\t###################" );
             System.out.println( "\t\t# LOCATION SCREEN #" );
             System.out.println( "\t\t###################\n");
             System.out.println( "Available commands:");
             System.out.println( "\t\tSEARCH <User Name>");
             System.out.println( "\t\tNEXT or PREVIOUS");
             System.out.println( "\t\tCLOSE or CLEAR or NEW NAME or AGAIN");
             System.out.println( "\t\tSELECT\n\n\n");
             return true;occurs several times in my code, for every other boolean type, all this System.out.println stuff is repeated again. I'd say there is a way to in the above instead of all this System.out stuff refer to some txt file where all that is present, thus just let the contents of this txt be printed out?
    If so, how does this referring work?

    You could do it like this:
    class YourClass {
        boolean shownewUserLoc( JRTkNetworkInterface ajrtkNI ) throws LogicError {
            System.out.println(Finals.ERROR);
            return true;
    class Finals {
        public final static String ERROR =
                "####################################################\n"+
                "# Performing Action: Locations Screen (other User) #\n"+
                 "####################################################\n"+
        // other variables
    }, or use a properties file:
    http://java.sun.com/docs/books/tutorial/essential/environment/properties.html

  • Avoiding hard coding of Font and Signature Path in RTF

    Hi All,
    I have to create a check printing program and this requires MICR font and signatures. right now i have provided the URL for signature in RTF and path where my font is kept.
    The issue is everytime i am migrating my code from one instance to other i have to change both. Is there any way so that i can avoid the hardcoding of both.
    Thanks
    Aryan

    Hi Helios,
    Thanks for the help buddy. I have gone through document earlier and here also the path hardcoding has been told. I want to avoid that.
    Regarding the Image i am using a standard Report for getting the check details and i don;t want to modify that part for getting the url value from there. I hope there is some other way to resolve this the way oracle uses for it standard reports.
    Thanks
    Aryan

  • How to prevent hard-coding url's

    Hi,
    I have an adobe air application, that makes use of a few php scripts on my server.
    I use many httpservice's and they all have urls like:
    http://myserver.com/scripta.php
    http://myserver.com/scriptb.php
    Obviously there are many issues doing this.
    So how would i go about preventing this? Just store them in one file?
    Could someone give me a very simple example of how to do this?
    Any advice or links to info/tutorials is greatly appreciated.
    Thanks.

    flexillu10 wrote:
      Seems like every component uses a http service. 
    I have a login script, a script that loads a tree component with xml data, a search script, a download script and a log out script.
    This screams bad practice to me, what am i missing?
    Sounds like you aren't using an MVC architecture. I usually have a model component that looks after the data used by the UI. UI components never request data remotely. They signal (via events) a controller to request that the user logs in. The controller will co-operate with the model, so that in effect the model aggregates remote data requests and updates the model data as data is retrieved. The UI is updated via binding and/or event notification.
    All my remote communication is controlled by one component taht packages up requests for the server and handles the response. Many people use more sophisticated and formalised MVC architectures such as PureMVC, cairngorm, .. etc.
    Five actions is nothing.
    Paul

Maybe you are looking for

  • Failure to boot after new hard drive install

    trying to resurrect old graphite 466mh firewire clamshell. It was running tiger fine, had a problem charging it so sat in basement for a year. Turns out it was powercord,replaced, and now working again. Decided to replace the 10G hard drive, using th

  • Payment Run F110

    Good day to all!! I have a problem with payment run.  I have successfully executed payment run but there were no assigned house bank for vendors, can i execute mass change/assignment of bank details in the payment run. thanks..

  • HT1390 Error with downloading movie rental

    What happens when I download a rental movie from iTunes but it errors on the download. I have all the system requirements and the most updated version of iTunes. Now I paid for a rental and I can't even watch it.

  • Cannot add memeber to group

    Hello since today I've a strange problem with SDS version 5.2.4. I cannot add member to 2 groups because in the group edit entry I see only "general" and "languages" but not "members". The problem is only in two of the 30 groups that I've. Regards Da

  • Text colour on Notes

    I have just loaded a list of birthdays, in Notes, on my new iPod Touch. Each entry starts with the date of the birthday with the month shortened to 3 characters. From Jan to Apr the dates are in red and the names are black, from May to Sep everything