Skip to Content
author's profile photo Former Member
Former Member

supply functions

can anybody explain use of suppy functions and their implementation process.

thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:54 AM

    Hi Reena..

    <u><b>Supply Function</b></u>

    Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node changes. When a singleton child node is declared, you must also write an accompanying supply function. The Web Dynpro Framework will then automatically call your supply function when the Lead selection in the parent node changes.

    <u><b>Use of Supply function:</b></u>

    Supplies values to child node, according to the leadselected parent element.(For which you have to code).

    For Example,

    1.Consider a Parent Node <b>Details</b> having Child Node <b>PersonalDetails</b>

    2.In this, You have to pass Values from PersonalDetails node to the Details node at run time.

    3.So you have to Write Supply Function in the PersonalDetails node.

    4.In the Preperty of PersonalDetails Node, you have to Select,

    Supply Function and have to Give Name..

    5.After you have to write the Function as per your coding, in the Supply Function.

    4. Suppose, u have to select and display the details of a particular Value at run time from a table, u need to write the follwing..

    <u><b>First Declare in doinit()</b></u>

    <i>doInit()

    {

    String name[]={"SathishKumar GS","Praveen","Satish SV"};

    for(int i=0;i<10;i++)

    {

    IPrivateView1.IDetailsElement ele=wdContext.nodeDetails().createDetailsElement();

    ele.setName(name<i>);

    wdContext.nodeDetails().addElement(ele);

    }</i>

    <u><b>In Supply Function u have to write</b></u>

    SupplyFunction()

    {

    if(parentElement.getName().equalsIgnoreCase("SathishKumar GS"))

    {

    IPrivateView1.IPersonalDetailsElement ele=wdContext.nodePersonalDetails().createPersonalDetailsElement();

    ele.setAge("23");

    ele.setNO("10059");

    wdContext.nodePersonalDetails().addElement(ele);

    }

    else if(parentElement.getName().equalsIgnoreCase("Satish SV"))

    {

    IPrivateView1.IPersonalDetailsElement ele=wdContext.nodePersonalDetails().createPersonalDetailsElement();

    ele.setAge("24");

    ele.setNO("10056");

    wdContext.nodePersonalDetails().addElement(ele);

    }

    else if(parentElement.getName().equalsIgnoreCase("Praveen"))

    {

    IPrivateView1.IPersonalDetailsElement ele=wdContext.nodePersonalDetails().createPersonalDetailsElement();

    ele.setAge("24");

    ele.setNO("10063");

    wdContext.nodePersonalDetails().addElement(ele);

    }

    By using this , You can select the particular instance by using one instance at a time. This will be reducing the memory.

    Refer <b>JA310 Java WebDynpro Basics Document</b>, Page 120. For explanation with example.

    Hope this will helpful for u.,.

    Regards,

    GS

    Message was edited by:

    Sathishkumar GS

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:54 AM

    Hi,

    'Supply Functions' are used to supply vales to the child node, whose parent node's singleton property is set to 'true'.

    A singleton child node can have only one instance at run time, the supply function provides the vale to that child node, according to parents leadselection.

    The supply function will be called whenever the parent's leadselection changes.

    regards,

    Prabhakar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 08:21 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:48 AM

    The supply function can be used to fill values for a context node only when they are actually needed. For example, instead of creating a collection with values and binding it to the node, the programmer specifies the collection by describing the function to be called by the Web Dynpro runtime environment

    http://help.sap.com/saphelp_nw04/helpdata/en/03/96384162316532e10000000a1550b0/frameset.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/86/7fcf3d4f902d10e10000000a114084/frameset.htm

    http://help.sap.com/saphelp_nw04/helpdata/en/d6/078aa26b73fb47b43d9330f1a207cf/frameset.htm

    /people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro

    Kanwalpreet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:48 AM

    Hi,

    <i>Lead Selection:</i>A node’s element collection can be accessed using a zero based index value. It is possible to flag multiple elements as being selected (controlled by the selection cardinality property), but only one of the selected elements can be processed at any one time. The element being processed is referred to as the lead selected element.

    <i>Supply Function:</i>Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node changes. When a singleton child node is declared, you must also write an accompanying supply function. The Web Dynpro Framework will then automatically call your supply function when the lead selection in the parent node changes.

    <i>Relation Between singleton and supply function:</i>The supply function will be called even if singleton is true or false.

    The state of singleton property doesn't affect calling of supply function.

    Use of Singleton=true :

    When singleton is true, there will be only one child node instance for whole parent node. Hence, saving memory.

    <i>Use of Supply function:</i>Supplies values to child node, according to the leadselected parent element.(For which you have to code).

    Refer JA310 Java WebDynpro Basics Document, Page 120. For explanation with example.

    Also Check the following links

    http://help.sap.com/saphelp_nw04/helpdata/en/03/96384162316532e10000000a1550b0/frameset.htm

    /people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro

    when a context node use non-singleton, how to invoke the supply funtion eve

    Regards

    Abhijith YS

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.