stop creating a new record while clicking on enter on any field in a journal?

Hi,
when I am filling all the mandatory fields in a particular journal and clicking on enter by keeping cursor on any field, a new journal is getting created and the old journal is getting saved. how to overcome this scenario???
Thanks in advance

there was some customized code it seems in task function

if (p1 == #taskEnter )
{
ledgerJournalTrans_ds.write();
ledgerJournalTrans_ds.create();
ledgerJournalTrans_AccountNum2.setFocus();
}
which was the reason it was generating new line