Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: Error product is locked by user

$
0
0

Check the below code....

 

  1. *Get the Entity of BuilHeader Object 
  2. CALL METHOD lr_builheader->get_related_entity 
  3.    EXPORTING 
  4.      iv_relation_name = 'BuilAddress' 
  5.    RECEIVING 
  6.      rv_result        = lr_builheader. 
  7. CATCH cx_crm_genil_model_error . 
  8. ENDTRY. 
  9. lr_lr_builheader->switch_to_change_mode( ). 
  10. *Locks are always set on root object. 
  11. IF lr_builheader->lock( ) = 'X'
  12. IF lr_builheader->is_changeable( ) = 'X'
  13. *Set property also locks the object entity if lock has not been set. 
  14.    lr_builheader->if_bol_bo_property_access~set_property( iv_attr_name = 'CITY' 
  15.                                                                iv_value     = 'Melbourne' ). 
  16. *Modify BOL layer 
  17.    lr_core->modify( ). 
  18. ENDIF. 
  19. ENDIF. 

  20. *Save and Commit Changes Using Global Transaction Context 
  21.      DATA: lr_transaction TYPE REF TO if_bol_transaction_context . 
  22.      lr_transaction = lr_core->get_transaction( ). 
  23.      lr_transaction->save( ). 
  24.      lr_transaction->commit( ). 


Regards,

Sumeet


Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>