cancel
Showing results for 
Search instead for 
Did you mean: 

Used 2 models in a single project

Former Member
0 Kudos

Hi all,

I have 2 views View1 and view2 and a customController.I mapped 2 models in customController(Bapi_Po_Getitems_Input,Z_Po_F4_Help_Input).

I will get purchaseorder from (Z_Po_F4_Help_Input) and some data has to be displayed in table from Bapi_Po_Getitems_Input model.

I mapped Z_Po_F4_Help_Input (MainNode)

OUTPUT1(SubNode)

Po_Items(SubNode)

PurchaseOrder(Attribute) to VIEW1

<b> and</b>

Bapi_Po_Getitems_Input(MainNode)

OUTPUT(SubNode)

I_KKO(Subnode)

Net_Price,po_item..etc as Attributes to VIEW2

and Z_Po_F4_Help_Input (MainNode)

OUTPUT1(SubNode)

Po_Items(SubNode)

PurchaseOrder(Attribute)

Bapi_Po_Getitems_Input(MainNode)

OUTPUT(SubNode)

I_KKO(Subnode) Net_Price,po_item..etc to

CustomController

the code i used to execute these 2 models is


 public void wdDoInit()
  {
    //@@begin wdDoInit()
	Z_Po_F4_Help_Input F4Item=new Z_Po_F4_Help_Input();
    wdContext.nodeZ_Po_F4_Help_Input().bind(F4Item);
    
	Bapi_Po_Getitems_Input PoItem= new Bapi_Po_Getitems_Input();
    wdContext.nodeBapi_Po_Getitems_Input().bind(PoItem);
try
	{
		wdContext.currentZ_Po_F4_Help_InputElement().modelObject().execute();
		wdContext.nodeOutput().invalidate();
		wdComponentAPI .getMessageManager().reportSuccess("Controller:size of F4 Outputnode"+wdContext.nodeI_Ekko().size());
		
		wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();
		wdContext.nodeOutput1().invalidate();
		
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}

The problem here is only the model Z_Po_F4_Help_Input is getting executed and giving its size as 3000.But the model Bapi_Po_Getitems_Input is not getting executed and giving its size as 0

can any one plz tell me where is the problem

Regards

Padma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

try putting two execute methods in two different try catch block

try

{

wdContext.currentZ_Po_F4_Help_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

wdComponentAPI .getMessageManager().reportSuccess("Controller:size of F4 Outputnode"+wdContext.nodeI_Ekko().size());

}catch(WDDynamicRFCExecuteException e){

wdComponentAPI.getMessageManager().raiseException(e.getMessage(), true);

}

try{

wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();

wdContext.nodeOutput1().invalidate();

}

}catch(WDDynamicRFCExecuteException e1){

wdComponentAPI.getMessageManager().raiseException(e1.getMessage(), true);

}

Regards

Akshaya

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Padma,

Just check that your Bapi_Po_Getitems_Input doesn't require an input parameter.

Also, try executing this Bapi_Po_Getitems_Input directly in R/3 and see how many rows do you get there.

Warm Regards,

Murtuza

former_member185029
Active Contributor
0 Kudos

Hi,

Can you try commenting the node.invalidate statements?

Also try printing exception using message manager.

Let me know the output

Ashutosh

Former Member
0 Kudos

Hi Padma,

Have u tried to debug it,whether bapi is called or not??Go to r/3 system,transaction code SE37 . open the bapi, put external breakpoint there & run ur application. Check whether bapi is called or not.it should be called according to ur code.

regards

Sumit

Former Member
0 Kudos

Hi,

I used the same functionModule in another project.It is giving records and i sucessfully displayed in a table.But in this project i am getting error.I am not getting where the problem is comming??

Control is going ito try{}block but no values are comming from module.


wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();

It has to get all the data from backend right.

Regards

Padma

Former Member
0 Kudos

Hi Padma,

It seems that your problem is with binding the output node to the table.

Just right click on the table UI element select create binding and see that you have binded the elements of node output1 to the table in your project where you are not getting the output.

Warm Regards,

Murtuza