William Witman II, 64, a Foreign Service officer for almost 40 years until his retirement in 1974 and a former ambassador to Togo, died at Georgetown University Hospital on Sunday as the result of a pulmonary illness.

Ambassador Witman was born in Harrisburg, Pa. He attended schools in this county and in Switzerland before going to Yale University, from which he graduated in 1935. He joined the Foreign Service in the same year.

His foreign assignments included Lebanon, Turkey, Greece and India. In 1949, he became the State Department officer in charge of relations with India, Nepal and Ceylon.

He served at the United Nations General Assembly in 1952 and then in Tangier, Morocco. From 1955 to 1957, he was deputy director of the State Department's office fo South Asian Affairs. He then was assigned to Paris for three years. From 1960 to 1962, he headed the department's office of North African affairs. In 1962, he attended the independence ceremonies of Algeria as President Kennedy's personal representative.

In 1964, he was appointed ambassador to Togo, a post he held for three years. Subsequent assignments in the State Department were to the Policy Planning Council, as director of the office of Inter-African affairs, and as acting deputy assistant secretary of state for African affairs. At the time of his retirement, he was a special assistant to the secretary of state for African affairs.

Ambassador Witman was a recipient of the State Department's Superior Service Award.

Survivors include his wife, Melpomene, of the home in Arlington, and two sisters, Harriet Hoag, of Phoenix, Ariz, and Barbara Rogers, of Harrisburg, Pa.

The family suggests that expressions of sympathy be in the form of contributions to the Pulmonary Disease Division, Georgetown University Hospital, Washington, D.C.