Every accounting document number created in an SAP system has two main parts namely; document header and document line items. Information in the header part are posting date, document date, document type, currency, exchange rate, reference document number and document header text. Under the line item part information are the posting key, account, amount, longtext, assignment and others.
Information on the header part are applicable to the whole document. Whereas, information on each line items are applicable only for that specific line item.
Status of fields under line item part can either be required, optional, suppressed or displayed. The status of the fields is dependent on the configuration of the field status group where the G/L account belongs and the posting key of the line items.
Document header text and reference document number can be set as either optional or required. Note that you can set the status of the said fields for each document type. Say for instance, the document header text is optional for document type DR, but for document KR it’s required.
Here’s a tip on how to set the field status of document header text and reference document number:
Transaction Code: OBA7
Path: IMG → Financial Accounting (New) → Financial Accounting Global Settings (New) → Document → Define Document Types for Entry View.
The “Change View – Document Types: Overview” screen appears:

For instance you want to set field status of document header text and reference document number as required for document type DR. Double-click line of document type DR. The “Change View Document Types: Details” screen appears:

Take a look at the highlighted information, “required during document entry” section. Shown are the checkboxes of Reference number and Document header text. If you want that “Reference number” is requried field during document entry, activate it’s checkbox. Same which true with the “Documeny header text” textbox. Otherwise, if you want that the said fields are optional then do not select the checkbox.
You may also consider reading these: