2016 Aug 03 9:21 AM
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
2016 Aug 03 4:10 PM
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.
2016 Aug 03 4:18 PM
From which screen? MM01 or what? There should be some user exits in transaction CMOD? Did you search the forum?