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: 

Invalidate buffer for specific table in ABAP

javier_arboleya
Explorer
0 Kudos

Hello,

we have a small table which continuously being read and seldom modified. Based on this assumptions we would like to fully buffer this table, using the standard SAP buffering.

Our problem comes with the synchronization mechanism. In this case the changes must be propagated to all instances immediately and not with the regular interval defined in rdisp/bufreftime. So once the change is done, the buffer for that table must be invalidated.

Since I know from where is this table modified, I would like to know if there is an ABAP FM or mechanism to trigger the invalidation of an specific table buffer. I have found FM SBUF_GENERIC_RESET, but I would appreciate any previous experience with this, or any other module, to perform this task.

Many thanks in advance.

Javier

1 REPLY 1

raymond_giuseppi
Active Contributor
0 Kudos

Do not worry, SAP themselves use this FM so a simple


DATA: lt_server_list TYPE TABLE OF msxxlist.

  DATA: lv_message type c length 100.

  FIELD-SYMBOLS: <server> TYPE msxxlist.

* get list of all application servers
CALL FUNCTION 'TH_SERVER_LIST'
   TABLES
     list           = lt_server_list
   EXCEPTIONS
     no_server_list = 1
     OTHERS         = 2.
* immediately synchronize the buffers
LOOP AT lt_server_list ASSIGNING <server>.
   CALL FUNCTION 'SBUF_GENERIC_RESET'
     DESTINATION <server>-name
     EXPORTING
       tabname               = 'ZZZZZZZZZZZZ' " put your table name here
       sync                  = 'X'
     EXCEPTIONS
       system_failure        = MESSAGE lv_message
       communication_failure = MESSAGE lv_message
       c_func_error          = 3
       OTHERS                = 4.
ENDLOOP.

will do the job.

Regards,

Raymond