About VO Substitution

Hi
I am doing View object substitution on one of the Oracle Seeded page.
The page is /oracle/apps/imc/customer/account/createupdate/webui/IMCAuCreateCustAccount
The View Object Name is
/oracle/apps/imc/customer/account/createupdate/server/IMCAuPersonCustAccountsVO
and second one is
/oracle/apps/imc/customer/account/createupdate/server/IMCAuOrgCustAccountsVO
The problem is when i redirect to this page it gives me a null pointer exception in createAccount of Applicaiton Module IMCAuCustAccountAMImpl
public String createAccount(String s, String s1)
Diagnostic.println("Inside IMCAuCustAccountAMImpl.createAccount()");
OAViewObject oaviewobject = null;
if("ORGANIZATION".equals(s1))
oaviewobject = (OAViewObject)findViewObject("IMCAuOrgCustAccountsVO");
else
oaviewobject = (OAViewObject)findViewObject("IMCAuPersonCustAccountsVO");
Diagnostic.println("IMCAuCustAccountAMImpl.createAccount(). createRow()");
Row row = oaviewobject.createRow();
String s2 = row.getAttribute("CustCustAccountId").toString();
row.setAttribute("PartyPartyId", s);
row.setAttribute("CustStatus", "A");
row.setAttribute("GenerateCustomerNumber", getGenerateCustNumber());
Diagnostic.println("IMCAuCustAccountAMImpl.createAccount(). account insertRow(), accountId= " + s2);
oaviewobject.insertRow(row);
oaviewobject.first();
return s2;
i dont know on which line i get NullPointerException but i am sure in this menthod i get the error.
i just want to know that when we do View Object Substitution, do we need to modify Applicaiton Module code too.
Could you please throw any points?
Regards
Hitesh

Below is the error stack
java.lang.NullPointerException
     at oracle.apps.imc.customer.account.createupdate.server.IMCAuCustAccountAMImpl.createAccount(IMCAuCustAccountAMImpl.java:67)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:750)
     at oracle.apps.imc.customer.account.createupdate.webui.IMCAuCreateCustAccountCO.processRequest(IMCAuCreateCustAccountCO.java:83)
     at lf.oracle.apps.imc.customer.account.createupdate.webui.LFIMCAuCreateCustAccountCO.processRequest(LFIMCAuCreateCustAccountCO.java:23)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
     at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
     at oa_html._OA._jspService(_OA.java:84)
     at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
     at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
     at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
     at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
     at oracle.jsp.JspServlet.service(JspServlet.java:156)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
     at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
     at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
     at oa_html._OA._jspService(_OA.java:94)
     at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
     at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
     at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
     at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
     at oracle.jsp.JspServlet.service(JspServlet.java:156)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
     at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
     at org.apache.jserv.JServConnection.run(JServConnection.java:294)
     at java.lang.Thread.run(Thread.java:595)
java.lang.NullPointerException
     at oracle.apps.imc.customer.account.createupdate.server.IMCAuCustAccountAMImpl.createAccount(IMCAuCustAccountAMImpl.java:67)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:585)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
     at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
     at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:750)
     at oracle.apps.imc.customer.account.createupdate.webui.IMCAuCreateCustAccountCO.processRequest(IMCAuCreateCustAccountCO.java:83)
     at lf.oracle.apps.imc.customer.account.createupdate.webui.LFIMCAuCreateCustAccountCO.processRequest(LFIMCAuCreateCustAccountCO.java:23)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
     at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
     at oa_html._OA._jspService(_OA.java:84)
     at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
     at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
     at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
     at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
     at oracle.jsp.JspServlet.service(JspServlet.java:156)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
     at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162)
     at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187)
     at oa_html._OA._jspService(_OA.java:94)
     at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
     at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
     at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
     at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
     at oracle.jsp.JspServlet.service(JspServlet.java:156)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
     at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
     at org.apache.jserv.JServConnection.run(JServConnection.java:294)
     at java.lang.Thread.run(Thread.java:595)
