cancel
Showing results for 
Search instead for 
Did you mean: 

OVS problem..please help!

Former Member
0 Kudos

Hi All,

Please someone help me with this.

From the Web Dynpro OVS Valuehelp tutorial, I added an advanced search for the airport. I added RFC airport node as a child node of Bapi_Flight_Getlist_Input, and it has 4 elements; Airportid, City, Countr, and Countr_Iso. I did “Edit Model Binding” to import and bring Destination_From(Bapisfldst) to the Bapi_Flight_Getlist_Input RFC node. The RFC output node is OVSAirportQueryOutput, and the Value Node is OVSAirportQueryInput. Both of them have the same elements as the RFC airport node.

At runtime, it doesn’t give me a hit list of the airport in the table when I type in the airport code for the search. It only gives me a blank table without record. How can I get the record of the airport values to show on the table?

This is the code.

public void onQuery(IWDNodeElement queryInputNodeElement, IWDNode queryOutputNode) {

IPublicOVSCust.IOVSAirportQueryInputElement input =

(IPublicOVSCust.IOVSAirportQueryInputElement) queryInputNodeElement;

IPublicOVSCust.IOVSAirportQueryOutputNode output =

(IPublicOVSCust.IOVSAirportQueryOutputNode) queryOutputNode;

Bapi_Flight_Getlist_Input bapiInput = new Bapi_Flight_Getlist_Input();

Bapisfldst bapiAirport = new Bapisfldst();

Bapisfldst bapiCity = new Bapisfldst();

Bapisfldst bapiCountry = new Bapisfldst();

if (input.getAirportid() != null) {

bapiAirport.setAirportid(input.getAirportid());

}

if (input.getCity() != null) {

bapiCity.setCity(input.getCity());

}

if (input.getCountr() != null) {

bapiCountry.setCountr(input.getCountr());

}

bapiInput.setDestination_From(bapiAirport);

bapiInput.setDestination_From(bapiCity);

bapiInput.setDestination_From(bapiCountry);

try {

bapiInput.execute();

<b>what should I put in here?</b>

} catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

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

}

}

Please help!

-Napadol

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

You need to get the result from BAPI and bind it to <b>queryOutputNode</b>.

You have executed the BAPI now you just need to get result returned and bind that to the queryOutputNode.

Best Regards,

Ashwani Kr Sharma

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks to all. This problem has been solved by Vishal.

Former Member
0 Kudos

Hi Don,

Couple of things here.

First, it seems wrong that you need three instances of Bapisfldst structure to pass airport, city and country to Bapi_Flight_Getlist. In your code the last instance of this structure will overwrite previous two destination_from assignments. So just create one instance of Bapisfldst and set three fields in it from corresponding fields of input element.

Second, do a signle function test in SAP to ensure that with the parameter you are passing, BAPI does in fact return something.

And last, I don't think you may be able to to just bind the BAPI output flightlist node to airportqueryoutput value node, since attributes in this node are subset of flightlist model output node. So you may need to use wdcopy services to copycorresponding fields of each element.

Regards,

Vishal

Former Member
0 Kudos

Hi,

The first step that you have check is the output node need is model node not value node.

Now you have bind the result to Output.

Output.bind(bapiInput.getOutput().get<<node result>>());

Regards,

Edson Thomaz

former_member751941
Active Contributor
0 Kudos

Hi Napadol,

Here is the code.

try {

bapiInput.modelObject().execute();

bapiInput.node().getChildNode("Output", 0).invalidate();

} catch (Exception e) {

IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();

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

}

You can also check this thread [page 3] steps are given.

Regards,

Mithu