Quantcast
Viewing all articles
Browse latest Browse all 3184

Supplier list: Deactivate item

Hi all,

 

This is the scenario:

In an empty row, if I uncheck the field "Supplier is active", write the Supplier ID and push Enter then the standard code somewhere set the field "Supplier is active"  again to 'X'. This is the standard behavior.

 

I have a requirement in which when a new item is added the field "Supplier is active" must be disabled and unchecked. ( We have a custom report to activate or deactivate the items, this report can be executed only by some users depending on the user roles ) 

 

I've changed the visualization of the field by customizing, but I can't uncheck the field.

 

I've debugged the standard code but I couldn't find the place where the field is being changed.

 

The badi BBP_DOC_CHANGE_BADI is not used for object BUS2206.

 

I'm trying to modify the field adding an enhancement spot at the beginning of the method /SAPSRM/IF_CLL_MAPPER~UPDATE of class /SAPSRM/CL_CH_WD_DOTM_ASL_SOS. But all the attempts I've tried don't work.

 

Do you know how to do it? Or a workaround to do that?

Thanks in advance.

 

P.S. This is part of the code I've tried in method

 

DATA:         ls_zz_item   TYPE /sapsrm/s_cll_asl_sos_list,         lt_zz_item   TYPE /sapsrm/if_ch_wd_set_facade=>gt_guid_element,         lt_items     TYPE bbpt_guid,         lo_zz_item   TYPE REF TO /sapsrm/if_ch_wd_set_element..   DATA: lt_messages     TYPE bbpt_pd_messages,         lv_activity TYPE j_vorgang.   FIELD-SYMBOLS <ls_zz_item> TYPE /sapsrm/if_ch_wd_set_facade=>gs_guid_element.

* Select current lines
   SELECT guid    INTO TABLE lt_items    FROM crmd_orderadm_i    WHERE header EQ MV_BO_GUID    ORDER BY guid.   lt_zz_item = mon_cll_set_facade->get_data_elements( ).   LOOP AT lt_zz_item ASSIGNING <ls_zz_item>.     lo_zz_item = <ls_zz_item>-set_element.     lo_zz_item->get_static_attributes( IMPORTING rv_attributes = ls_zz_item ).     CHECK ls_zz_item-SH_PARTNER_ID IS NOT INITIAL.

* Check if is a new line or already exists:
     READ TABLE lt_items      TRANSPORTING NO FIELDS      WITH KEY guid = ls_zz_item-guid      BINARY SEARCH.     IF sy-subrc NE 0.

 *    1st Attempt
 *      ls_zz_item-itm_released = space.
 *      CALL METHOD lo_zz_item->set_static_attributes
 *        EXPORTING
 *          iv_static_attributes = ls_zz_item.
 *      CALL METHOD lo_zz_item->set_changed_by_client
 *        EXPORTING
 *          flag   = ABAP_TRUE.

 *    2nd Attempt  "DUMP !!!
 *        TRY.
 *          mo_pdo->delete_item( EXPORTING item_guid = ls_zz_item-guid
 *                               CHANGING  co_message_handler = mo_pdo_message_consumer ).
 *        CATCH /sapsrm/cx_pdo_abort.
 *
 *        ENDTRY.

 *    3rd Attempt       lv_activity  =  /sapsrm/if_pdo_activities_c=>gc_pdo_item_deactivate.
 *     Update the status of the item as inactive       CALL FUNCTION 'BBP_PROCDOC_STATUS_CHANGE'         EXPORTING           iv_item_guid  = ls_zz_item-guid           i_activity    = lv_activity           i_object_type = /sapsrm/if_pdo_obj_types_c=>gc_pdo_asl           i_save_db     = abap_false           i_test_run    = abap_false         TABLES           e_messages    = lt_messages[].

 *    4th Attempt- 1st part
 *      ls_del_item-guid = ls_zz_item-guid.
 *      APPEND ls_del_item TO lt_del_items.     ENDIF.   ENDLOOP.

 *    4. Attempt 2nd part  "DUMP !!!
 *  IF lt_del_items[] IS NOT INITIAL.
 *    mo_parent_bo_mapper->delete_item( it_item_guid = lt_del_items ).
*  ENDIF.

Viewing all articles
Browse latest Browse all 3184

Trending Articles