Application Development 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: 

Updating custom fields of standard table from user exit

sanjay_deshpande4
Participant
0 Kudos

Dear All,

I am working on screen enhancement in which the data is to be updated to custom fields added to MARA from screen.

Can anybody suggest what should be my appraoch for this?

Shall i use update statement in update function module or should use extended bapi for this requirement.

Regards,

SD

2 REPLIES 2

0 Kudos

MARA table is mostly accessed and crucial table in Material Management.

Direct update of these fields would lead to data conspiracy issues.

Use En-Queue and De-Queue technique for this.

*FM to lock the table

           CALL FUNCTION 'ENQUEUE_E_TABLE'

             EXPORTING

               mode_rstable   = 'E'

               tabname        = 'MARA'

             EXCEPTIONS

               foreign_lock   = 1

               system_failure = 2

               OTHERS         = 3.

           IF sy-subrc IS INITIAL.

             UPDATE MARA FROM lw_mara.

*FM to unlock the table

             CALL FUNCTION 'DEQUEUE_E_TABLE'

               EXPORTING

                 mode_rstable = 'E'

                 tabname      = 'MARA'.

             COMMIT WORK AND WAIT.

           ENDIF.


You can also create for lock objects available for MARA table or create a new one in SE11 and use them for better data updates.

Sandra_Rossi
Active Contributor
0 Kudos

From which screen? MM01 or what? There should be some user exits in transaction CMOD? Did you search the forum?