Professional Documents
Culture Documents
import mypackage.util.*;
import com.sap.aii.proxy.framework.core.*;
import com.sap.mw.jco.*;
import java.sql.Date;
public class MyMainClass {
public static void main(String[] args)
throws ApplicationFaultException, SystemFaultException {
JCO.Client jcoclient =
JCO.createClient(
"100",
"abm-abap-19",
"abcd1234",
"EN",
"devqa37.mcgm.gov.in",
"00"
);
jcoclient.connect();
Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
BapisfldstType fromAirport = new BapisfldstType();
BapisfldstType toAirport = new BapisfldstType();
fromAirport.setAirportid("JFK");
toAirport.setAirportid("FRA");
BapisfldraType dateRange1 = new BapisfldraType();
dateRange1.setSign("I");
dateRange1.setOption("BT");
dateRange1.setLow(Date.valueOf("2002-10-01"));
dateRange1.setHigh(Date.valueOf("2003-01-01"));
BapisfldraType dateRange2 = new BapisfldraType();
dateRange2.setLow(Date.valueOf("2003-06-01"));
dateRange2.setHigh(Date.valueOf("2003-11-01"));
dateRange2.setOption("BT");
dateRange2.setSign("I");
BapisfldraType_List dateRangeList = new BapisfldraType_List();
dateRangeList.addBapisfldraType(dateRange1);
dateRangeList.addBapisfldraType(dateRange2);
input.setAirline("LH");
/* input.setDestination_From(fromAirport);
input.setDestination_To(toAirport);
input.setDate_Range(dateRangeList);*/
MyProxy_PortType myproxy = new MyProxy_PortType();
myproxy.messageSpecifier.setJcoClient(jcoclient);
Bapi_Flight_Getlist_Output output = m
yproxy.bapi_Flight_Getlist(input);
jcoclient.disconnect();
BapisfldatType_List list = output.get_as_listFlight_List();
int listsize = list.size();
for (int i = 0; i < listsize; i++) {
BapisfldatType elem = list.getBapisfldatType(i);
System.out.println(
"Date: "
+ elem.getArrdate()
+ '\t'
+ "Arrive: "
+ elem.getArrtime());
}
}
}