A few weeks ago the new Senate majority leaders, Robert C. Byrd (D-W. Va.), and the new assistant leader, Alan Cranston (D-Calif.), sat uneasily reviewing a list of potential votes on a key amendment to the Senate Ethics Code.

The amendment, which they opposed, would have stripped from the code a tough new limit on outside earnings from speeches and articles. Their vote list showed 30 undecided Democratic senators and a possibility that the amendment might pass. The two leaders decided they had to talk to the undecideds.

Byrd with strong ties to the center and conservative wings of the party, focused on that segment, although he talked to some liberals too. He presented the case against the amendment to John Sparkman (D-Ala.), Russell B. Long (D-La.), J. Bennett Johnston (D-La.), James O. Eastland (D-Miss.), John C. Stennis (D-Miss.), Richard Stone (D-Fla.) and 18 or 20 others.

Cranston, whose ties are more to the liberal wing, concentrated on such senators as Hubert H. Humphrey (D-Minn.), John Durkin (D-N.H.), Gary W. Hart (D-Colo.) and Frank Church (D-Idaho).

In the end, most of the senators approached by the leadership team voted against the amendment, and it was beaten handily.

Few senators have backgrounds as sharply in contrast as Byrd and Cranston. Yet they have evolved an excellent working relationship so far in this Congress.

When the two men are really working in harness, they have strong reach throughout the party and can mass a lot of force and a lot of votes together. They demonstrated this when, with Byrd taking the lead and Cranston working assiduously alongside, they rounded up the votes to kill an anti-amnesty resolution which would have embarrassed President Carter; to kill a move to block the congressional pay raise; and to help punch across the reorganization of Senate committees and adoption of the new code of Senate ethics.

At the same time, the fact that Byrd is a middle-roader, while Cranston is to the left, gives the Democrats considerable flexibility. If either man is unhappy with something -- perhaps some important presidential request -- he can fade into the background and let the other man do the work. That is precisely what happened on the nomination of Paul Warnke as arms control negotiator. Cranston, a strong advocate of Warnke's appointment, went all-out to help get him confirmed, after notifying Byrd he wanted to back Warnke all the way. Byrd didn't reveal how he would vote until near the end.

Byrd, 59, was a poor boy from the West Virginia coal towns who worked as a butcher, a welder in the Baltimore shipyards and once belonged to the Ku Klux Klan. He never got a college degree until he completed a special law program in 1963 after he was already in Congress. Ideologically in the center of his party, often accused of racism in the past, he spends most of his spare time with his family or playing his country fiddle. He's been to the movies once in the past 25 years.

He has something of the poor boy's sensitivity to slights which on occasion can turn into outright insecurity and deep suspicion. If someone twits him or makes a joke at his expense he doesn't laugh until he's sure it's meant kindly.

He rose to majority leader this year from the assistant leader post by being a superb legislative technician. He mastered the rules. He was willing to work tirelessly on boring routine floor details. He did favors for senators ranging from giving them little gifts like tickets to ballgames, playing his fiddle at their campaign rallies, giving them campaign funds, scheduling their legislation or blocking votes on matters of special concern to them if they were absent.

Cranston, 62, emerged from a different world. Born in Palo Alto, he comes from a state with 10 times the population, far more urbanized, than Byrd's. He was the son of a rich real estate and land operator. While Byrd was laboring dirt-poor in the tiny coal towns, Cranston was lolling about at Stanford, running the mile relay and 440. He later became a playwright, journalist, and overseas correspondent for International News Service.

He produced an abridged version of "Mein Kampf" with anti-Nazi notes in 1939, and was sued by Adolf Hitler (through German officials here) for copyright infringement. Hitler won.

Politically he is decidedly on the left wing of his party, a strong civil rights and arms control advocate. Separated from his wife, he relaxes by running around the streets and the mall in a track suit to keep in shape. He competes in senior track meets from time to time. He has no visible ego or touchiness, is extremely easy-going, and if people throw slights at him, "I don't notice them." At 6 feet 1 inch, with an angular build, he towers several inches over the more rotund Byrd.

With all these differences, Byrd and Cranston have built a relationship of mutual respect, and work easily together. Byrd as leader has little favors to give out -- appointments to special boards, promises of action on legislation (he controls the scheduling of what comes up), the naming of people to one position of another. This gives him extra leverage in rounding up votes. He is personally strong with the center and Southern wing of his party and with some senior power barons from the North, too.

For example, he has earned the respect and gratitude of Adlai E. Stevenson (D-Ill.) by helping shepherd through Stevenson's committee reorganization plan, and of Abraham A. Ribicoff (D-Conn.) by helping Ribicoff last Congress to push through creation of special committee to oversee government intelligence operations.

Cranston has excellent access to Democratic liberals and some Republicans as well. He is a tireless vote-counter.

"He has the best vote-count of any senator," Byrd says. Cranston is trusted by and has access to some of the liberals who have been wary of Byrd in the past -- men like Edward M. Kennedy (D-Mass.), John C. Culver (D-Iowa), Dick Clark (D-Iowa) and Edmund S. Muskie (D-Maine).

The two men consult frequently each day. The way they operate on a vote, Byrd explained, is that he will have an aide take a poll of Democratic senators to see how they stand on a particular important issue. Cranston will make his own count. Then they will compare notes and see who needs to be talked to, coaxed, persuaded.

There is no question that Byrd is the dominant figure in the leadership team. Byrd as leader is the chairman of the Policy Committee. He is the chairman of the Steering Committee, which makes appointments to committees. Byrd has retained control over floor scheduling, and he spends a great deal of time on the floor directly managing the business. Cranston does not.

Byrd has put his own aides into all the key jobs -- Tom Hart as head of the Democratic Policy Committee staff, Jim Duffy as secretary for the majority, Joe Stewart as assistant for floor business. He has beefed up the Policy Committee staff from three to seven professional staff members to advise him on the contents of legislation and research out the issues. They include a defense expert, an economics expert, an energy specialist, an antitrust specialist and a criminal laws specialist. Cranston, by contrast, has no man of his own on the Policy Committee, and no aide for floor matters.

Even liberals who have been critical of him give Byrd high marks so far this year. But many raise the question of what will happen when some difficult issues arise later on, where middle-roader Byrd and liberal Cranston may really differ sharply -- issues like an arms control agreement, national health insurance, tax reform, welfare reform.

"He keeps Alan on a short leash now -- he's retained all the power and day-to-day control -- and I can't believe he's going to let Alan do too much," said one senator.

But Cranston said he doesn't mind in the least that Byrd handles moment-to-moment floor detail himself, because he isn't all that anxious to do it.

Right now, things between Byrd and Cranston are rosy. But despite the disclaimers from both men, future clashes over legislation seem possible. Senate-watchers are waiting to see how the relationship develops.