Application Development 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: 

How to create table feilds has Drop Down list?

Former Member
0 Kudos

Hi Experts!

I want to create the table feilds has a drop down list. Can Any body advise me.

Advance thanks,

vikram.c.

10 REPLIES 10

Former Member
0 Kudos

Hi,

Would u please repeat the question clearly

Thanks

Kiran

Bharathi_j
Explorer
0 Kudos

HI,

Do u mean that particular field values should be chosen from drop down list?

If so add value range for domain of that particular field and apply values over there,so that u can select anyone of those values when u add entries to that table...

Regards,

Bharathi.

Former Member
0 Kudos

Hello vikram,

Make use of the sample report:

<b>demo_dynpro_dropdown_listbox</b>

Regards,

Vasanth

Former Member
0 Kudos

Hi Vikram,

Here, in this program I have shown that how to create a DROP DOWN BOX , and how to make our own list in the DROP DOWN BOX.

Here, the main Funtion Module required is " VRM_SET_VALUES ".

<b>Just, Copy paste this code.You will know lot many things about this Drop

Down box.</b>

TYPE-POOLS vrm.

*"Table declarations...................................................

TABLES sscrfields.

*"Table declarations...................................................

PARAMETERS:

p_connid TYPE sflight-carrid AS LISTBOX

VISIBLE LENGTH 10 USER-COMMAND box,

p_value TYPE i MODIF ID QWR.

*" Data declarations...................................................

"----


  • Work variables *

"----


DATA:

w_char(20) TYPE c,

w_flag TYPE i.

"----


  • INITIALIZATION. EVENT *

"----


INITIALIZATION.

"----


  • Internal table to hold delivery header data *

"----


DATA:

t_table TYPE

STANDARD TABLE

OF vrm_value,

vrm_values1 LIKE LINE OF t_table.

.

  • DATA:

  • vrm_values1 TYPE vrm_value.

vrm_values1-key = '1'.

vrm_values1-text = 'sap'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = '2'.

vrm_values1-text = 'testing'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = '3'.

vrm_values1-text = 'java'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = '4'.

vrm_values1-text = '.net'.

APPEND vrm_values1 TO t_table.

vrm_values1-key = '5'.

vrm_values1-text = 'vc++'.

APPEND vrm_values1 TO t_table.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'p_connid'

values = t_table

  • EXCEPTIONS

  • ID_ILLEGAL_NAME = 1

  • OTHERS = 2

.

"----


  • AT SELECTION SCREEN OUTPUT EVENT *

"----


AT SELECTION-SCREEN OUTPUT.

*IF sy-ucomm = 'BOX'.

if w_flag = 2.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'QWR'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

"----


    • AT SELECTION-SCREEN EVENT *

"----


AT SELECTION-SCREEN.

w_char = sscrfields-ucomm.

if sy-ucomm = 'BOX'.

w_flag = 2.

endif.

  • CHECK w_char IS INITIAL.

"----


  • END-OF-SELECTION EVENT *

"----


END-OF-SELECTION.

IF w_char = 'BOX'.

WRITE 'Function code triggered.'.

ELSE.

WRITE 'Function code not triggered.'.

ENDIF.

IF sy-subrc <> 0.

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

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

WRITE 'sucess message'.

ELSE.

WRITE 'failure message'.

ENDIF.

Reward,if helpful.

Regards,

V.Raghavender.

Message was edited by:

Raghavender Vadakattu

Former Member
0 Kudos

Hi Vikram,

You must be using ALV for this.

so use the function module reuse_alv_hierseq_list_display

and pass the parameters accordingly.

Try this and let me know.

Former Member
0 Kudos

Hi,

1. Create the table control with the field type dropdown list.

2. Put the dropdwn list to be displayed in an internal table.

3. Call FM VRM_SET_VALUES . Pass the itab value with key.

Regards

Rusidar

Former Member
0 Kudos

Hi

I want to create a Dynamic Drop down list that should be an Editable,after editing that i need to save.

0 Kudos

Hi Vikram,

How exactly do u to want create DROP DOWN BOX .

You used word the " dynamic ".

IS the following procedure ok for you :

1. I will provide one select-option on the selection screen.

2.In that, you can provide as many values as you want.

3.Then,Press ENTER.

4.Now,you will get the field on the selection screen with the values provided by

You.

5.Is it ok for you.

<b>Reply, meanwhile you copy paste my code which has posted just now...</b>

Regards,

V.Raghavender.<b></b>

Message was edited by:

Raghavender Vadakattu

0 Kudos

hi Raghavender Vadakattu

I have used your code , what i need is in run time i need to change the drop down list , Example i want change SAP has ERP.

thanks

vikram.c

0 Kudos

hi vikram

what actually want to display. Do you need this field in table control or a field which can be chosen from search help.