Skip to Content
0
Former Member
Jun 26, 2008 at 11:49 AM

URGENT:CAF

29 Views

hi all,

I am new to caf development in DC i have created Application Service in that apllication service i have used an External service BAPI_FLIGHT_GETLIST and in that i have taken input parameter as Airlineid and based on that i am retreving the flightlist details inorder to print the output i have taken a list and after i am setting that list to retvalue.it is working fine but the problem iam facing is only one record is populated in the entire table i.e(first row is repeating) so for that i have used the fallowing code.......

BAPI__FLIGHT__GETLIST inp;

BAPI__FLIGHT__GETLIST_dot_Response out;

BAPI__FLIGHT__GETLISTLocal extref = this.getBAPI__FLIGHT__GETLIST();

inp = new BAPI__FLIGHT__GETLIST();

inp.setAIRLINE(airline);

try

{

out = new BAPI__FLIGHT__GETLIST_dot_Response();

out = extref.BAPI__FLIGHT__GETLIST(inp);

com.sap.testapplicationservice.extsrv.bapi__flight__getlist.output.FLIGHT__LIST fl;

fl = new com.sap.testapplicationservice.extsrv.bapi__flight__getlist.output.FLIGHT__LIST();

fl = out.getFLIGHT__LIST();

AbstractCollection fl_col;

Iterator fl_it;

com.sap.testapplicationservice.extsrv.bapi__flight__getlist.output.BAPISFLDAT fl_struct;

fl_col = (AbstractCollection)fl.getItem();

fl_it = fl_col.iterator();

output res = new output();

int count = 0;

retValue = new ArrayList();

while (fl_it.next()!=null)

{

fl_struct = (com.sap.testapplicationservice.extsrv.bapi__flight__getlist.output.BAPISFLDAT)fl_it.next();

res.setFldate(fl_struct.getFLIGHTDATE());

res.setDepttime(fl_struct.getAIRLINE());

res.setArrtime(fl_struct.getCITYFROM());

retValue.add(count,res);

count++;

}

}

catch (Exception e) {

// TODO: handle exception

System.out.println(e.getStackTrace().toString());

throw new ServiceException(e);

}

so plz help me out in solving this issue....