cancel
Showing results for 
Search instead for 
Did you mean: 

Explanation of some code samples

Former Member
0 Kudos

Hello,

can you explain me some code samples?

First:
try{
wdContext.currentBapi_Flight_Getlist_InputElement().
modelObject().execute();
}
catch (Exception ex){
ex.printStackTrace();
}
wdContext.nodeOutput().invalidate();

Second:

Bapi_Flight_Getlist_Input input =

new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(input);

input.setDestination_From(new Bapisfldst());

input.setDestination_To(new Bapisfldst());

Thanks for your help,

André

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Basically this has to be viewed based on the way in which SAP has structured the tables in ABAP.We can provide input and based on the input we will get the necessary output.In this way SAP has structured in Webdynpro also.

The second code deals with specifying the input details.The model node has the structure of both input as well as output.we are binding the value of input .In the current scenario the beginning and destination cities are to be provided.

Once you have bound this value to the input you can execute the RFC.This is what is shown in the first code.

Hope I answered your query.

Former Member
0 Kudos

Hi Andre,

I hope you know how Rfcs work so I shall start of from there. So i shall explain with the little amount of grasp I have in the topic

First:

What the first code does is, to connect to the R/3 system and execute the RFC/BAPI with the input populated in the context node.

invalidate is used to refresh the output node .

Second:

This part of the code is to bind the imported model of the RFC to the context model node and also to instantiate an instance of the structure to input the values into the table(input.setDestination_From(new Bapisfldst())).

Hope this would explain a bit.

Do reply with your feedback.

Regards

Noufal

Former Member
0 Kudos

A good explanation of the Web Dynpro concepts like controller, context, model and adaptive remote function call can be found in the book "Inside Web Dynpro" by Chris Whealy.

<a href="

http://www.sap-press.com/product.cfm?account=&product=H983

">http://www.sap-press.com/product.cfm?account=&product=H983</a>

It explains also your code snippets.

Armin