Table and internal table update and modifications - kazumov/abap GitHub Wiki

Example

Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.

DATA message_wa TYPE t100. 

message_wa-sprsl = 'EN'. 
message_wa-arbgb = 'MYMSGCLASS'. 
message_wa-msgnr =  '100'. 
message_wa-text =  'Some new message ...'. 

MODIFY t100 FROM @message_wa.

Example

The same example as before, but with a host expression.

MODIFY t100 FROM @( VALUE #( 
  sprsl = 'EN' 
  arbgb = 'MYMSGCLASS' 
  msgnr =  '100' 
  text =  'Some new message ...'  ) ).