cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer Selected Values to Model Node Input Table

HuseyinBilgen
Active Contributor
0 Kudos

Hi,

I've a RFC Function which has 3 table and an input parameter "I_Cmd".

Z_Mm_Port_019_Input

|

Output -> T_Frmlist , T_Portlog

->I_Cmd, T_IfrmList

T_Frmlist and T_IfrmList uses the same structure Zmm_Por_027 which have only one field "Name".

If "I_Cmd" is null, then RFC function fills T_Frmlist with "Name" values.

My aim is to display "Name" values with T_Frmlist, allow multiple selection and then fill T_IfrmList with selected values. After, execute RFC with I_Cmd = "X" and get T_Portlog for selected "Name" values.

Now I'm trying to create a search view which will contain an input field for "Name". But the user may be able to enter multiple "Name" values. As SVS, EVS or OVS don't permit multiple selection, I've created a new view called SelectNameView. I've putted a button next to the input field and when user presses button, FirmaSecView iview will be opened in a popup window.

At wdDoInit method, I'm displaying T_Frmlist by calling RFC without I_Cmd parameter setted and it displays all "Name" values for selection.

No problem at this stage.

But for Testing; I've created a table UI element on SearchView which is binded to T_IfrmList. So When I pressed a button on popup FirmaSecView iview, data from T_FrmList will be copied into T_IfrmList and displayed on SearchView.

But this doesn't work.

Here is the code which runs when button pressed on FirmaSecView.

Note that Testnode is an context value node I've created with same structure Zmm_Por_027 and bind it to another table on searchview. It displays data without problem.

public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionSelect(ServerEvent)

//wdThis.wdGetPortalKullanimiCompController().getKullanimGunlugu();

IPrivateFirmaSecIview.ITestnodeElement nodeElement;

IPrivateFirmaSecIview.IT_FrmlistElement frmlistElement;

int n = wdContext.nodeT_Frmlist().size();

// ->

IWDNodeElement element;

// <-

for (int i = 0; i < n ; i++){

nodeElement = wdContext.createTestnodeElement();

frmlistElement = wdContext.nodeZ_Mm_Port_019_Input().nodeOutput().

nodeT_Frmlist().getT_FrmlistElementAt(i);

nodeElement.setName(frmlistElement.getName());

wdContext.nodeTestnode().addElement(nodeElement);

//->

// Z_Mm_Port_019_Input input = new Z_Mm_Port_019_Input();

// wdContext.nodeZ_Mm_Port_019_Input().bind(input);

Zmm_Por_027 firmainput = new Zmm_Por_027();

firmainput.setName(frmlistElement.getName());

element = wdContext.createT_IfrmlistElement(firmainput);

//element.setAttributeValue("name","test");

//wdContext.nodeT_Ifrmlist().createT_IfrmlistElement(firmainput);

//input.addT_Ifrmlist(firmainput);

//wdContext.nodeZ_Mm_Port_019_Input().addElement(element);

// <-

}

wdContext.currentContextElement().getFirmasecwindow().destroy();

//@@end

}

But it doesn't work.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Bilgen,

Use the following code.


public void onActionSelect(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
	//	@@begin onActionSelect(ServerEvent)
  	IPrivateFirmaSecIview.IT_FrmlistElement frmlistElement;
  	int n = wdContext.nodeT_Frmlist().size();
  
    for (int i = 0; i < n ; i++)
    {
	    frmlistElement = wdContext.nodeT_Frmlist()
.getT_FrmlistElementAt(i);
	    String name = frmlistElement.getName();
	  
	    /*
	     *  Code for adding data to "TestNodeElement"
	     */ 
	    IPrivateFirmaSecIview.ITestnodeElement nodeElement = 
            wdContext.createTestnodeElement();
	    nodeElement.setName(name);
	    wdContext.nodeTestnode().addElement(nodeElement);
	    
	    /*
	     *  Code for adding data to "IfrmlistElement"
	     */
	    // Create a new Structure
	    Zmm_Por_027 zmmInstance = new Zmm_Por_027(); 
		
	    // bind the Structure Instance to the Element
	    IPrivateFirmaSecIview.IT_IfrmlistElement fromListElement = 
            wdContext.createT_IfrmlistElement(zmmInstance); 
		
	    // Set the Name
	    fromListElement.setName(name); 
		
	    // Add the Element to the suitable Node
	    wdContext.nodeT_Ifrmlist().addElement(fromListElement); 

		 
    }
         wdContext.currentContextElement().getFirmasecwindow().destroy();
	//	@@end
  }

Balakrishnan

Answers (0)