on 07-20-2012 5:51 AM
Hi Experts,
In the selection screen of my object I need to provide the users with a field Organizational Unit which should have an search help associated with it that would enable the users to perform a hierarchy search and search by org name. I tried searching but though there are similar R/3 search helps they cannot be used from within WDA. I came across an article by Tamil Selvan detailing on how to create such a search help but the image attachments are somehow missing from the article. Did anyone ever have to design such a search help or would have any idea about a standard search help which I can re-use for hierarchy search? And how can I create a collective search help from within WDA? (i.e., providing both a hierarchy search and search by org name)
Regards,
Uday
Hi Uday,
I had the same requirement and chose to create a Freely Programmed search help modeled after SAPgui search help, HRBAS00OBJID2. For examples of Freely Programmed search helps, see WDA components DEMO_VALUE_HELP (context attribute SFLIGHT-CONNID) and FREE_VALUE_HELP. Since you have full control over the Freely Programmed search help, you can choose to have it return whatever data you need, whether it is one Org Unit, multiple Org Units, a structure, etc.
The usage:
The Freely Programmed search help is a separate web dynpro component:
method supply_structure .
data lt_structure type wd_this->elements_structure.
data ls_structure like line of lt_structure.
data lt_objec type standard table of objec.
data lt_struc type standard table of struc.
data lv_date_string type char10.
field-symbols: <o> type objec,
<s> type struc.
* Read the organizational structure
call function 'RH_STRUC_GET'
exporting
act_otype = 'O' " Organizational unit
act_objid = '12345678' " Top level organization
act_wegid = 'ORGEH' " Organizational structure
tables
result_objec = lt_objec
result_struc = lt_struc
exceptions
no_plvar_found = 1
no_entry_found = 2
others = 3.
* Map organizational structure data to the context table
loop at lt_struc assigning <s>.
read table lt_objec assigning <o> with key realo = <s>-objid.
check sy-subrc is initial.
ls_structure-seqnr = <s>-seqnr.
ls_structure-pup = <s>-pup.
ls_structure-plvar = <o>-plvar.
ls_structure-otype = <o>-otype.
ls_structure-objid = <o>-objid.
ls_structure-begda = <o>-begda.
ls_structure-endda = <o>-endda.
ls_structure-istat = <o>-istat.
ls_structure-histo = <o>-histo.
ls_structure-short = <o>-short.
ls_structure-stext = <o>-stext.
ls_structure-realo = <o>-realo.
concatenate <o>-otype <o>-objid
into ls_structure-objid_extended separated by space.
* Does the org unit have children?
if <s>-pdown is initial.
ls_structure-is_leaf = abap_true.
endif.
* We attempt to mimic search help HRBAS00OBJID2 as closely as possible
if <o>-endda = '99991231'.
ls_structure-endda_text = 'Unlimited'.
else.
write <o>-endda to lv_date_string mm/dd/yyyy.
ls_structure-endda_text = lv_date_string.
endif.
append ls_structure to lt_structure.
clear: ls_structure.
endloop.
* Set the table in the context
node->bind_table(
new_items = lt_structure
set_initial_elements = abap_true ).
endmethod.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amy,
Thank you very much for your patient posting. Your inputs were very useful. Love this new feature of SCN where we can even share the UI snapshots.
Could you please clarify as to which context attributes you are binding the below properties of the TreeByKeyTableColumn:
expanded
isLeaf
parentKey
rowKey
Also which attributes are the ID, CODE, VALID_FROM & VALID_TO columns of the table referring to.
Regards,
Uday
Hi Uday,
Properties of the TreeByKeyTableColumn are bound as follows.
Columns of the Table are bound as follows.
Cheers,
Amy
Hi Uday,
I also got same requirement few weeks back.... I solved this issue. To do above requirement pls fallow below steps.
->Create Tree structure in webdynpro abap using tree element in one component.
-> Create Another component and create input field and make search help by using freelyprogrammed search help...
If u have any doubs post here....
Regards,
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.