You are on page 1of 31

First import the new RFC for retrieving the Carrier List.

The RFC can be import in the same model. Select the model and right click on it. Select the re-import option.

The wizard opens with the log in details of the R/3 system. Enter the password and click on next.

The search wizard is displayed and the bapi already imported the in the model is shown in the working set section. Search for the ZBAPI_FLIGHT_CARRIERS and select it.

The BAPI is import and a warning message is displayed. Hit on OK.

Create the context for the BAPI in the component controller. Select the model binding link the component controller diagram and double click on it. It displays the existing model bindings. Create the new model binding for the ZBAPI_FLIGHT_CARRIERS RFC.

Create a new node under the SearchForm node for the carrier list. Add two attributes to it for the Carrier Code and Carrier Name

Go to the component controller diagram and double click on the link between the view and component controller. Create the context mapping for the new node in the Search Form View.

Write code in the component controller wdDoInit method to initialize and execute the ZBAPI_FLIGHT_CARRIERS RFC. The copy the values from the RFC output to the CarrierList node.

Below is the code entered:


//Code to bind the the carrier list RFC and then execute it wdContext.nodeZbapi_Flight_Carriers_Input().bind(new Zbapi_Flight_Carriers_Input());

try{ wdContext.currentZbapi_Flight_Carriers_InputElement().modelObject().exe cute(); wdContext.nodeCarrierOutput().invalidate(); }catch(WDDynamicRFCExecuteException rfcException){ wdComponentAPI.getMessageManager().reportException(rfcException.getMess age(), false); }

//Code to copy the values from bapi output to search form node if(wdContext.nodeCarriers().size() > 0) { int noOfCarriers = wdContext.nodeCarriers().size(); //Define variable for carrier list element IPublicSrchFlghtDemo06Comp.ICarrierListElement carrierElement; for(int iCount=0; iCount<noOfCarriers;iCount++) { //First create the node element carrierElement = wdContext.nodeCarrierList().createCarrierListElement(); //then add the node element to the node wdContext.nodeCarrierList().addElement(carrierElement); //Copy values from the iCount element in output to new carrier element created carrierElement.setCarrierCd(wdContext.nodeCarriers().getCarriersElement At(iCount).getCarrid()); carrierElement.setCarrierName(wdContext.nodeCarriers().getCarriersEleme ntAt(iCount).getCarrname()); } }

Edit the code in the searchFlight method to take the selected value from the node.

Below is the code entered:


//Comment code for airline code coming and write code for getting value from the node with carrier list // the selected element can be got using the current element method // if no element is selected then current element is null. Put a check for the null element. // wdContext.currentBapi_Flight_Getlist_InputElement().setAirline(wdContex t.currentSearchFormInputElement().getCarrierCd()); if (wdContext.currentCarrierListElement() != null) wdContext.currentBapi_Flight_Getlist_InputElement().setAirline(wdContex t.currentCarrierListElement().getCarrierCd());

Then remove the input field from the search form and put a DropdownByIndex. Bind the drop down to the carrierlist node.

Now we have to create a new view for the Adobe Form. For this right click on the window and select the Embed View from the menu. And enter the values in the wizard as shown below:

Then create the navigation between the Search View and the Adobe Form View. Create the outbound plug on the Search View and inbound plug on the Adobe View. Then connect them with the navigation link.

Apply the Action button template on the search form to fire the plug.

Create a new node to hold the selected record data. Create the structure as shown below. Set the cardinality of the node to 1..1.And set the data type for FlightDate to Date and Price to Float.

Create the context mapping for the node to both the views.

Enter the code to copy the selected record from the table to the SelectedFlight node.

Below is the code entered:


//Copy data from the table node to the node passing value to the next screen wdContext.currentSelectFlightElement().setAirline(wdContext.currentFlight_Lis tElement().getAirline()); wdContext.currentSelectFlightElement().setCityFrom(wdContext.currentFli ght_ListElement().getCityfrom()); wdContext.currentSelectFlightElement().setCityTo(wdContext.currentFligh t_ListElement().getCityto()); wdContext.currentSelectFlightElement().setFlightDate(wdContext.currentF light_ListElement().getFlightdate()); wdContext.currentSelectFlightElement().setPrice(wdContext.currentFlight _ListElement().getPrice().floatValue());

In the SelectedFlightView add an Adobe Interactive form element and set the properties to as shown below:

Edit the interactive form and create the layout as shown below.

Build and deploy the application. The below screen should be displayed.

On selecting a record and clicking on select the adobe form should be displayed.

You might also like