Skip to Content
Apr 25, 2014 at 12:50 PM

Access Account assignment data inside custom search help


Hi Experts,

I have faced with a challenge and I am stuck. Need some expert advise. I am developing a custom search help for GL account. Inside the search help exit I have to know what is the account assignment category of the accounting line i am currently accessing in WEB UI. for example i have one item in SC and there is a cost distribution between cost center and WBS element. Now i want to access GL account search help from second line in the account assignment ( ie from line having WBS as Acc Assignment).

one approach that i can think of is Enhance Accounting WD component and capture the details in a static attribute of a custom class and access them inside the search help exit. I know this will work. But i am looking for more clean approach.

I saw below code in WD comp method GET_BO_INFO of component controller.

lo_task_container = /sapsrm/cl_ch_wd_taskcont_fact=>get_task_container_instance( ).

CHECK lo_task_container IS BOUND.

* Get the BO type

ev_bo_type = lo_task_container->get_bo_type( ).

* Get the BO mapper, BO GUID, and item GUID of the lead selection

CASE ev_bo_type.

WHEN /sapsrm/if_pdo_obj_types_c=>gc_pdo_shop.

lo_bom_sc ?= lo_task_container->get_bom_sc( ).

ev_hdr_guid = lo_bom_sc->/sapsrm/if_cll_bo_mapper~get_bo_guid( ).

ev_item_guid = lo_bom_sc->/sapsrm/if_cll_bo_mapper~items_get_lead_selection( ).

I am not sure if this works. But even if this works I can not get the exact accounting line that the user is currently processing. Any ideas????