Wednesday, October 25, 2006

How to link two different object (e.g. CRM TRANSACTIONS in document flow)


include CRM_BIN_RELATION_CON.

data: it_item_links TYPE crmt_brelvonai_tab.

DATA:
ls_new_binrel TYPE gbinrel,
ls_obj_predecessor TYPE borident,
ls_obj_successor TYPE borident,
lt_links TYPE STANDARD TABLE OF relgraphlk WITH HEADER LINE.

* fill role A (BUS2000116)
ls_obj_predecessor-objkey = '453C94F14F0800A902000000A0DC2704'.
ls_obj_predecessor-objtype = 'BUS2000116'.
ls_obj_predecessor-logsys = ''.

* fill role B (BUS2000126)
ls_obj_successor-objkey = '453C961B4F0800A902000000A0DC2704'.
ls_obj_successor-objtype = 'BUS2000126'.
ls_obj_successor-logsys = ''.


* Read header-relations
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
 EXPORTING
  object = ls_obj_predecessor
  relationtype = gc_bin_rel_type-predecessor_successor
 TABLES
  links = lt_links
 EXCEPTIONS
  OTHERS = 0.

CALL FUNCTION 'BINARY_RELATION_CREATE'
 EXPORTING
  obj_rolea = ls_obj_predecessor
  obj_roleb = ls_obj_successor
  relationtype = gc_bin_rel_type-predecessor_successor
  fire_events = space
 IMPORTING
  binrel = ls_new_binrel
 EXCEPTIONS
  no_model = 1
  internal_error = 2
  unknown = 3
  OTHERS = 4.

commit work and wait.

Friday, October 20, 2006

SICF

"You are not authorized to view the page."
Have you just transported the BSP on another system without activating it in transaction SICF?

Monday, October 09, 2006

Where the hell activity reason is stored?

Of course you have the guid of the activity (crmd_activity_h) right?
Great, now through CRMD_LINK and CRMD_SRV_OSSET reach table CRMD_SRV_SUBJECT, yes here it is.
And if you want to read the text, just read table QPCT too.

Wednesday, October 04, 2006

genil_model_browser

Let's suppose you are customizing CRM_IC bsp application (better known as ICWC); sometimes you have an entity (CL_CRM_BOL_ENTITY) you obtained from CuCoBDC (maybe you did
me->get_custom_controller( controller_id = 'CuCoBDC' )) like "BTOrder"; in debug you can check the entity kind navigating inside CONTAINER_PROXY (check DATA_REF).
You have an entity, but you need attributes of another entity, which is related to yours in GENIL (transaction genil_model_browser).

Using the following code:

TRY.
new_entity = entity_followup->get_related_entity(
iv_relation_name = 'BTOrderHeader'
).
CATCH cx_crm_genil_model_error.
RETURN.
ENDTRY.


You obtain a new exciting entity, the attribute list of this entity could be more interesting (as such as this example you could not locate GUID in BTOrder but you easily find it in BTOrderHeader), a complete list is shown in GENIL.