cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with BAPI_FLIGHT_GETLIST

Former Member
0 Kudos

Hi

I am using BAPI_FLIGHT_GETLIST to get list of flights but depending on some input criteria eg. on a particular date. I have written code upto this:

Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input(); wdContext.nodeBapi_Flight_Getlist_Input().bind(input);

I wiil accept date from user.

Now what to do ?

Please help in the steps with code.

Thanks

Ananda

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Ananda,

1. You need to create a Model node in the controller context and bind it to the model.

2. Next you create an instance of the model. Which you have already done...

3. Third you create an execute method to execute the model (refer to the link / example below)

4. Fourth create a user input for the dates and bind them to some view context model elements

5. Map the model elements to the Model elements in the controller (Created in the first step)

6. Create a button and action on the view and have it call the execute method in step 3.

This link should walk you though the process of executing a model in web dynpro: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on accessing abap functions in web dynpro - 4.htm

Please reward points if helpful.

Thanks,

Tom

Former Member
0 Kudos

Hi Thomas

I know how to create, code and execute a simple BAPI from WDP.

My problem is "I want to display flight between 2 dates" taking input from user.

I have accepted that dates from user as string YYYYMMDD.I also wanted to initialize the Model attributes such as 'SIGN' under the model node Date_range

Already what I have coded is

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());
input.setDate_Range(.......)

Now what should be in the (.....)

Please help.

Regards

Ananda

Yashpal
Active Contributor
0 Kudos

input.setDate_Range(.......)

..........means u have to pass an object of class Bapisfldra which contains attributes ,high ,low,option ,sign

create a object of class Bapisfldra

set the attributes value and pass it......

Thanks,

Yashpal

Former Member
0 Kudos

But when I coding input.setDate_Range(new Bapisfldra()) it is showing error.

Instead input.setDate_Range(.......)is excepting AbstraclList List .

I am confused

Please help

Ananda

Yashpal
Active Contributor
0 Kudos

check is there any method with different signature accepting input as Bapisfldra object..