Call a function in create method

Hi !!
I am using jdeveloper 11.1.1.5
My Scenario:
Need to call the function While my user clicks createInsert
What i had done:
I had called the function in my AMImpl. This is the code which i had done
public String getCurrentYear(String bu,String id){
        CallableStatement cs = null;
        try{
        cs=getDBTransaction().createCallableStatement("begin ? := FUNC_FIND_YEAR(?,?); end;",0);
        cs.registerOutParameter(1, Types.VARCHAR);
        cs.setString(3,id);
        cs.setString(2,bu);
        cs.executeUpdate();
         //   cs.close();
            return cs.getString(1);
        }catch(SQLException e){
        throw new JboException(e);
        finally {
            if (cs!=null)
                try{
                cs.close();
                catch (Exception e){System.out.println ("Exception Thrown "+e);}
    }I had called this function using Groovy in my attribute
But when my user clicks createInsert null value is inserted!
Whether it is the right operation to be performed!
Could any one please give me the solutions!!

>
I had called this function using Groovy in my attribute
>
How? can you show us the expression you use?
Did you check the input parameters bu and id? may be you are passing null values and thus the method returns null.
Did you check that your function return a value or not for your input parameters?

Similar Messages

  • Calling a css user created method from jspx page in ADF faces

    Hi all,
    Can anyone help me out to solve an issue calling a css user created method from a jspx page.
    Note: The css method is not the default css method. It needs to be called using 'styleClass' attribute in any tag.
    Thanks
    Neha

    Hi,
    I am not an expert in CSS so I don't know what a css method is. However, CSS can be applied to components via EL accessing a managed bean that returns the sytle text
    Frank

  • Stateless session's one method to call  two bmp's create method

    JSP calls one stateless session's one method and the method calls two bmps'
              create method.
              However, When the second bmp run the create operation, the exception
              happens.
              But the date that the first bmp insert is not rollbacked.
              How can I rollback all data, when the exception happens?
              

    Use JSP actions.
    <jsp:useBean id="shoppingCart" class="com.package.Cart" scope="session">
    <jsp:setProperty name="shoppingCart" property="userName" value="Guest" />
    </jsp:useBean>

  • How to call ABAP function module/ class method through web service?

    Hi Colleagues,
    I need to write an iphone version of current ABAP program. I want to call ABAP method and function module through my iphone so that I can re-use the ABAP APIs.So I choose web service. Can you give me any details information about how to do that?
    Thank you very much

    Hi,
    you need to create webservice out of FM. goto SE80 and follow the webservice creation wizard. Finally use webservice url for calling FM (remote enabled) from your iPhone.
    Regards,
    Gourav

  • Calling a Function in the Parent Window from the Child Window

    QUESTION: How do I call a function resident in the parent
    window from a child window?
    BACKGROUND
    I have a JavaScript function resident in the parent window
    that reformats information obtained from the Date object and writes
    the result to the parent window using the document.write( ) method.
    I would like to call this function from the child window and have
    it write to the child window instead. Is this possible? If not,
    must I rewrite the entire function and nest it in the below code?
    If so, what is the proper form of nesting?
    CODE: The code that creates and fills the child window is
    provided below. The highlighted area indicates where I would like
    to enter the information from the function resident in the parent
    window. I have tried every imaginable permutation of code that I
    can imagine and nearly destroyed my parent document in the process.
    I am very happy that I had a back-up copy!
    function openCitationWindow() {
    ciDow = window.open("", "", "width=450, height=175, top=300,
    left=300");
    ciDow.document.write("A proper way to cite a passage of text
    on this page:<br /><br />Stegemann, R. A. 2000.
    <cite>Imagine: Bridging a Historical Gap</cite>. " +
    document.title + ". [<a href='" + location.href + "'
    target='_blank'>online book</a>] &lt;" + location.href
    + "&gt; (");
    MISSING CODE;
    ciDow.document.write(").<br /><br /><input
    type='button' value='Close Window' onclick='window.close()'>");
    ciDow.focus();

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • Calling a Function in a AbstractPortalComponent Class from a JSP

    Hello,
    i got a class witch extends AbstractPortalComponent. In this class I call in the function doContent this
    response.include(request, request.getResource(IResource.JSP, "pagelet/TestComponent.jsp"));
    now i want to define another function in this class.
    This function should be called from the JSP. For Example when a Button is pressed. I know I can do this with a JSPDynPage but i need it this way.
    How can i realise this?
    Thanks for your replies.
    Greetings
    Christoph

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • Calling a function in the main movie from a loaded swf

    I realize this is probably a very basic question, but I have
    loaded a SWF file into another movie. I now want to call a function
    in the main SWF. Is there a way to do that? Alternatively, I have a
    custom class where I could put the function, but I haven't been
    able to figure out how to call it from the loaded SWF either. Do I
    somehow need to associate the class with the main movie,
    or...?

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • I am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    i am trying to generate purchase order and i create a BAPI also which is active.
    But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    Hi,
    Yeah i tried my Z_BAPI in R3 and then giving some ERROR.
    This is my CODE-
    FUNCTION ZBAPIPOTV2.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(POHD) TYPE  ZPOHD OPTIONAL
    *"     VALUE(POITEM) TYPE  ZPOITEM OPTIONAL
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET1 OPTIONAL
    data: ls_pohd type bapimepoheader,
             ls_pohdx TYPE bapimepoheaderx,
             lt_poit TYPE TABLE OF bapimepoitem,
             lt_poitx TYPE TABLE OF bapimepoitemx,
             ls_poit TYPE bapimepoitem,
             ls_poitx TYPE bapimepoitemx.
       MOVE-CORRESPONDING pohd to ls_pohd.
       MOVE-CORRESPONDING poitem to ls_poit.
       ls_pohdx-comp_code = 'x'.
       ls_pohdx-doc_type = 'x'.
       ls_pohdx-vendor = 'x'.
       ls_pohdx-purch_org = 'x'.
       ls_pohdx-pur_group = 'x'.
       ls_poit-po_item = '00010'.
       APPEND ls_poit to lt_poit.
       ls_poitx-po_item = '00010'.
       ls_poitx-po_itemx = 'x'.
       ls_poitx-material = 'x'.
       ls_poitx-plant = 'x'.
       ls_poitx-quantity = 'x'.
       APPEND ls_poitx to lt_poitx.
    CALL FUNCTION 'BAPI_PO_CREATE1'
       EXPORTING
         POHEADER                     = ls_pohd
        POHEADERX                    =  ls_pohdx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    *   PARK_COMPLETE                =
    *   PARK_UNCOMPLETE              =
    * IMPORTING
    *   EXPPURCHASEORDER             =
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
      TABLES
        RETURN                       = return
        POITEM                       = lt_poit
        POITEMX                      = lt_poitx
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    *   SERIALNUMBER                 =
    *   SERIALNUMBERX                =
    *   INVPLANHEADER                =
    *   INVPLANHEADERX               =
    *   INVPLANITEM                  =
    *   INVPLANITEMX                 =
    ENDFUNCTION.
    i am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)". 

  • Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu

    When exporting html and viewing locally we receive the following error... This error disappears after removing menu from top of page. This error does not occur when viewed on Outdoors360.businesscatalyst.com (our temporary site)
    Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu
    Any ideas??

    I fix the problem.
    I have carefully reviewed JAVASCRIPT files and I could see that these are not a major influence within the site, only are reference code and utilities of the same application.
    By removing these files nothing has stopped working, I thought I would have some error in the sliders, or opacities, but no, nothing happened.
    DELETE IT
    FRANCISCO CATALDO DISEÑADOR GRÁFICO

  • Call to a possibly undefined method displays when using static function in Unit Test

    Hello!
    This has been driving me nuts. I am setting up unit tests for a static class which manages a collection of songs. This is how my unit test class looks:
    //START CODE
    package flexUnitTests {
              import com.myapp.managers.MusicManager;
              import flash.utils.Dictionary;
              import flexunit.framework.Assert;
              public class MyAppManagerTest {
                        [Before]
                        public function setUp():void {
                                  var songData:Dictionary = new Dictionary();
                                  songData["mn0012345"] = new Dictionary();
                                  songData["mn0012345"]["title"] = "All the Pretty Little Horses";
                                  songData["mn0012345"]["description"] = "by: American Traditional | Voice, Piano | 3 pages";
                                  MusicManager.setSongData(songData);
                        [Test]
                        public function test_getAuthorsBySKU():void {
                                  var expected:String = "American Traditional";
                                  var given:String = MusicManager.getAuthorsBySKU("mn0012345");
                                  Assert.assertEquals(expected, given);
    //END OF CODE
    You will notice two calls in red above. When I leave them in the code I see a variety of errors which look like this:
    "Call to a possibly undefined method '' through a reference with a static type com.myapp..."
    And
    "Access of possible undefined property '' through a reference with static type com.myapp..."
    Then, when I comment out the two lines in red above, these errors go away. Flash Builder seems really flakey to me. Often I notice that the error list varies, how can it just no longer be an error? Where did this new access error come from, in a no related part of the code, by adding or removing a function call to a static class which remains in the import statement.
    Note that the MusicManager contains no references to any of the UI mxml that is throwing these errors. It just simply loads data into a few globals and allows you to grab info.
    How is my usage of this function making foreign objects inaccessible?
    Please help!!! I am really hoping there is an answer but I have a bad feeling the answer is just that Flash Builder is flakey.

    I did some more work on the issue above. There are functions with in the MusicManager that call the UserManager to get a user's ID. When I comment out these calls then the access errors go away. Well the user manager has some calls back to mxml that tell the class that changes where made. My best guess is this is where it stems into the code that is randomly throwing errors. But, it compiles fine and runs fine on a device. Is there something with test cases which doesn't invoke the UI?

  • HR ABAP - Generic method or function to create a PD object & Relat (IT1001)

    Hi,
    This question is related to HR Abap .
    Do we have a generic class method or function module which can be used to create any PD object(O,S,C,...) and relationships (A008, A003, 007,...)between these objects .(not RH_INSERT_INFTY) . It should also trigger change pointers .
    And also do we have a decoupled or generic infotype(1000,1001,1002,....) classes in PD side also similar to PA infotype classes(CL_HRPA_INFOTYPE_0002, CL_HRPA_INFOTYPE_0008,....) . It should also trigger change pointers .
    Thanks in advance

    Generic function to create infotypes 1000 and 1001 is RH_INSERT_OBJECTS
    Classes are CL_HRBAS_INFTY_1000, CL_HRBAS_INFTY_1001, etc

  • Is is possible to call a function or method before JVM exits ??

    Hi All,
    Is is possible to call a function or method before JVM exits where System.exit() is used.
    I am calling a program where System.exit is used. i need to call a function before the JVM exits.
    Please help me.
    Thanks,
    J.Kathir

    How to call the method ? Did i have to call the shudown hooks method in my main class ?
    Is it possible to have in subclass?
    is the below code is correct ? i am calling a class before System.exit is called....
    java.lang.Runtime.getRuntime().addShutdownHook(...My Own Class()....)

  • Can i use DLL file created by Fortran with the call libary function node

    Can i use a DLL created by Fortran (Compaq Visual Fortran) with the call library function node in labview. If yes how do i create the DLL file if i have the Fortran code.
    Thanks

    Yes! Maybe these old post will help:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=88786
    http://forums.ni.com/ni/board/message?board.id=170&message.id=109150
    Good luck!
    Message Edited by altenbach on 03-21-2006 02:35 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Which method will be called, when invoking home.create() ?

    Hi,
    In a Stateless session Bean, I want initialize some variables, whenever a bean is created or retrieved from the pool. So I used the ejbCreate() method to initialize the variables, but it is called only first time when I call the home.create(). If I call the home.create() method next time it doesn't call the ejbCreate().
    Which method will be called, whenever I call home.create();.

    hi siva,
    first of all Ejbcontainers maintain a pool of stateless sessionbeans .when you call home.create() the ejbCreate () method is definitely called and you said you are initializing some variable and may be you are trying to retrive that value after home.create() method.. when you try to retrive the value thee value may be same as you have initialized or different depending upon the no of stateless session beans in the container. you have created a bean and there is no guarantee that the same bean will be called when you invoke retrieval method..
    i hope you understood.
    cheers

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

Maybe you are looking for