I decompiled IMCAuCustAccountAMImpl.class but line no 67 points to following line
OAViewObject oaviewobject = (OAViewObject)findViewObject("IMCAuCustAccountsVO"); which is in method initQuery()
I have not done anything to IMCAuCustAccountsVO
so i am not able to find out where it is failing.
Regards
Hitesh

Similar Messages

  • A problem about UWL substitution and GP

    Hi, Guys.
         Can UWL substitution mechanism also include gp task? I have some gp tasks in my uwl. When I set someone as my substitution, all of my tasks can be seen by my substitution(besides gp tasks). Is it a system restriction or just I need to do some configuration?
    Thx.

    Hi Louis,
    Please check this thread: Re: Can I forward o define substitution rules for Guided Prodedure tasks?
    Regards,
    Deepti

  • About Font Substitution

    If a font is used by the writer of a PDF and the viewer's PC does not have that font, what happens?

    Hi,
    Either Reader tries to substitute the misisng fonts with the nearby sub font, or you would see a row of dots appears in the lines of text that contain the missing symbol.
    Please refer to the link to learn more about the Fonts in PDF files. http://www.prepressure.com/pdf/basics/fonts
    Hope this helps !!!
    Regards,

  • I need a sample about how substitution groups are rewrited

    Hi
    As mentioned in a documentation, substitution groups in 10g are rewritten:
    The XML Schema constructs for the XPath expression are rewritable.
    XML Schema constructs such as complex types, enumerated values, lists, inherited (derived) types, and substitution groups are rewritten.
    Can anybody give me a link to a topic or a blog where this subject is discussed?
    I'm very need to.
    Thanks
    Dmitry

    Hi
    As mentioned in a documentation, substitution groups in 10g are rewritten:
    The XML Schema constructs for the XPath expression are rewritable.
    XML Schema constructs such as complex types, enumerated values, lists, inherited (derived) types, and substitution groups are rewritten.
    Can anybody give me a link to a topic or a blog where this subject is discussed?
    I'm very need to.
    Thanks
    Dmitry

  • Question about extension/substitution

    I need to modify a standard page with a table to include some extra columns.
    So I have a custom page which is a copy of the standard page's XML.
    In order to do that, I need to add phrases in the select, from and where clauses in the Query.
    I want to know what my best solution is:
    1- Create copy of VO.
    2- Create a substitution (I am not sure how this works. If I create a substitution, does it call my custom VO everytime a controller calls the standard VO? this would be ideal)
    3- Create an extension (wouldnt this be similar to creating my own copy of the VO? coz nothing will reference my custom VO)
    Would appreciate any help..
    thanks!!

    You can extend the VO and then through personalization add columns to page.
    To extend the VO, you need to get all VO related files from server, extend the VO by substituting the parent (base) VO and then deploy the custom VO on server and import the project.jpx
    Please go through extension and personalization given in OADevGuide.
    Thanks,
    Mitiksha

  • Suggestion about string substitution

    Hi guys,
    I have been asked to modify a bunch of html files exported by a program named...mindmeister I guess.
    It is a sort of faq and it is structured this way so the user can jump from a faq to another easily.
    Well, I have something like 100 files or more and in any file I have the navigation repeated.
    So in any page on there are 100 same links to other pages i order to be able to navigate through.
    I have been asked to insert another page. This is the second time I have being asked to modify this faq list.
    This is not a problem for me. The first time I just used Dreamweaver and I inserted easily another file. And I'm going to use it again because I cannot see how to do the same thing easily and simply
    I just was wondering how could I done this without Dreamweaver.
    I could use sed, sure, but imagine putting this in sed sintax:
    This is the part of the navigation I have to modify in every file.
    <div class="maintopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionedirelazioni.html"> 4. Estinzione di relazioni </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Dapartediprocuratore.html"> 4.1 Da parte di procuratore </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionefineanno.html"> 4.2 Estinzione fine anno </a></span>
    </div>
    <div class="maintopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="(NUOVO)FormularioA,ReT.html"> 5. (NUOVO) Formulario A, R e T </a></span>
    </div>
    Now suppose I wanted to add faq 4.3 Crappy hardcoded navigation due to crappy proprietary program unable to export the navigation as javascript
    My new navigation should be this one:
    <div class="maintopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionedirelazioni.html"> 4. Estinzione di relazioni </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Dapartediprocuratore.html"> 4.1 Da parte di procuratore </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionefineanno.html"> 4.2 Estinzione fine anno </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Crappy proprietary program.html"> 4.3 Crappy hardcoded navigation due to crappy proprietary program unable to export the navigation as javascript </a></span>
    </div>
    <div class="maintopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="(NUOVO)FormularioA,ReT.html"> 5. (NUOVO) Formulario A, R e T </a></span>
    </div>
    How would you do this? Doing this in sed would be unconfortable and time consuming.
    I can do this with dreamweaver easily by just using code substitution in all files and the specifying to substitute this:
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionefineanno.html"> 4.2 Estinzione fine anno </a></span>
    </div>
    with this:
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Estinzionefineanno.html"> 4.2 Estinzione fine anno </a></span>
    </div>
    <div class="subtopic">
    <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Crappy proprietary program.html"> 4.3 Crappy hardcoded navigation due to crappy proprietary program unable to export the navigation as javascript </a></span>
    </div>
    I hope this is just my own and not unix filters limit.
    This is just my curiosity. As I wrote before I can accomplish this task with dreamwaver, but I don't like much that approach.
    I would like something more unix.
    Edited because of errors notified by Procyon.
    Last edited by ArchArael (2009-06-09 21:42:08)

    I'm not sure how much simpler you expect to get than Procyon's example, to be honest.   It does exactly what you used to do (basic search and insert after).  What in your opinion would be more simple?
    I can even expand it out and comment it for you to make it clearer:
    for file in *.html; do # Process every html file in the current dir
    sed -i '
    /<div class="subtopic">/ { # If we see a line that looks like <div class="subtopic">, then perform the commands between { }
    n; # Read in the following line from the file (ie <img src="blah blah...)
    s/4\.2 Estinzione/&/; # Attempt to replace "4.2 Estinzione" with itself (ie. no end effect, performed for the sake of the next command)
    T; # If the previous replacement failed, skip the remainder of the commands (ie. if "4.2 Estinzione" exists on this line, continue, otherwise stop)
    n; # Read in the following line from the file (ie. </div>)
    # The following 3 lines say "after the current line, insert this line"
    a \ <div class="subtopic">
    a \ <img src="Res/images/arrow.gif" alt=""><span class="unselect"><a href="Crappy proprietary program.html"> 4.3 Crappy hardcoded navigation due to crappy proprietary program unable to export the navigation as javascript </a></span>
    a \ </div>
    } # end of block of actions to execute when you see <div class="subtopic"> -- note, leave this quote-backslash here, it is necessary -->' \
    $file # do the previous actions on the current HTML file
    done
    (note that this is still a valid sed script even with the comments - you could copy and paste this and it would run.

  • Doubt about Substitution Rules

    Hello gurus!
    We have a doubt about Management Substitution Rules. We fully understand all the benefits of this feature and tried to communicate to all our personnel to make it work properly, but as we have a big staff and not everybody have the same "skills" understanding technology, we eant to have a different approach to this: we want to develop a "user friendly" interface, as a single acreen where we can emulate all the features of Substitution Rules, but we want to know if there is a control program or a Function that controls this, and the understand it fully to achieve this. Anybody knows if this is possible?
    Regards IA

    Hi,
    If you use UWL only with one backend system, you can easily build your own application for example with web dynpro ABAP. Just use the function modules SAP_WAPI_SUBSTITUTE* to do the different operations (creating, deleting substitutions, etc.).
    If you have multiple backend systems, it is a bit more complicated. You could build your own (Java WD) application by using the Substitution API. Check the docs at: http://help.sap.com/javadocs/NW04S/SPS09/uw/com/sap/netweaver/bc/uwl/IUWLSubstitutionManager.html
    Both approaches work.
    Regards,
    Karri

  • Substitution variable dialog

    Oracle SQL Developer version 1.1.2.25 BUILD MAIN-25.79
    Running under WinXP
    Issue description:
    The Substitution variable dialog does not store the previously entered values.

    I'm talking about the "Substitution Variable"
    do:
    select * from mytable where mycolumn = &myvariable
    execute
    it opens a dialog for you to give &myvariable value
    you put wnat you want and next time you re-execute the substitution field is empty
    (do not confuse with the bind variable dialog that stores the previously entered data and has also small bug if data is number and you press an enter in the field hehe :)

  • How to create this Substitution

    Hi,
    i want to create a substitution for this purpose :
    Change Tax code A1 by B1 when Document type = DZ and Account = 613210
    but in Tcode GGB1 the fields of tax code (BSEG-MWSKZ) is not proposed for substitution !
    Please how to solve that ?
    Regards.

    HI,
    Please check the notes 42615, 842318 which explains about the substitutions.
    you can write ABAP Program or create table maintanance generator. you take ABAP consultant help for this
    Go to se11 and create maintenance view, and create ZGB01 view name and enter table name GB01. and go to view fields you will get some fields default then add view field BEXCLUDE data element as BEXCLUDE
    Save and activate the view.
    And go to utilities-> table maintenance generator.
    Give authorization group name &NC&
    And function group name ZGB01
    Select maintenance type one step or two step
    Click on propose screen on the application tool bar.
    create and after that save.
    Then go to SM30 give you view name and click on maintain.
    Then you can unmark the BEXCLUDE you would like to display on that sub.
    And then save. It says sap data donu2019t change. Then again save. Come back from that transaction .
    And now login and to substitution and try .. you will able to see the fields that you uncheck in that view.

  • OBBH - Substitution Routine

    Hi All,
    We have taken a substitution routine RGGBS000 access key and included one routine for BSEG-HKONT (house bank value change) it was working in the production since 1 yr.
    Now i got a requirement to change the values for withholding tax base amount and withholding tax exempted amount both these are from BSEG only.
    What is your suggestion in the above case.
    Should i modify the same routine which was done for housebank or should i go for another routine. i already tried to put code in the existed routine for housebank....but surprisingly, what ever the values i have put in the code was getting refreshed when it comes to screen.
    I was wondering... the same routine(place) is working for housebank but not my withhold tax base/exempted amounts.
    Now the Problem is i never gone through the total process for creating/modifying substitution routines.
    Please suggest me a solution regarding my problem and if posible give me the posible steps that i have to proceed with the system. I dont any thing about this substitution routines Funda, the routine for housebank was done by somebody who has quit the Org.
    Please... suggest me.
    Thanks,
    Bye

    Dear Deva,
    I have taken RGGBS000 acceskey and there is no probs to coding in this RGGBS000(its my client preferance).
    BSEG Structure is avalible and one routine is changing one of its field(housebank) also. i had put my code in the same routine but.... my values is getting refreshing, i mean it was not comming to the screen.
    I guess there might be some procedure after changing the existed substitution routine prg..
    Thanks,
    Diwakar

  • Substitution vs bind variable

    Hi,
    Can you please give me the differences between substitution vs bind variables? I have done many searches and I am lost. Any examples would be great.
    Thanks.
    -U

    Perhaps what is needed is a simple example of both.
    h2. Substitution Variables
    The clue here is in the name... "substitution". It relates to values being substituted into the code before it is submitted to the database. These substitutions are carried out by the interface being used. In this example we're going to use SQL*Plus as our interface...
    So let's take a bit of code with substitution variables:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn return varchar2 is
      2    v_dname varchar2(20);
      3  begin
      4    select dname
      5    into   v_dname
      6    from   dept
      7    where  deptno = &p_deptno;
      8    return v_dname;
      9* end;Now when this code is submitted...
    SQL> /SQL*Plus, parses the code itself, and sees the "&" indicating a substitution variable.
    SQL*Plus, then prompts for a value for that variable, which we enter...
    Enter value for p_deptno: 20
    old   7:   where  deptno = &p_deptno;
    new   7:   where  deptno = 20;... and it reports back that it has substitution the &p_deptno variable for the value 20, actually shoing us the whole line of code with it's value.
    This code is then submitted to the database. So if we look at what the code is, now created on the database we see...
    SQL> select dbms_metadata.get_ddl('FUNCTION', 'MYFN', USER) from dual;
    DBMS_METADATA.GET_DDL('FUNCTION','MYFN',USER)
    CREATE OR REPLACE FUNCTION "SCOTT"."MYFN" return varchar2 is
      v_dname varchar2(20);
    begin
      select dname
      into   v_dname
      from   dept
      where  deptno = 20;
      return v_dname;
    end;The database itself knows nothing about any substitution variable... it just has some fixed code with the value we supplied, that SQL*Plus substituted when we compiled it.
    The only way we can change that value is by recompiling the code again, and substituting a new value for it.
    Also, with substitution variables we don't necessarily have to use them just for 'values' (though that it typically what they're used for)... we can use them to substitute any part of the code/text that we are supplying to be compiled.. e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(x in number, y in number) return number is
      2  begin
      3    return &what_do_you_want_to_return;
      4* end;
    SQL> /
    Enter value for what_do_you_want_to_return: y*power(x,2)
    old   3:   return &what_do_you_want_to_return;
    new   3:   return y*power(x,2);
    Function created.
    SQL> select dbms_metadata.get_ddl('FUNCTION', 'MYFN', USER) from dual;
    DBMS_METADATA.GET_DDL('FUNCTION','MYFN',USER)
    CREATE OR REPLACE FUNCTION "SCOTT"."MYFN" (x in number, y in number) return number is
    begin
      return y*power(x,2);
    end;It really does substitute the substitution variable, with whatever text you type.
    So, that's substitution variables. In summary they are variables that the user interface detects and prompts for text to substitute into the code before submitting it to the database.
    h2. Bind Variables
    Bind variables are a completely difference concept to substitution variables.
    Bind variables typically relate to SQL queries, and are a placeholder for values within the query. Unlike substitution variables, these are not prompted for when you come to compile the code.
    Now there are various ways of supplying bind variables, and I'll use a couple of examples, but there are more (such as binding when creating queries via the DBMS_SQL package etc.)
    In the following exaxmple:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_deptno in number) return varchar2 is
      2    v_dname varchar2(20);
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select dname from dept where deptno = :1';
      6    execute immediate v_sql into v_dname using p_deptno;
      7    return v_dname;
      8* end;
    SQL> /
    Function created.The ":1" is the bind variable in the query.
    If you examine queries running in the database you will typically see bind variables represented as :1, :2, :3 and so on, though it could be anything preceded by a ":" such as :A, :B, :C, :X, :FRED, :SOMETHING etc.
    When the query is passed to the SQL engine (in this case by the EXECUTE IMMEDIATE statement), the query is parsed and optimised and the best execution plan determined. It doesn't need to know what that value is yet to determine the best plan. Then when the query is actually executed, the value that has been bound in (in this case with the USING part of the execute immediate statement) is used within the execution of the query to fetch the required data.
    The advantage of using bind variables is that, if the same query is executed multiple times with different values being bound in, then the same execution plan is used because the query itself hasn't actually changed (so no hard parsing and determining the best plan has to be performed, saving time and resources).
    Another example of using bind variable is this:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_deptno in number) return varchar2 is
      2    v_dname varchar2(20);
      3  begin
      4    select dname
      5    into   v_dname
      6    from   dept
      7    where deptno = p_deptno;
      8    return v_dname;
      9* end;
    SQL> /
    Function created.Now, this isn't immediately obvious, but what we have here is the ability of the PL langauge to seamlessly integrate SQL within it (giving us PL/SQL). It looks as though we just have an SQL statement in our code, but in reality, the PL engine parses the query and supplies the query to the SQL engine with a bind variable placeholder for where the PL variable (parameter p_deptno in this case) is within it. So the SQL engine will get a query like...
    select dname
    from   dept
    where  deptno = :1and then the PL engine will handle the binding of the value (p_deptno) into that query when it executes it, as well as dealing with the returning value being put INTO the PL variable v_dname. Again the SQL supplied to the SQL engine can be optimised and re-used by code because it isn't hard coded with values.
    So, here, the binding of values is implicit because the PL engine is removing the need for us to have to code them explicitly.
    The other advantage of using bind variables is that you don't have to worry about the datatypes.
    Often we see people creating code such as this (going back to a similar dynamic SQL example)...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_hiredate in date) return number is
      2    v_empno number;
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select empno from emp where hiredate = to_date('||to_char(p_hiredate,'DD/MM/YYYY')||',''DD/MM/YYYY'')';
      6    execute immediate v_sql into v_empno;
      7    return v_empno;
      8* end;
    SQL> /
    Function created.... where the developer is trying to concatenate in a date or varchar variable with the appropriate single quotes and formatting required to make the SQL make sense. Not only does that prevent the SQL explain plan from being re-used with different values, but it makes the code hard to maintain and get right in the first place (as well as leaving things open to SQL injection)
    But, with bind variable, that's not necessary... simply doing...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_hiredate in date) return number is
      2    v_empno number;
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select empno from emp where hiredate = :1';
      6    execute immediate v_sql into v_empno using p_hiredate;
      7    return v_empno;
      8* end;
    SQL> /
    Function created.... is all that is needed.
    The SQL engine knows that it is expecting a DATE datatype for the value because of what it's being compared against, and the USING statement is supplying a value of DATE datatype. No messy need to play with date formats or quotes etc. it just simply works. (and the same with other datatypes).
    So, that's bind variables. In summary they are placeholders in queries that allow SQL queries to be soft parsed rather than hard parsed when the query is re-used, help prevent SQL injection, and allow for the values to be supplied easily and seamlessly by the issuing code.

  • Service Parts Planning Substitution of Reman Products Demand in DRP Matrix

    I've got a pretty specific question about how Substitution of Remanufactured Products Demand actually gets distributed in the DRP Matrix in SPP (/n/SAPAPO/SPPDRPM).
    1.)  Two products are involved in an active 1:1 Subst. of Remanufactured Products "Replacement Type" in the Interchangeability UI (/n/INCMD/UI).  One would be the predecessor Reman product and one would be the successor Seed product.
    2.)  Let's say supplier capacity is in weekly periods in the SPRO configuration of 1 piece for each week for 52 weeks.
    3.)  When recalculating the DRP Matrix for the predecessor product, how does the substitution of remanufactured products demand get distributed among different locations within the BOD (Bill of Distribution) on the successor product if the requirements on the REMAN product were greater than the supplier capacity indicated.
    If you don't understand the concept or need more information, please let me know.
    Thanks,
    John V.

    Hi,
    Please check Service Part Supply Plan - Enterprise Services in SAP Advanced Planning and Optimization - SAP Library
    BR

  • Automate MSS substitution rule activation with 'Fill In'

    Hi,
    I have a question about the substitution, shipped with EhP7. There is the possibilty to add the rule as 'Fill In'.
    If I add the rule, the substitute will get the information in his overview directly. This option does not look at a maintained absence in infotype 2001?
    The reason for my question is the following:
    I would like to automate the activation of the rule, when the system (or especially a report) does detect an absence in infotype 2001. Only if that is the case, the rule should be activated. The result of this procedure is, that the substitution rule only has to be added once initially (of course for one substitute).
    I read different articles and the part of the HR600-course-material. With that and my testing in a system, I think that there is no such automation I described. Am I right?
    Thanks in advance.
    Best regards from Germany
    Christian

    yes you are correct, FIll in means, any unexpected absence of the manager, a substitutue who is predetermined to take over tasks will do the approval for critical tasks. This is how its intended to be and as such its not automated. You can look at BADI WF_SUBSTITUTE if you want to include some checks, you ll find lots of docs on it

  • Need assistance in Hyperion Web Analysis Report

    Hi All,
    I am using HFM with Oracle database as the data source for reports and using Hyperion 931 components.
    I have a requirement in Key Performance Indicators reports (KPI)
    1) Need to have a custom column of current year Actuals Vs Plan data
    2) Need to have a custom column of current year Actuals Vs prior year Actuals data
    3) Need to indicate Font colours based on the values derived in columns (1) and (2) - if positive data - green colour
    if negative data - red colour
    I am trying to replicate this in Web Analysis report, but facing issues on
    1)Making this year value dynamic (shd change based on current year or atleast should prompt when we run report)
    2) Since i have fixed the report with 2008 and 2007 year, all the formattig made whiel creating the Report goes away, if i try to run the report with different year values like in 2010 and 2009 year (as current and prior year)
    3) Also, i have hided some coulumns based on our requirement which also no longer exists if i change the year values (available in coulmns)
    Please suggest any comments to resolve these issues, Moreover i am new to Web Analysis reporting tool ,so kindly suggest, if i am not using any of the existing WebAnalysis features to derive my requirement.
    Expecting your earliest response.
    Thanks,
    Siva

    Hi Siva,
    If you are using the Essbase as a data source then you can achieve these things from using the substitution variable in WA report.
    Assume you have a substitution variable in Essbase cube for current year. In WA report in Dimension Browse, right-click a dimension member and select "Substitution Variable”. The Substitution Variable dialog box is displayed. Here select a substitution variable from the list of Essbase substitution variables.
    To get the Prior year, again in Dimension Browse, right-click a dimension member and select the "Also select Previous". Here define the prior year that you want to use in your report.
    Sorry, I have no idea about the substitution variables in the HFM (It might be that we call the substitution variable with another name in HFM).
    Hope it will help you.
    Thanks & Regards,
    Mohit Jain

  • Need assistance in Web Analysis Report

    Hi All,
    I am using HFM as the data source for reports and using Hyperion 931 components.
    I have a requirement in Key Performance Indicators reports (KPI)
    1) Need to have a custom column of current year Actuals Vs Plan data
    2) Need to have a custom column of current year Actuals Vs prior year Actuals data
    3) Need to indicate Font colours based on the values derived in columns (1) and (2) - if positive data - green colour
    if negative data - red colour
    I am trying to replicate this in Web Analysis report, but facing issues on
    1)Making this year value dynamic (shd change based on current year or atleast should prompt when we run report)
    2) Since i have fixed the report with 2008 and 2007 year, all the formattig made whiel creating the Report goes away, if i try to run the report with different year values like in 2010 and 2009 year (as current and prior year)
    3) Also, i have hided some coulumns based on our requirement which also no longer exists if i change the year values (available in coulmns)
    Please suggest any comments to resolve these issues, Moreover i am new to Web Analysis reporting tool ,so kindly suggest, if i am not using any of the existing WebAnalysis features to derive my requirement.
    Expecting your earlier response.
    Thanks,
    Siva

    Hi Siva,
    If you are using the Essbase as a data source then you can achieve these things from using the substitution variable in WA report.
    Assume you have a substitution variable in Essbase cube for current year. In WA report in Dimension Browse, right-click a dimension member and select "Substitution Variable”. The Substitution Variable dialog box is displayed. Here select a substitution variable from the list of Essbase substitution variables.
    To get the Prior year, again in Dimension Browse, right-click a dimension member and select the "Also select Previous". Here define the prior year that you want to use in your report.
    Sorry, I have no idea about the substitution variables in the HFM (It might be that we call the substitution variable with another name in HFM).
    Hope it will help you.
    Thanks & Regards,
    Mohit Jain

Maybe you are looking for