cancel
Showing results for 
Search instead for 
Did you mean: 

try...catch question!

Former Member
0 Kudos

Hi,

I tried to understand this try...catch statement really can't get. Please someone explain this to me.

try {

bapiInput.execute();

queryOutputNode.bind(bapiInput.getOutput().getFlight_List());

} catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false);

}

If I want to replace one line of code at the third line to copy the elements, how can I copy one node from another node with different elements?

try {

bapiInput.execute();

WDCopyService.copyCorresponding(bapiInput.getOutput().getFlight_List(),

wdContext.nodeOVSAirportQueryOutput());

//queryOutputNode.bind(bapiInput.getDestination_From());

} catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

msgMgr.reportException(e.getLocalizedMessage(), false);

}

Regards,

-Napadol

Accepted Solutions (1)

Accepted Solutions (1)

dhawal_joshi
Employee
Employee
0 Kudos

Hi Napadol ,

When you import an BAPI as Model in Web Dynpro, it results in Model classes of type _Input and _Output . Input classes represents the Input parameters to the RFC similarly output class represents the out parameters of RFC. Input Model class is also related via a relation to output classes

Input classes are executable classes and when you invoke an execute method , an RFC is called , the output of RFC can be reached via method call

bapiInput.getOutput() . This will return just the Output Model class instance, now as there can be many output parameters , thus again output model class is also related to other model class such as FlightList and to get the object of FlightList we could use bapiInput.getOutput().getFlight_List().

At runtime data is collected in instances of these model class , while context is used to propagate the data. QueryOutputNode is a node in a context and to propagate the data from one model class to different controllers this binding is required.

This will ensure that any update from server to this object or any change in object parameter values from UI by user could smoothly be propagated .

regards

Dhawal

Former Member
0 Kudos

Hi Dhawal,

Thank you so much for explaining this to me, and I understand it more now. Another issue, I created another RFC model node under the Bapi_Flight_Getlist_Input called Airport that contains the objects of Airportid, City, Countr, and Countr_Iso. The RFC output node is called OVSAirportQueryOutput that contains the same objects as RFC Airport node, and the Value node OVSAirportQueryInput that has been created for search values to be applied to. It has the same objects as the other two nodes.

At run time, I want to do the same thing as the Flight_List calling the same method, but it doesn't give me the values of the objects of the RFC Airport node (Airportid, City, Countr, Count_Iso), instead it gives me a blank table. So, I don't know what the problem is.

Someone told me to use a WdCopyService to copy the objects from RFC Flight_List node to the RFC OVSAirportQueryOutput node, but both of them have different objects or elements. I don't know other ways around (very less experience with Web Dynpro). Please help me to solve this problem to bring up the values of the RFC Airport node into the hit list search table.

I would greatly appreciate your help.

Regards,

-Napadol

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you be a little more clear on your question? What is that you cannot understand in the try...catch block?

Former Member
0 Kudos

Hi,

What I don't understand is the queryOutputNode.bind(bapiInput.getOutput().getFlight_List()); what is the reason for binding the bapiInput.getOutput?

Regards,

-Napadol