Showing posts with label CRM-ABAP. Show all posts
Showing posts with label CRM-ABAP. Show all posts

Thursday, February 1, 2018

How to find Genil Class for UI component


To find genil class from ui component.
1. check the model component set assigned to bsp component in the run time repository. for eg ONEORDER/ALL
2. this component set will have genil components assigned to it.. genil components BT/BP etc.
3. you can find these component detail in spro customizing.
Spro->CRM->cross appl. comp.->genil->basic settings->component :
Under respective genil component you can find implementation class assigned.
for eg. BT -> cl_crm_btil
BP -> cl_crm_buil

Notes: You can put a break point in this class-method and try running the bol query in Genil_Bol_Browser – which will trigger this breakpoint

Thursday, November 9, 2017

CRM ABAP load Core with component set


Code to set Core to a particular component.  This works if u r writing a stand-alone program or function.  If this is not written, then you may not get relations loaded and get issues.  You need to put right component set name (in place of 'IUICALL') in below code

DATA:  lr_core            TYPE REF TO cl_crm_bol_core.


  lr_core cl_crm_bol_core=>get_instance).

  CHECK lr_core IS BOUND.

  TRY.
      lr_core->load_component_setiv_component_set_name 'IUICALL' ).
    CATCH cx_crm_genil_general_error .
  ENDTRY.

Thursday, February 2, 2017

Multilevel Categorization (MLC)


Below link is good:
https://wiki.scn.sap.com/wiki/display/SAPITSM/Multilevel+Categorization


https://help.sap.com/saphelp_crm60/helpdata/en/44/03d07381f14c60e10000000a155369/content.htm?frameset=/en/44/03c69b2fcb4c61e10000000a155369/frameset.htm&current_toc=/en/43/0d10ebcc4f21abe10000000a1553f6/plain.htm&node_id=8



MLC is NOT transportable - It does not ask for transport

Importing to different systems:
This can be done using following ways
1. CATEGOTOOL - tcode to import and export via txt file  -  This does NOT import Subject codes (Infact erases existing subject codes in category Ids) - So, pls be careful using this
2. CRM_ERMS_CAT_AS_IMPORT in transaction SE38. - This needs RFC destination setup to connect between systems
3. Manually configure in all systems

Tuesday, August 23, 2016

Adding new fields to FBL3N transaction

Adding new fields to FBL3N (or FBL5N  FBL1N etc..)

Extending RFPOSXEXT   -  using report RFPOSXEXTEND

Please see below link – its very useful

Tuesday, June 21, 2016

CRM Config layout based on object type and sub object type

To set Object type and Sub object type through code to differentiate between different order types - if diff order types need different CRM lay out in Web UI.

In BSP_WD_CMPWB tcode, in method DO_CONFIG_DETERMINATION

METHOD do_config_determination.
*CALL METHOD SUPER->DO_CONFIG_DETERMINATION
**  EXPORTING
**    iv_first_time = ABAP_FALSE
*    .

  DATA: lv_subtype     TYPE bsp_dlc_object_sub_type VALUE '<DEFAULT>',
        lv_object_type TYPE bsp_dlc_object_type     VALUE '<DEFAULT>'.

  lv_object_type = '<ObjectType 1>'.

  IF <Tran Type> EQ ‘ERP Sales Order’.
    lv_subtype = 'OR'.
  ELSE.
    lv_subtype = 'RE'.
  ENDIF.

*  ENDIF.
  me->set_config_keys( iv_object_type          = lv_object_type
                       iv_object_sub_type      = lv_subtype
                       iv_propagate_2_children = abap_false ).
ENDMETHOD.

We can extend the sub object type as below:
ZL_ERPORD_SUBOBJ_TYPE_CALLBACK->IF_BSP_DLC_OBJ_TYPE_CALLBACK~GET_OBJECT_SUB_TYPES 

Good Link:
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2015/12/04
SPRO path:

To define new Object types:


Call back class with interface IF_BSP_DLC_OBJ_TYPE_CALLBACK


Implement the method to define Sub-Obj types


Thursday, November 19, 2015

CRM WebUI - Change text in Custom filter

Problem: Change Text description for an element in drop down (in this example:  From ‘Does not equal’ to ‘not equal’ – as user displaying them in alphabetical order, and want ‘equal’ to come first in dropdown)
Transaction SE80 -> BSP Application crm_thtmlb_util:
Method get_possible_operators:
Transaction SOTR_EDIT:

Friday, September 4, 2015

CRM - Raise global message in Quote/Order

 Raise error in DO_VALIDATE_INPUT method as shown:
THIS WILL NOT BLOCK SAVING
To block saving use ORDER_SAVE BADI - method CHECK_BEFORE_SAVE

If there are error messages:
RAISE do_not_save.

Thursday, August 27, 2015

DO_PREPARE_OUTPUT - CRM Web UI example


Component/View:   BT125H_TASK/TaskDetails
Logic:

typed_context will contain all context nodes in view.


    DATAlr_btstatus        TYPE REF TO cl_crm_bol_entity,
          lr_btadminh        TYPE REF TO cl_crm_bol_entity.
    DATAlv_process_type    TYPE CRMT_PROCESS_TYPE_DB.



    TRY.
    lr_btadminh ?= me->typed_context->btadminh->collection_wrapper->get_current).
    lr_btadminh->get_property_as_value(
                                    EXPORTING iv_attr_name 'PROCESS_TYPE'
                                    IMPORTING ev_result    lv_process_type ).

    lr_btstatus ?= me->typed_context->btstatus->collection_wrapper->get_current).

