Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table control drop down list

Former Member
0 Likes
2,189

HI ,

I have the case of getting one drop down list of two fixed values (YES NO) in one of the fields of the table control. what I did is I went to the screen painter and in that particular field I have already activated the attribute for listbox with key as I need only those 2 values to be input .

then in the PBO am using this function module

DATA: it_shelp TYPE vrm_values,

wa_shelp LIKE LINE OF it_shelp.

wa_shelp-key = '1'.

wa_shelp-text = 'YES'.

APPEND wa_shelp TO it_shelp.

CLEAR wa_shelp.

wa_shelp-key = '2'.

wa_shelp-text = 'NO'.

APPEND wa_shelp TO it_shelp.

CLEAR wa_shelp.

PROCESS BEFORE OUTPUT.

module searchhelp.

MODULE searchhelp OUTPUT.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'WA_UI-ZZ_ACCOUNT_TYPE' This is the table control field name where I need the Dropdown list

values = it_shelp

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDMODULE. " searchhelp OUTPUT

But still am not getting the drop down .

Even I have tried with the 2nd option

PROCESS ON VALUE-REQUEST.

FIELD : wa_ui-zz_account_type MODULE searchhelp.

&----


*& Module searchhelp INPUT

&----


  • text

----


MODULE searchhelp INPUT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'WA_UI-Z_ACCOUNT_TYPE'

  • PVALKEY = ' '

DYNPPROG = sy-repid

DYNPNR = sy-dynnr

DYNPROFIELD = 'WA_UI-ZZ_ACCOUNT_TYPE'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = it_shelp

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDMODULE. " searchhelp INPUT

this is also not working .. please let me know how to add the drop down list

13 REPLIES 13
Read only

Former Member
0 Likes
1,507

Hi Surya,

Check this program RSDEMO_TABLE_CONTROL.

or

In PAI...

PROCESS ON VALUE-REQUEST.

FIELD wa-field MODULE xyz. "field - set this field as list box in screen painter.

MODULE xyz INPUT.

wa-field = 'YES'.

APPEND wa TO itab.

wa-field = 'NO'.

APPEND wa TO itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'FIELD'

value_org = 'S'

TABLES

value_tab = itab.

ENDMODULE.

Regards,

Goutham.

Read only

0 Likes
1,507

HI In the program it is not creating the list it is taking from the dictionary.

please check it . and I have already tried the code which you are suggesting which is not working

It is not showing me the drop down list as I mentioned above I have already tried this one also

Edited by: surya nanda on Jan 20, 2009 11:49 AM

Read only

0 Likes
1,507

Hi,

The code using VRM_SET_VALUES looks correct.

Is there a type conflict between the field 'WA_UI-ZZ_ACCOUNT_TYPE' & the text field you are putting yes/no values? The field 'WA_UI-ZZ_ACCOUNT_TYPE' should be of type char/string to be compatible.

Read only

0 Likes
1,507

HI Sonali there is no type conflict

In my output am not even getting the drop down list icon though I have selected the attribute in the screen

VRM set is not at all working can anybody answer to this ?

Read only

Former Member
0 Likes
1,507

hi

try to put the key and value fileds to wa_shelp withih the search help OUTPUT like below...

pls try and reply back.

DATA: it_shelp TYPE vrm_values,

wa_shelp LIKE LINE OF it_shelp.

PROCESS BEFORE OUTPUT.

module searchhelp.

MODULE searchhelp OUTPUT.

wa_shelp-key = '1'.

wa_shelp-text = 'YES'.

APPEND wa_shelp TO it_shelp.

CLEAR wa_shelp.

wa_shelp-key = '2'.

wa_shelp-text = 'NO'.

APPEND wa_shelp TO it_shelp.

CLEAR wa_shelp.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'WA_UI-ZZ_ACCOUNT_TYPE' This is the table control field name where I need the Dropdown list

values = it_shelp

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDMODULE. " searchhelp OUTPUT

if its not working , put the values that u need to display in list box in an itab ...

so iterate the itab and populate the it_shelp .

try it also

thank you

regards

rajye

Edited by: Rajeshwari P on Jan 20, 2009 12:01 PM

Read only

0 Likes
1,507

Hi Rajeshwari,

Nope not working

Not even getting the Drop down icon in my list output

Read only

0 Likes
1,507

hi

yeh, have u selected listbox option ,while designing it in screen...

ie have u set the attribute for the text field as listbox

Read only

0 Likes
1,507

HI Rajeshwari ,

Yes I have already set the attribute. as I have mentioned in the beginning itself as this is the intial thing which we need to do . am quite surprised why even the drop down icons also not appearing in the table control output screen.

Read only

0 Likes
1,507

are you able to see the listbox in screen painter in table control (while designing)?.

can you send the flow logic.

Read only

0 Likes
1,507

HI Satish ,

Yes I can see the icon set in the column while setting the attribute on the screen

but after calling the function module and once it is coming to the screen it is not showing any drop down.

Read only

0 Likes
1,507

HI All,

Cant we create Drop down in a table control

If yes can anyone answer how to create our own drop down list and add in the table control ?

Read only

0 Likes
1,507

Hi,

remove all your code(Function module related) and execute, check whether the dropdown list is appearing on the output or not. if it comes send your code along with screen flow logic.

Read only

0 Likes
1,507

its possible to do that..Becoz in the link below a person have said he placed listbox in table control ..but he wants to make more enhancements ...

plz check it

http://www.sapfans.com/forums/viewtopic.php?f=13&t=306067

surya , if ur problem is resolved , pls get back here with right solution..

Edited by: Rajeshwari P on Jan 21, 2009 5:50 AM