Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Inserting records in the table

Former Member
0 Likes
376

Hi Guys,

I have a query regarding inserting data records to the table. I have created the data base table and simultaneously more than one user can never enter the records to the table via table entries in SE16. I have already found a solution for this via module pool. Please let me know whether any better option available for inserting the records to the data base table simultaneously by multiple user.

regards,

Shankar

Hi Guys,

I have a query regarding inserting data records to the table. I have created the data base table and simultaneously more than one user can never enter the records to the table via table entries in SE16. I have already found a solution for this via module pool. Please let me know whether any better option available for inserting the records to the data base table simultaneously by multiple user.

regards,

Shankar

1 REPLY 1
Read only

Former Member
0 Likes
352

hi Shankaran,

That is not always a better option to insert records simultaneous by multiple users. It would be betetr to lock the table programmatically when each one of you are trying to insert records by using ENQUEUE_E_TABLE and unlock by using DEQUEUE_E_TABLE FM


  CALL FUNCTION 'ENQUEUE_E_TABLE'
     EXPORTING
       MODE_RSTABLE         = C_E
       TABNAME              = C_INTERM
     EXCEPTIONS
       FOREIGN_LOCK         = 1
       SYSTEM_FAILURE       = 2
       OTHERS               = 3
            .
  CASE SY-SUBRC.
    WHEN 1.
      MESSAGE E000 WITH 'Table'(021) C_INTERM
                        'is locked by other user'(022).
    WHEN 2.
      MESSAGE E000 WITH 'Table'(021) C_INTERM
        'can not be updated due to sytem failure'(023).
    WHEN 3.
      MESSAGE E000 WITH 'Table'(021) C_INTERM
          'can not be updated due to unknown error'(024).
  ENDCASE.

  CALL FUNCTION 'DEQUEUE_E_TABLE'
     EXPORTING
       MODE_RSTABLE       = C_E
       TABNAME            = C_INTERM.
ENDFORM.                    " UNLOCK_TABLE