Is the sentence “While i was traveling i had seen beautiful buildings.” ungrammatical?

It isn't incorrect (except that 'I' should always be in upper case). As a sentence on its own, it's probably better with 'saw', but you could say something like "While I was travelling I had seen some beautiful buildings, but the new art gallery in my home town was as fine as any of them".


This is NOT grammatical.

The correct wording should be

While I was travelling, I saw beautiful buildings.

This is because the use of "while" implies doing something at the same time in both clauses of the sentence. "Had been" implies that the buildings were seen before they were travelling.

Please refer to this site for uses of the past perfect.