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

OVS in tables

Hallo everybody...

we want to implement a table with one inputfield-column. In this inputfield the OVS should be enabled, to select e.g. a material. The OVS should fill the complete row with data out of the selected material. But if we want to enable OVS, we can not create a table because of the cardinality of the node-element of the context.

If we select the cardinality "1..1" the OVS works but the table only can have one row :/ If we select the cardinality "0..n" the table can have "n" rows but the OVS is disabled.

Did anybody implements a similar application? Please help

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2007 at 04:39 PM

    Hi Backe,

    ItΒ’s easy. The context cardinality is 0..n but you need create a button to add new line in table. Try use the code below in this Button

    IPrivate<Name View>.I<Name Node>Element ele = wdContext.node<Name Node>().create<Name Node>Element();

    wdContext.node<Name Node>().addElement(ele);

    Regards,

    Edson Thomaz

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2007 at 02:48 PM

    Hello Backe,

    Use this link to do the OVS.

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20java/wd%20tutorials/web%20dynpro%20valuehelp%20-%20the%20object%20value%20selector.article

    Now you change the method getListener to put the value e.g. a material and change the constructor method of inner class implements IWDOVSContextNotificationListener to receive this value and use this value in method onQuery

    After select material, you need set the material in the OVS.

    Ex.:

    IWDAttributeInfo[] ovsProduto = { wdContext.node<Node>().getNodeInfo().getAttribute("<Attribute>")};

    IWDOVSContextNotificationListener listener = wdThis.wdGet<Name Custom Controller>().getListener(<<Value Material>>);

    WDValueServices.addOVSExtension("XXX",

    ovsProduto,

    wdThis.wdGet<Name Custom Controller> ().getOVSInputNode(),

    wdThis.wdGet<Name Custom Controller> ().getOVSOutputNode(),

    listener);

    Regards,

    Edson Thomaz

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Edson,

      thank you for your fast reply. Your hints are very useful for some introduction in OVS. My question was a little more complex. We want to include an OVS into a table-cell. So we have define a table and a context. One table-column consists of an inputfield. Now we want to add an OVS to this inputfield. But, if we create our table with the context in cardinality "0..n" the inputfield is disabled and no OVS is shown. When we create our table with the context in cardinality "1..1" the OVS is shown but the table only can have one row (thats not the functionality of a table πŸ˜‰ )

      Now we want to know, is there a method to put the OVS at the inputfields in the table-column and have more than one row (cardinality of the context "0..n")?

  • author's profile photo Former Member
    Former Member
    Posted on Aug 23, 2007 at 05:51 PM

    Hi,

    How do you do a OVS in a Table Field?

    I'm doning this but it does not work.

    I think that the problem is in the allocation from the OVS to the table field wiht the Method WDValueServices.addOVSExtension.

    you have a example?

    You will be able to help me? Pls....

    Nohemi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Espejo,

      i have learned, that the OVS is only relevant for the datatype you inserted in the inputfield. So if your table columns are disabled but the OVS addon is visible, you have to change the cardinality of the context-node.

      Example:

      You have a table with the colums "name", "itemnumber", "description" and "text". So in the context you have to create an "ValueNode" with the cardinality 0..n oder 1..n (in our case named "Items"). You change the cardinality in the properties-window of the "ValueNode". Under the "ValueNode" you have to create the "ValueAttributes" of "name", "itemnumber", "description" and "text".

      I do not must say, that you have to create the table with an Inputfield for the column "itemnumber". Because we want to put the OVS at this column.

      now you can edit the wdDoInit() in the yourView class

      // so the OVS was put to the colums itemnumber
      IWDAttributeInfo[] ovsStartUpAttributes = wdContext.nodeItems().getNodeInfo().getAttribute("itemnumber")};
      
      IWDOVSContextNotificationListener listener = wdThis.wdGet<YourAppName>CompController().getOVSListener();
      WDValueServices.addOVSExtension("Items Selection",
      		ovsStartUpAttributes,
      		wdThis.wdGet<YourAppName>CompController().getOVSInputNode(),
      		wdThis.wd<YourAppName>CompController().getOVSOutputNode(),
      		listener);
      

      in your Component Controller you must insert the three methods:

      public com.sap.tc.webdynpro.progmodel.api.IWDOVSContextNotificationListener getOVSListener( )
        {
          //@@begin getOVSListener()
      		return ovsListener;
          //@@end
        }
      

      public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSInputNode( )
        {
          //@@begin getOVSInputNode()
      		return wdContext.node<YourBAPI>_Input();
          //@@end
        }
      

      public com.sap.tc.webdynpro.progmodel.api.IWDNode getOVSOutputNode( )
        {
          //@@begin getOVSOutputNode()
      		// this context will come out of the BAPI -> its just the return - context you want to get
      		return wdContext.nodeItemnumberlist();
          //@@end
        }
      

      you also have to implementing the IWDOVSContextNotificationListener as a private inner class of your Component Controller.

      	private class OVSMyContextNotificationListener
      		implements IWDOVSContextNotificationListener {
      
      		/* @see com.sap.tc.webdynpro.progmodel.api
      		* )
      		.IWDOVSContextNotificationListener#onQuery(... */
      		public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {
      			
      		}
      
      		/* @see com.sap.tc.webdynpro.progmodel.api
      		* .IWDOVSContextNotificationListener#applyResult(...)*/
      		public void applyResult(
      			IWDNodeElement applicationNodeElement,
      			IWDNodeElement queryOutputNodeElement) {
      
      		}
      
      		/* @see com.sap.tc.webdynpro.progmodel.api
      		* .IWOVSC
      		DontextNotificationListener#applyInputValues(...) */
      		public void applyInputValues(
      			IWDNodeElement applicationNodeElement,
      			IWDNodeElement queryInputNodeElement) {
      
      		}
      	}
      

      now you only have to initialize your inner class in the Component Controller like

      private IWDOVSContextNotificationListener ovsListener = new OVSMyContextNotificationListener();
      

      you have to implement the last two codeexamples in the "//@@begin others"-tag of the Component Controller.

      now you should only implement the three methods of your inner class.

      Thats it πŸ˜‰

      You only have to pay attention in the View, by creating the context-strukture. The cardinality is very important.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 30, 2007 at 02:22 AM

    Hi Backe

    This is very useful, thank you a lot.

    Nohemi

    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.