cancel
Showing results for 
Search instead for 
Did you mean: 

Job Title Drop Down UI element in Web Dynpro for ABAP View

Former Member
0 Kudos

Developers,

Im currently developing a dynpro app to mimic PA30 and PA40 Transactions. I'm currently developing the update contractor view, which will pull the information of a given contractor (using BAPI_EMPLOYEE_GETDATA).

Right now, I need to create a drop down list UI element linked to table T528T. Not only that, but the drop down should filter the table and display entries for Job Text (STLTX) only with the prefix "Contractor". Not only that, but the list should automatically default to the value of the contractors current Job Text (again, using the JOBTXT from BAPI_EMPLOYEE_GETDATA).

All of these values will eventually be passed into Importing fields of a custom function module that I'm currently working on. These views are just displaying data and receiving data into the importing attributes.

Any suggestions would be greatly appreciated. Point will be rewarded accordingly. Thanks again.

JD

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Developers,

>

>

> Right now, I need to create a drop down list UI element linked to table T528T. Not only that, but the drop down should filter the table and display entries for Job Text (STLTX) only with the prefix "Contractor". Not only that, but the list should automatically default to the value of the contractors current Job Text (again, using the JOBTXT from BAPI_EMPLOYEE_GETDATA).

>

>

> JD

I don't see anything described here that can't be acomplished with the normal DropDown UI elements. Keep in mind that the UI element isn't going do the filter for the prefix "Contractor". You will have to do that in your coding. You will get al lthe job texts back from the BAPI and you will need to loop through then and perform the check for the prefix and then only copy those items into the context node that you bind to the DropDown that have the correct prefix. You can set the default value by either setting attribute that is bound to your selectedKey (for DDLBByKey) or setting the leadSelection (for DDLBByIndex). You probably want to read up on the binding differences between the two to see which is the better fit for your situation.

http://help.sap.com/saphelp_nw70/helpdata/EN/bb/69b441b0133531e10000000a155106/frameset.htm

Former Member
0 Kudos

I follow what you're saying. However, I'm still unable to even do the first step of reading in the values of all of the Job titles into the drop down. I'm using FM RH_GET_ALL_JOBS_IN_PLVAR and binding my dropdown (by index) to the DESCRIB Attribute created when i do the service call wizard to create the method for the FM. Do I have to write code to read these values into the binded UI element?

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Use DropDownByKey and bind it to your context attribute PLANS

in WDDOINIT code as follows

data: lt_valueset type table of wdr_context_attr_value,

ls_valueset type wdr_context_attr_value,

lr_node type ref to if_wd_context_node,

lr_nodeinfo type ref to if_wd_context_node_info.

lr_node = wd_context->get_child_node( '<node name>' ).

lr_nodeinfo = lr_node->get_node_info( ).

*select * from T528T into table lt_T528T where sprsl = sy-langu.

*Instead of select query call your function module and get the data into an internal table

loop at lt_T528T into lsT528T.

ls_valueset-value = ls_T528T-plans.

ls_valueset-text = ls_T528T-plstx.

append ls_valueset to lt_valueset.

lr_nodeinfo->set_attribute_value_set(

exporting

name = 'PLANS'

value_set = lt_valueset ).

Abhi

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

See DropDownByKey View in WDR_TEST_EVENTS standard web dynpro component.

Abhi