cancel
Showing results for 
Search instead for 
Did you mean: 

creating a link to another component in create oppurtunity view

Former Member
0 Kudos

Hi,

I want to create a link in create opportunity to traverse to create competitor view.How to go about?I have some idea of target ids but nothing more than that.

Looking forward to any help:)

Regards

Shilpi

Accepted Solutions (1)

Accepted Solutions (1)

suchita_phulkar
Active Contributor
0 Kudos

Hi Shilpi,

Its not dificult at all. Using Dynamic Navigation Descriptor, you can open any view from any component in create/display mode and you dont have to do component usage, outboud plugs and navigation links etc.

However, there is some more coding reuired.

If you can tell me the source component/view and target component/view and the BOL model ( like ONEORDER , BP_ALL etc ) then i can give you the code .

Thanks & Regards,

Suchita

Former Member
0 Kudos

Hi Suchita,

I want to bring the BTSubject Context Node under BT120H_CPL/Details of Transaction Complaint in order to use the Defect count / Defect Class fields.

Could you please let me know the steps to do so ?

I tried to enhance with my limited knowledge but am getting errors. Could you please help me in resolving this with proper steps?

Regards...

Arup

suchita_phulkar
Active Contributor
0 Kudos

Hi Arup,

Your problem is completely different than what shilpi has raised the thread for.

Kindly raise another thread henceforth if its completely irrelevent from the present thread.

Well, for your case, Go to your view, Open context, and right click on any context node. select CREATE in the context menu( that appears when you right click) and create your context node BTSubject using the wizard.

Regards,

Suchita

Former Member
0 Kudos

Hi Suchita,

Thanks for ur reply.

My source view is BT111H_OPPT/OpportunityDetails and target is BP_HEAD/AccountDetails.

Regards

Shilpi

suchita_phulkar
Active Contributor
0 Kudos

Hi Shilpi,

There are two ways to get around what you want.

1. Conventional navigation using Navigational links.

2. Dynamic Navigation Descriptor.

Lets consider dynamic navigation descriptor first. If this does not work, then we can always achieve the result using normal navigation programming.

In the following code, i am navigating from BP_BPBT/AccountPriceRequestsOV( this is created view and not std.) to BT121H_SLSC/ContractOP this is std. view.

I belive that you have got the hyperlinked attribute already on yout view. if not then go to context node class in which you want this attribute and implement the GET_P as follows :

case iv_property.

when if_bsp_wd_model_sett_getter=>fp_fieldtype

rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.

when if_bsp_wd_model_sett_getter=>fp_onclick.

rv_value = 'create_compititor' .

endcase.

Now, create event handler EH_ONCREATE_COMPITITOR.

and write following code.

DATA: lv_index TYPE i.

DATA:

lr_col TYPE REF TO cl_crm_bol_bo_col,

lr_entity TYPE REF TO cl_crm_bol_entity,

lr_entity_bt TYPE REF TO cl_crm_bol_entity,

lr_core TYPE REF TO cl_crm_bol_core,

ls_attributes TYPE crmt_bsp_activity2_bp ,

lv_object_guid TYPE crmt_genil_object_guid,

lv_object_type TYPE BSP_DLC_OBJECT_TYPE,

lr_nav_descr TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,

lr_nav_serv TYPE REF TO if_crm_ui_navigation_service.

CONSTANTS:

lc_ui_action TYPE crmt_ui_actions VALUE 'B'. "display YOU MUST USE the value for CREATE if you want to open in create mode. for this double click crmt_ui_actions and check whats the value for create.and use it in place of B..i think its A fro create and C for change mode.

WRITE SOME CODE TO RETRIEVE THE GUID OF THE OPPORTUNITY YOU ARE INTO

  • Step 1 Get the GUID of entity.

lv_object_guid = ls_attributes-object_key.

*Step 2 Get instance of the core and the root object. For dynamic navigation, root object wil always be BTORDER

lr_core = cl_crm_bol_core=>get_instance( ).

lr_entity_bt = lr_core->get_root_entity(

iv_object_name = 'BTOrder'

iv_object_guid = lv_object_guid ).

CHECK lr_entity_bt IS BOUND.

*Step 3 Create an collection object for navigation

CREATE OBJECT lr_col.

*Step 4 Add the entity to the navigation collection

lr_col->if_bol_bo_col~add(

iv_entity = lr_entity_bt

iv_set_focus = abap_true ).

*Step 5 Get object type

lv_object_type = cl_crm_uiu_ibase_tool=>get_bt_ui_object_type( lr_entity_bt ).

*Step 6 Create the navigation descriptor

cl_crm_ui_descriptor_obj_srv=>create_ui_object_based(

EXPORTING iv_ui_object_type = lv_object_type

iv_ui_object_action = lc_ui_action

RECEIVING rr_result = lr_nav_descr ).

CHECK lr_nav_descr IS NOT INITIAL.

*Step 7 Insert the navigation descriptor in navigation collection at position 1

lr_col->if_bol_bo_col~insert( iv_bo = lr_nav_descr

iv_index = 1 ).

*Step 8 Register the current page in history for navigating back to it.

RAISE EVENT history_trigger .

*Step 9 Get an instance of the navigation service and navigate to the component dynamically

lr_nav_serv = cl_crm_ui_navigation_service=>get_instance( ).

lr_nav_serv->navigate_dynamically( iv_data_collection = lr_col ).

Save your event handler, activate and test.

Basically, the target view window must have default EDIT/CREATE INBOUND PLUGS. if you get error as no such pluf defined the just go to target component view window and add them. they are readily available.

Thanks & Regard,

Suchita

Former Member
0 Kudos

Hi Suchita,

I look at this forum and try your code, it is perfectly work !!

Thanks a lot it is really helpful

Answers (0)