cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC Calls

Former Member
0 Kudos

Hi everybody,

From the tutorial I know how to populate a table from an RFC call by using 'create binding' from the context menu of the table. I want to know how I can output data from a RFC without having an input field and search button. So as soon as I launch the Dynpro app there is some data in the table from the backend.

Thanks.

MK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Execute the RFC not from an action handler but from another method like the controller initialization method wdDoInit() or from an inbound plug.

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi if u want to see the output while launcing the application put the necessary code in wdDoInit()method.

call the required bapi and supply all the mandatory info for that bapi to get accurate results.

satish

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You would put your call to the BAPI in the wdDoInit method of the controller.

Here is some code from an application I did where there is no input parameter and the data is displayed in the application right away.

  public void wdDoInit()
  {
    //@@begin wdDoInit()

//       Bind to the context
		Z_Ep_Get_Ytd_Sales_Input input = new Z_Ep_Get_Ytd_Sales_Input();
		wdContext.nodeZ_EP_GET_YTD_SALES().bind(input);


		try {
//      calls remote function module Z_EP_GET_YTD_SALES
			wdContext
				.currentZ_EP_GET_YTD_SALESElement()
				.modelObject()
				.execute();
		} catch (Exception ex) {
//       If an exception is thrown, then the stack trace will be printed   
			ex.printStackTrace();
		}

		wdContext.nodeOutput().invalidate();

    //@@end
  }

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Krishnan,

Use the code given by Rich. But before executing your model set the input data of your bapi as given below:

wdContext.current<node>Element().set<attribute>(<Value>);

Regards,

Bhavik