Skip to Content
0
Former Member
Mar 17, 2009 at 09:23 AM

Calling RFCs in Java WebDynpro

24 Views

Hello Experts,

I'm new to WebDynpro. I'm a novice at best and have just learned the basics. I'll probably be asking a lot of questions about this soon. Here is one problem I recently encountered:

I managed to call RFCs from R/3 using a user input and then another one by using one field retrieved from the first called RFC. Now i have to call a BAPI recursively from the data I got from the 2nd RFC that I called.

Here is the code so far:

public void executeBapi_Network_Getdetail_Input( )
  {
    //@@begin executeBapi_Network_Getdetail_Input()
    //$$begin Service Controller(246259973)
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
    try
    {
      BigDecimal plannedCost = new BigDecimal(0);
	  for (int i=0; i<wdContext.nodeZps_Fm_Get_Network_Num_Input().nodeNetworks().nodeEx_Networks().size(); i++) {
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network(false);
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network_Activity(true);
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Relation(true);
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Element(true);
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Milestone(true);
		wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Component(true);
		wdContext.currentBapi_Network_Getdetail_InputElement().setNumber(
		  wdContext.nodeZps_Fm_Get_Network_Num_Input().nodeNetworks().nodeEx_Networks().getEx_NetworksElementAt(i).getAufnr());
		wdContext.currentBapi_Network_Getdetail_InputElement().modelObject().execute();
		wdContext.nodeNetworkDetails().invalidate();
		plannedCost.add(wdContext.nodeBapi_Network_Getdetail_Input().nodeNetworkDetails().nodeE_Network().getE_NetworkElementAt(i).getPlanned_Cost());
	  }
    }

sorry if this is totally wrong. I'm totally a newbie here.

Hoping for your kind and helpful responses.

Cheers,

Alfonso