There are two basic ways you can add data to a database table within your SAP system. The first method is manually via transactions
such as SM30, SE16, SE80 etc. The second method is to use ABAP code within a program to add data to an SAP table.
Creating table data via user transaction SM30 or SE16
When using transaction SM30 or SE16 to create data it depends on the table settings as to whether you can actually perform this functionality. This is because some tables are not intended to be updated by users manually and are only updated via ABAP code using specific SAP functionality transactions. I.e. table EKKO is updated via SAP purchasing transactions.
Adding database data via transaction SE16
The easiest way to test if you can update the table manually is to enter it into the t-code SE16 and press the create button or SM30 and press the maintain button. I will use tables EKKO and J_3RF_PRECMET as examples, J_3RF_PRECMET allows data to be entered and EKKO is restricted.
First execute transaction SE16, enter your table name and press the create button
If table is not maintainable you will receive the message "Table maintenance not allowed for table <table>"
If the table is maintainable like J_3RF_PRECMET then the create entries screen will be displayed.
On the create entries screen click on the New Entries button
You will now be able to add your new entries into the editable fields and press save. At this point you might be asked for a transport depending table setting and how the data is maintain.
Adding data via transaction SM30
Using transaction SM30 is very similar but has slightly different technical requirements. For example the table needs to have a table maintenance dialog available for it, this is created via t-code SE11 during the table creation process.
To test via SM30 firstly execute the transaction, enter the table name and press maintain
If not maintainable you will get a message along the lines of "Maintenance dialog for <table> is incomplete or not defined".
If it is maintainable and a table maintenance exists you will be taken to the same New entries screen as via SE16.
Add data to SAP table via ABAP code