Post on 03-Apr-2018
7/28/2019 Solution Modify Search Flight
1/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.
7/28/2019 Solution Modify Search Flight
2/31
The wizard opens with the log in details of the R/3 system. Enter the password and click on next.
7/28/2019 Solution Modify Search Flight
3/31
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.
7/28/2019 Solution Modify Search Flight
4/31
The BAPI is import and a warning message is displayed. Hit on OK.
7/28/2019 Solution Modify Search Flight
5/31
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.
7/28/2019 Solution Modify Search Flight
6/31
7/28/2019 Solution Modify Search Flight
7/31
7/28/2019 Solution Modify Search Flight
8/31
Create a new node under the SearchForm node for the carrier l ist. Add two attributes to it for the
Carrier Code and Carrier Name
7/28/2019 Solution Modify Search Flight
9/31
7/28/2019 Solution Modify Search Flight
10/31
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.
7/28/2019 Solution Modify Search Flight
11/31
7/28/2019 Solution Modify Search Flight
12/31
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.
7/28/2019 Solution Modify Search Flight
13/31
Below is the code entered:
/ / Code to bi nd t he t he car r i er l i st RFC and t hen execut e i t
wdCont ext. nodeZbapi _Fl i ght _Car r i er s_I nput ( ) . bi nd(newZbapi _Fl i ght _Car r i er s_I nput ( ) ) ;
try{
wdCont ext. cur r ent Zbapi _Fl i ght _Car r i er s_I nput El ement ( ) . model Obj ect ( ) . execute();
wdCont ext . nodeCar r i er Out put ( ) . i nval i dat e( ) ;}catch( WDDynami cRFCExecut eExcept i on r f cExcept i on) {
wdComponent API . getMessageManager( ) . r epor t Except i on( r f cExcept i on. getMessage( ) , false) ;
}
/ / Code to copy t he val ues f r ombapi out put t o sear ch f or m nodeif( wdCont ext. nodeCar r i er s( ) . si ze( ) > 0){
int noOf Car r i er s = wdCont ext. nodeCar r i er s( ) . si ze( ) ;/ / Def i ne var i abl e f or car r i er l i st el ement I Publ i cSr chFl ght Demo06Comp. I Car r i er Li st El ement car r i er El ement ;
for( int i Count=0; i Count
7/28/2019 Solution Modify Search Flight
14/31
Edi t t he code i n the sear chFl i ght met hod t o t ake t he sel ect ed val ue f r omt henode.
7/28/2019 Solution Modify Search Flight
15/31
Below is the code entered:
/ / Comment code f or ai r l i ne code comi ng and wr i t e code f or get t i ng val ue f r omt he node wi t h car r i er l i st
/ / t he sel ected el ement can be got usi ng the cur r ent el ement method/ / i f no el ement i s sel ect ed t hen cur r ent el ement i s nul l . Put a check
f or t he nul l el ement . / /
wdCont ext . cur r ent Bapi _Fl i ght _Get l i st _I nput El ement ( ) . set Ai r l i ne( wdCont ext . cur r ent Sear chFor mI nput El ement ( ) . get Car r i er Cd( ) ) ;
if ( wdCont ext . cur r ent Car r i er Li st El ement ( ) ! = null)
wdCont ext . cur r ent Bapi _Fl i ght _Get l i st _I nput El ement ( ) . set Ai r l i ne( wdCont ext . cur r ent Car r i er Li st El ement ( ) . get Car r i er Cd( ) ) ;
Then remove the input field from the search form and put a DropdownByIndex. Bind the drop down to
the carrierlist node.
7/28/2019 Solution Modify Search Flight
16/31
7/28/2019 Solution Modify Search Flight
17/31
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:
7/28/2019 Solution Modify Search Flight
18/31
7/28/2019 Solution Modify Search Flight
19/31
7/28/2019 Solution Modify Search Flight
20/31
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.
7/28/2019 Solution Modify Search Flight
21/31
Apply the Action button template on the search form to fire the plug.
7/28/2019 Solution Modify Search Flight
22/31
7/28/2019 Solution Modify Search Flight
23/31
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 FlightDateto Dateand Priceto Float.
7/28/2019 Solution Modify Search Flight
24/31
Create the context mapping for the node to both the views.
7/28/2019 Solution Modify Search Flight
25/31
7/28/2019 Solution Modify Search Flight
26/31
7/28/2019 Solution Modify Search Flight
27/31
Enter the code to copy the selected record from the table to the SelectedFlight node.
7/28/2019 Solution Modify Search Flight
28/31
Below is the code entered:
/ / Copy dat a f r omt he t abl e node to t he node passi ng val ue t o t he nextscr een
wdCont ext . cur r ent Sel ect Fl i ght El ement ( ) . set Ai r l i ne( wdCont ext. cur r ent Fl i ght _Li st El ement ( ) . get Ai r l i ne( ) ) ;
wdCont ext. cur r ent Sel ect Fl i ght El ement ( ) . set Ci t yFr om( wdCont ext. cur r ent Fl ight _Li st El ement ( ) . get Ci t yf r om( ) ) ;
wdCont ext. cur r ent Sel ect Fl i ght El ement ( ) . set Ci t yTo( wdCont ext . cur r ent Fl i ght _Li stEl ement ( ) . get Ci t yt o( ) ) ;
wdCont ext. cur r ent Sel ect Fl i ght El ement ( ) . set Fl i ght Dat e( wdCont ext . cur r ent Fl i ght _Li stEl ement ( ) . get Fl i ght dat e( ) ) ;
wdCont ext. cur r ent Sel ect Fl i ght El ement ( ) . set Pri ce( wdCont ext . cur r ent Fl i ght_Li st El ement ( ) . getPr i ce( ) . f l oat Val ue( ) ) ;
7/28/2019 Solution Modify Search Flight
29/31
In the SelectedFlightView add an Adobe Interactive form element and set the properties to as shown
below:
7/28/2019 Solution Modify Search Flight
30/31
Edit the interactive form and create the layout as shown below.
7/28/2019 Solution Modify Search Flight
31/31
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.