West Germany has tentatively agreed to allow production of an advanced new gun for the next generation of U.S. battle tanks to be built in the United States under license, it has been learned from high-level West German officials.

The arrangement reportedly was hammered out in three days of negotiations this weekend at the Bonn Defense Ministry by U.S. Army Undersecretary Walter Laberge, who left for Washington yesterday.

The agreement is of considerable potential importance to both countries, to the contractor selected for the job in the United States and to the North Atlantic Treaty Organization, where a major goal fo several years has been to try to standardize weapons.

If the terms worked out here are approved formally by the Army, the Pentagon and Congress, it would mean West German-designed guns and special new ammunition would become front-line equipment on about 3,300 new XM-1 main battle tanks that the U.S. Army plans to order.

A final deal, West German officials say, also undoubtedly would help the atmosphere in the Bonn parliament toward agreeing to share the more than billion-dollar cost in the oft-delayed NATO purchase of 18 U.S. Airborne Early Warning and Control Planes, knowns as AWACs.

Although the two military projects have never been officially linked. The West Germans have made it clear that the United States must at some point make good its pledge that arms purchases must be more of a "two-way street" with the United States buying some European equipment rather than the Europeans always buying American arms.

The West Germans were disappointed last year when their highly touted new Leopard Roman No. 2 tank was not selected by the U.S. Army. Since then, there has been an effort to introduce standardization in some fashion into the new tanks that both the U.S. and West German forces - involving almost 6,000 new tanks combined - would use.

The West German gun - a smooth-bore 120mm weapon - reportedly has been tentatively selected as the winner by the U.S. Army in recent competition with 120mm British-designed weapon with the U.S. Army's 105mm gun.

The West Germans, who have unemployment problems, too, would like to have had the gun build here. But that was opposed by the U.S. Army and apparently was the reason behind the trip. By Undersecretary Laberge, Top German officials said here, however, that they were aware that the only way to have the gun on U.S. tanks would be to have it produced in the United States.

The West Germans also say that along with the gun goes a new type of ammunition that flips out wings after it leaves the barrel to help stabilize it in fight.

The West German gun is still being developed so it probably would not be ready in time to be fitted on perhaps the first 1,000 U.S. tanks, but could be refitted to those later.