cancel
Showing results for 
Search instead for 
Did you mean: 

CRM WebClient UI using context values to build URL for custom button

former_member605921
Discoverer
0 Kudos

Hello Experts,

first things first: im a total beginner in the SAP-world and especially in CRM-world and would appreciate your help on my problem: I want to open a dynamically built URL, when clicking on a custom button that i created.

I have defined a URL and a LTX under SPRO -> Transaction Launcher. Then i have defined a logical link which uses my LTX.

After that i navigated to the view, where i want to place my button (BT266H_PRVC/HeaderDetails) and redefined

DO_PREPARE_OUTPUT:

create_buttons( ).

and EH_ONOPEN_URL:

IF lr_navigation IS BOUND .
* Navigate to transaction launcher using link id
lr_navigation->navigate( iv_link_id = 'XYZ' ).
ENDIF.

Now when clicking on the button i want to dynamically build a URL with the current BUAG_ID, BP_ID and contract account, which i hope are all known to the system at this point. For solving this problem i edited the method BUILD_OTHER_URL in my z-handler-class from my LTX. I tried the following approach (using global data context) which i found in some blogs, but that unfortunately don´t work for me:

lr_gdc = cl_crm_ui_data_context_srv=>get_instance( ).

CALL METHOD lr_gdc->get_data_attribute
EXPORTING
iv_name = 'BP_GUID'
IMPORTING
e_value = lv_partner_guid.

Or:

lr_gdc->get_entity( EXPORTING name = 'CURRENTCUSTOMER'
RECEIVING value = lr_entity )

In debugging i came to the conclusion that this approach won´t work, because the gdc is empty (maybe because im not using ICWebClient?!)

So basically i´m looking for help at the last steps of identifying and using the current business context and hope the aforementioned steps were done correctly.

Thanks in advance!

Accepted Solutions (0)

Answers (0)