After 22 weeks of sometimes bitter labor negotiations, the striking Writers' Guild of America reached a tentative agreement with the Alliance of Motion Picture and Television Producers here Wednesday.

Terms of the agreement were not disclosed pending final ratification of the proposal by the writers' union 9,000-member rank and file. But spokesmen from the two factions claimed it represented "the best possible deal" for both the writers and the producers."No one ever really wins in a strike," said federal mediator Floyd Wood in announcing the agreement at the producers' Sherman Oaks headquarters. "It was time to bring it to a conclusion, and that's what we did."

Hollywood scriptwriters have been off the job since March, when disagreement over creative control and residuals paid to writers for programs sold to foreign syndication led to a walkout that lasted for 155 days. The work stoppage has crippled the film and television industry, stifling development of upcoming projects and forcing television programmers to postpone the 1988 fall television season indefinitely.

The strike has also had serious impact on a variety of other businesses here and in New York. Restaurantsnear studios were unusually empty. Costume supply companies and other industry-related businesses had to lay off employees to compensate for the lack of business.

In all, an estimated 200,000 workers have been affected by the writers' strike, resulting in industry losses near $150 million.

But all that will be over if the Writers' Guild membership ratifies the contract on Sunday, as they are expected to do. Guild president George Kirgo said the guild's board of directors approved the agreement Wednesday night and urged the rank and file to follow suit.

"With any luck," Kirgo said, "we can all be back to work by Monday."

Insiders close to the negotiations say that when the writers return to work they will have greater creative control over their work and a bigger slice of the foreign sales pie. However, they won't have as much of the syndicated sales of hourlong television series - a small loss, according to most observers, since hourlong programs aren't selling very well in syndication anyway.

"We didn't achieve everything we wanted," said Brian Walton, chief negotiator for the writers. "But neither did they. For either side to claim a victory at this point is hollow. The important thing is, we can now finally put the industry back to work."

Work has never really stopped in the motion picture industry, with films currently in production having been written long before the writers went on strike. But the television industry has been devastated, with only a handful of shows (including "The Cosby Show" and "ALF" on NBC and the "writer-proof" news magazines on CBS) gearing up for the fall season because of interim strike agreements with the Writers' Guild.

Most TV producers agree it will take comedy shows about five or six weeks to organize their writing staffs and get scripts ready to begin production, and another five or six weeks to get them ready to air. Hour-long Hourlong programs, they say, will take two or three weeks longer.

"There will be no fall television season per se," said CBS programmer Kim LeMasters Wednesday. "And there will be no premiere week. Everyone will just get their shows on the air when they can."

LeMasters added that he expects to start running his new shows in late October. NBC is expected to use its coverage of the Summer Olympics and Major League Baseball's World Series as a launching pad for its new series season, while ABC will likely build its fall premiere schedule around the network's coverage of the baseball playoffs and the 32-hour miniseries "War & Remembrance."

"It's over," said guild spokesperson Cheryl Roden. "Right now that's the only thing that matters."