*   For Attachment tasks (ZATC), set status to 'Completed'
    IF lv_process_type 'ZATC'.
      lr_btstatus->set_property(
        EXPORTING
          iv_attr_name =   'ACT_STATUS'
          iv_value     =    'E0003'
      ).

    ENDIF.
      CATCH cx_root.
   ENDTRY.

CRM WebUI Get related entities and Parent entities



If you need to get entities related (child entities), use GET_RELATED_ENTITY, GET_RELATED_ENTITIES methods

Using GET_RELATED_ENTITY:

    lr_erpadminh ?=   me->typed_context->erpadminh->collection_wrapper->get_current).
    CHECK  lr_erpadminh IS BOUND.
    lr_erpadminh->get_property_as_value(  EXPORTING   iv_attr_name =   'VBELN'
                                          IMPORTING   ev_result    =   lv_vbeln .

*    CHECK  lv_vbeln IS NOT INITIAL.
    TRY.
        CALL METHOD lr_erpadminh->get_related_entity
          EXPORTING
            iv_relation_name 'ERPHeaderCondSet'
*           iv_mode          = normal
          RECEIVING
            rv_result        lr_erpcondh.
      CATCH cx_crm_genil_model_error .
    ENDTRY.
    IF lr_erpcondh IS BOUND.
      TRY.
          CALL METHOD lr_erpcondh->get_related_entities
            EXPORTING
              iv_relation_name 'ERPCondHAll'
*             iv_child_name    =
*             iv_mode          = NORMAL
*             iv_owned_only    = ABAP_FALSE
            RECEIVING
              rv_result        lr_condcol.
        CATCH cx_crm_genil_model_error .
      ENDTRY.


      CLEAR  lr_iterator ls_condtype.
      lr_iterator   lr_condcol->get_iterator).

Full code link: http://sapist.blogspot.co.uk/2015/08/crm-web-ui-getrelatedentity.html


If you need parent entities, then use GET_PARENT method

Using GET_PARENT method:

    if iterator is bound.
      current iterator->get_current).
    else.
      current collection_wrapper->get_current).
    endif.

    lr_current ?= current.

    TRY.
      lr_bt_statush ?= lr_current->get_parent).

      CATCH cx_crm_genil_model_error .
    ENDTRY.

    TRY.
      lr_bt_adminh ?= lr_bt_statush->get_parent).

      CATCH cx_crm_genil_model_error .
    ENDTRY.

    TRY.

    lr_bt_adminh->get_property_as_value(  EXPORTING IV_ATTR_NAME 'PROCESS_TYPE'
                                            IMPORTING EV_RESULT lv_process  ).

      CATCH cx_root.
    ENDTRY.

Full code link: http://sapist.blogspot.co.uk/2015/08/crm-web-ui-getparent-method.html

Friday, February 6, 2015

CRM Message container


CL_CRM_ITEMS_RUN_ERPIL -> COPYITEMS
  DATA:
    lr_mess_cont     TYPE REF TO cl_crm_genil_global_mess_cont,
    lv_msg_number    TYPE symsgno,


    lr_mess_cont ir_root_list->get_global_message_container).
    IF lr_mess_cont IS BOUND.
      CASE lv_subrc.
        WHEN '1'.
          lv_msg_number '010'.
        WHEN OTHERS.
          lv_msg_number '018'.
      ENDCASE.
      lr_mess_cont->add_message(
        iv_msg_type       cl_crm_genil_global_mess_cont=>if_genil_message_container~mt_error
        iv_msg_id         'CRM_ERP_IL'                    "#EC NOTEXT
        iv_msg_number     lv_msg_number
        iv_show_only_once abap_true ).

Tuesday, December 9, 2014

CRM layout based on object type and sub object type


To set Object type and Sub object type through code to differentiate between different order types - if diff order types need different CRM lay out in Web UI.

In BSP_WD_CMPWB tcode, in method DO_CONFIG_DETERMINATION

METHOD do_config_determination.
*CALL METHOD SUPER->DO_CONFIG_DETERMINATION
**  EXPORTING
**    iv_first_time = ABAP_FALSE
*    .

  
DATA: lv_subtype     TYPE bsp_dlc_object_sub_type VALUE '<DEFAULT>',
        lv_object_type 
TYPE bsp_dlc_object_type     VALUE '<DEFAULT>'.

  lv_object_type 
'<ObjectType 1>'.

  
IF <Tran Type> EQ ‘ERP Sales Order’.
    lv_subtype 
'OR'.
  
ELSE.
    lv_subtype 
'RE'.
  
ENDIF.

*  ENDIF.
  me
->set_config_keysiv_object_type          lv_object_type
                       iv_object_sub_type      
lv_subtype
                       iv_propagate_2_children 
abap_false ).
ENDMETHOD.





We can extend the sub object type as below:
ZL_ERPORD_SUBOBJ_TYPE_CALLBACK->IF_BSP_DLC_OBJ_TYPE_CALLBACK~GET_OBJECT_SUB_TYPES  


Good Link:
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2015/12/04