The problem is, that the numbers in the timetables are IATA based flight numbers, the flight id's you can receive with RB are alphanumeric ICAO flight id's. There is no official place were you can download a tie-up table of Lufthansa IATA flight numbers and the related ICAO flight id. Same counts for a lot of Air Berlin flights. As far as I know there is no other way as you are already using. Except the fact, that many flight tracking pages are knowing both numbers (ICAO and IATA).