Hi Akriti,
Attached you'll find program that calls BAPI_FLIGHT_GETDETAIL from an XML file. It is a combination of 3 programs I found on SCN. Basically it parses XML file, then reads BAPI Interface structure from BAPI name and then builds call to BAPI dynamically. In this case we are reading data out of SAP. You'll have to adjust it to update data, if that is what you want.
Hope this helps.
Regards,
Ernesto