Quantcast
Channel: SCN : Popular Discussions - SAP CRM: Marketing
Viewing all articles
Browse latest Browse all 2001

Unable to update marketing plan using BOL

$
0
0

Hi all,

I have written BOL code to update Marketing plan.

 

  lv_bol_core = cl_crm_bol_core=>get_instance( ).
  lv_bol_core->start_up( 'CRMD_MKTPL' ).

  lr_qcpg = cl_crm_bol_query_service=>get_instance( 'MarketingPlanSearch' ).

  IF lr_qcpg IS BOUND .
    lr_qcpg->set_property( iv_attr_name = 'EXTERNAL_ID'
                            iv_value    = gv_extid_str ).
  ENDIF.

  lr_qcpg_res = lr_qcpg->get_query_result( ).

  IF lr_qcpg_res IS BOUND.
    lr_mpl_entity ?= lr_qcpg_res->get_first( ).
  ENDIF.

  CALL METHOD lr_mpl_entity->reread.

 

i have called reread( ) bcz the entity's attribute ref was initial after get->first( ).

I get data after i do reread( ).

 

  IF lr_mpl_entity IS BOUND.
    CALL METHOD lr_mpl_entity->switch_to_change_mode
        RECEIVING
          rv_success = lv_success.

   IF lr_mpl_entity->lock( ) = abap_true.
      gv_prop_read_only = lr_mpl_entity->is_property_readonly( iv_attr_name = 'PRIORITY' ).

      lr_mpl_entity->set_propertyiv_attr_name = 'PRIORITY'
                                    iv_value     = 'XXX' ).

     endif.

endif.

  lr_mpl_entity->activate_sending( ).

  lv_bol_core->modify( ) .

  lr_mpl_entity->reread( ).

  lr_transaction = lv_bol_core->get_transaction( ).

  CHECK lr_transaction IS BOUND.

  IF lr_transaction->check_save_needed( ) = abap_true AND
      lr_transaction->check_save_possible( ) = abap_true.

*  IF lr_transaction->check_save_possible( ) = abap_false.
*    EXIT.
*  ENDIF.

    lr_transaction->save( ).
    lr_transaction->commit( ).

 

When i checked in set_properties method, all the field properties are set to READ-ONLY mode. But i am not able to find the reason why the field is read-only even after switch_to_mode( ) returns true.

 

Please help me in this regard.

 

Regards,

Pallavi


Viewing all articles
Browse latest Browse all 2001

Trending Articles



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