cancel
Showing results for 
Search instead for 
Did you mean: 

Is it that i have to call new model or dataElement For EVS

Former Member
0 Kudos

Hi,

I want To keep EVS to my InputField.If i enter some value manually and if iclick search it is displaying the list of values related to that input from R/3 database

Now i want to have EVS to my InputField(means instead of giving manually i wnat the data to be populated from database).Is it that i have to import the model again..or wat to do

Regards

Padma

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Padma,

No need to import the model again.Currently u r adding the values manually,instead of that just put the values from r/3 what u will be getting after executing the model.

regards

Sumit

Former Member
0 Kudos

Hi Sumith,

This is the code i used for EVS to my input field in my CustmController


public void wdDoInit()
  {
    //@@begin wdDoInit()
	Bapi_Po_Getitems_Input input = new Bapi_Po_Getitems_Input();
    wdContext.nodeBAPI_PO_GETITEMS_INPUT().bind(input);
	wdContext.currentContextElement().setTotalPrice(new BigDecimal(BigInteger.ZERO));
	wdContext.currentContextElement().setUnits("");
	// Code for EVS
	IWDAttributeInfo attributeinfo=wdContext.nodeBAPI_PO_GETITEMS_INPUT().getNodeInfo().getAttribute(IPrivateMainView.IBAPI_PO_GETITEMS_INPUTElement.PURCHASEORDER);
	ISimpleTypeModifiable WerksType=attributeinfo.getModifiableSimpleType();
	IModifiableSimpleValueSet EVSvalueSet=WerksType.getSVServices().getModifiableSimpleValueSet();
	
	try
    {
		wdContext.nodeBAPI_PO_GETITEMS_INPUT().currentBAPI_PO_GETITEMS_INPUTElement().modelObject().execute();
		wdContext.nodeOutput().invalidate();
		wdComponentAPI .getMessageManager().reportSuccess("size for output node"+wdContext.nodeBAPI_PO_GETITEMS_INPUT().size());
    }
	
    
	catch(Exception e)
		{
			e.printStackTrace();
		}
	
	wdComponentAPI .getMessageManager().reportSuccess("size for Bapi node"+wdContext.nodeBAPI_PO_GETITEMS_INPUT().size());
	
	int n=wdContext.nodeBAPI_PO_GETITEMS_INPUT().size();
		for(int i=0;i<n;i++)
		{
			String purNo=(wdContext.nodeBAPI_PO_GETITEMS_INPUT().getBAPI_PO_GETITEMS_INPUTElementAt(i).getPurchaseorder()!=null)? wdContext.nodeBAPI_PO_GETITEMS_INPUT().getBAPI_PO_GETITEMS_INPUTElementAt(i).getPurchaseorder():"";
			EVSvalueSet.put(purNo,purNo);
						
			
			wdComponentAPI .getMessageManager().reportSuccess("the value of string is"+purNo);
		}
    //@@end
  }

But the value of wdComponentAPI .getMessageManager().reportSuccess("size for output node"+wdContext.nodeBAPI_PO_GETITEMS_INPUT().size());

is comming as Zero and the value of wdComponentAPI .getMessageManager().reportSuccess("the value of string is"+purNo); is giving as NULL

Regards

Padma

Former Member
0 Kudos

Hi padma,

Can u send me the node structure in the context.U r trying to get the values from input node.U have to get it from output node,.

After executing the bapi,u will get the values in output node.

regards

Sumit

Former Member
0 Kudos

Hi Sumith,

I have an RFC Model by name BAPI_PO_GETITEMS_INPUT.

This will appear as a Node in your component controller. Under the node you will have an output subnode which will further contain another node with some attributes under it. Like,

BAPI_PO_GETITEMS_INPUT(Node).......It has an attribute called Purchaseorder and

|_OUTPUT(Subnode under MainNode)

|_ITEMLIST(Subnode under OutputNode)

|_ITEM NAME(Attribute under Itemlist Node)

|_ITEM NUMBER(Attribute under Itemlist Node)

In my View where my Inputfield is there i have the context structure as

BAPI_PO_GETITEMS_INPUT(Node).......It has an attribute called

Purchaseorder

I mapped CustomController with model and

View (PurchaseOrder with CustomController purchaseOrder

Regards

Padma

Former Member
0 Kudos

Hi Padma,

U have to get the values from output node not from input .ITEMLIST(Subnode under OutputNode)

will return u the values for items get the values from there & put in evs.

regards

Sumit

Message was edited by:

Sumit Malhotra

Former Member
0 Kudos

Hi Sumith,

Is this code correct to get EVS from R/3


Bapi_Po_Getitems_Input input = new Bapi_Po_Getitems_Input();
    wdContext.nodeBAPI_PO_GETITEMS_INPUT().bind(input);
	
// Code for EVS
	IWDAttributeInfo attributeinfo=wdContext.nodeBAPI_PO_GETITEMS_INPUT().getNodeInfo().getAttribute(IPrivateMainView.IBAPI_PO_GETITEMS_INPUTElement.PURCHASEORDER);
	ISimpleTypeModifiable WerksType=attributeinfo.getModifiableSimpleType();
	IModifiableSimpleValueSet EVSvalueSet=WerksType.getSVServices().getModifiableSimpleValueSet();
	
	try
    {
    	
		wdContext.nodeBAPI_PO_GETITEMS_INPUT().currentBAPI_PO_GETITEMS_INPUTElement().modelObject().execute();
		wdContext.nodeOutput().invalidate();
		wdComponentAPI .getMessageManager().reportSuccess("size for output node"+wdContext.nodeBAPI_PO_GETITEMS_INPUT().size());
    }
	
    
	catch(Exception e)
		{
			e.printStackTrace();
		}
	
	wdComponentAPI .getMessageManager().reportSuccess("size for Bapi node"+wdContext.nodeBAPI_PO_GETITEMS_INPUT().size());
	
	int n=wdContext.node|_ITEMLIST().size();
		for(int i=0;i<n;i++)
		{
			String purNo=(wdContext.nodeBAPI_PO_GETITEMS_INPUT().getBAPI_PO_GETITEMS_INPUTElementAt(i).getPurchaseorder()!=null)? wdContext.nodeBAPI_PO_GETITEMS_INPUT().getBAPI_PO_GETITEMS_INPUTElementAt(i).getPurchaseorder():"";
			EVSvalueSet.put(purNo,purNo);
						
			
			wdComponentAPI .getMessageManager().reportSuccess("the value of string is"+purNo);
		}
    //@@end
  }

Former Member
0 Kudos

Hi padma,

No,its not correct. instead of this wdContext.nodeBAPI_PO_GETITEMS_INPUT().getBAPI_PO_GETITEMS_INPUTElementAt(i). use the node available in output .

wdContext.nodeOutput or child node of output .

After executing the model,input node is of no use.only output node & its child nodes will get u the values.

regards

Sumit