A federal judge here ruled yesterday that two public interest law groups do not have a right to immediate access to general charitable contributions by federal employes and military personnel to the Combined Federal Campaign.

The NAACP Legal Defense Fund and the Puerto Rican Legal Defense Fund won a court ruling in 1981 allowing federal employes to designate charitable contributions to such organizations directly.

But the groups challenged the manner in which general, undesignated funds were distributed by local campaign officials.

Under a formula used by the Office of Personnel Management, service groups such as the legal services organizations are not necessarily eligible to receive a percentage of any undesignated contributions until they have had five years' experience receiving designated contributions.

Under the OPM guidelines, the five-year track record in receiving designated contributions helps local program officials determine what percentage of contributions to the general fund an organization should get.

The two groups challenged the formula and OPM's guidelines, saying they were dicriminatory, vague and arbitrary, and gave campaign officials in local areas too much discretion in allocating undesignated contributions.

In her ruling yesterday, U.S. District Court Judge Joyce Hens Green said the standards used by OPM were not arbitrary and that "adequate standards exist to govern the distribution of undesignated funds." Green said the "only sensible distribution of funds may well be no distribution if there is insufficient information upon which to base a determination."