cancel
Showing results for 
Search instead for 
Did you mean: 

Problem linking views

Former Member
0 Kudos

Hi everyone,

I made a webdynpro application accessing ABAP functions. I can bring data with the BAPI function at the moment I press the buttom but after this, the connection between the views is not done. The code for the method associated is:

 

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

	wdThis.wdGetAccesoCustController().executeZbapi_Hr_Acceso_Input();
	
       int n = wdContext.currentOutputElement().getError();
	
	
	if (n == 0)
	{
		wdThis.wdFirePlugToMenu();
	}else{
		msgmgr.reportException("Ha ocurrido un error ", true);
	}

  }

If I just leave the line

wdThis.wdFirePlugToMenu();

, the connection between the views is done and i can see the next view.

FYI, this is the code of the method executeZbapi_Hr_Acceso_Input( 😞


public void executeZbapi_Hr_Acceso_Input( )
  {
    //@@begin executeZbapi_Hr_Acceso_Input()
	Zbapi_Hr_Acceso_Input input = new Zbapi_Hr_Acceso_Input();
	wdContext.nodeZbapi_Hr_Acceso_Input().bind(input);
	// Create new elements in the Destination_From and Destination_To nodes
	input.setCed("13537571");
	input.setPass("00000000");
	int n;
	String s;
	IWDMessageManager msgmgr = wdComponentAPI.getMessageManager();
	
	try {	
		// Calls remote function module BAPI_FLIGHT_GETLIST 
	
		
		wdContext.currentZbapi_Hr_Acceso_InputElement().modelObject().execute();
		// Synchronise the data in the context with the data in the model
		
		wdContext.nodeOutput().invalidate();
	

	} 
	catch (Exception ex) {
		// If an exception is thrown, then the stack trace will be printed
	
		ex.printStackTrace();
		msgmgr.reportException(ex.toString(), true);
	}
    //@@end
  }

What could it be the problem?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi!

Problem resolved! I had to comment all the lines that print messages before call the next view!

Former Member
0 Kudos

That means the control is not going to the if statement ...try to debug and see the value of n retrieved after executing the model....also try to put the wdcontext.nodeOutput.invalidate() statement outside the try block.....and see...

Regards,

Shikhil

Former Member
0 Kudos

Hi Yelimar,

1) Check what the size of the output node is after the execution of the BAPI. Since you havent mentioned anything aboutt a null pointer on execution. If the BAPI was not executing properly the application would throw a null pointer for the code:

int n = wdContext.currentOutputElement().getError();

So, BAPI is definitely being executed and the output node is not null. But, confirm if the BAPI is being executed properly.

2) Please check the output of the BAPI from SAP GUI and compare if the same output is obtained in Web Dynpro.

The currentOutputElement method would access the lead selected output node element. This might not be the element having the error code if there are multiple node element retrieved.

3) Ensure you have properly linked the output and input plugs of the views with the navigation links.

Also, please mention the output.

Regards,

kartikaye j gomber

Former Member
0 Kudos

Hi Kartikaye ,

I have verified that the result of the BAPI is the same in the web dynpro and the SAP GUI. The output and input links are correct, I can verify them just using the method that connect the views

 wdThis.wdFirePlugToMenu(); 

and the linking is done. The problem is when I call both methods (the one that executes the BAPI and the other one that makes the linking).

Any help?

Former Member
0 Kudos

Hi Shikhil,

The control is going through the if statement because I have put code to get messages during the execution of the application and it works. Also, I tried putting the wdcontext.nodeOutput.invalidate() statement outside the try block and nothing happens...

Any help?