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

Regarding Dropdown Box....

Former Member
0 Likes
565

Hi

I need to develop a screen which will have 2 dropdown boxes, around 15 input fields and 3 push buttons.

I have defined a dropdown box referring ABAPDOCU codes and guidelines from SDN Gurus...

But the problem is, i am unable to select a particular value in the drop down box.

Ex:

My dropdown box is having 3 values... "CREATE", "CHANGE" and "DELETE".

By default the word "CHANGE" is displaying in the box.

I am unable to select other options...

Code that i wrote as follows...

DATA DECLARATION PART

type-pools : vrm.

**-- Internal Table for Request type

data : it_status1 type VRM_VALUES,

value like line of it_status1,

name type vrm_id.

module STATUS_1000 output.

SET PF-STATUS '1000'.

*****-- Drop down Box for Request Type

name = 'demof4help-connid'.

CLEAR demof4help-connid.

value-text = 'CREATE'.

append value to it_status1.

value-text = 'CHANGE'.

append value to it_status1.

value-text = 'DELETE'.

append value to it_status1.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = it_status1.

endmodule. " STATUS_1000 OUTPUT

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
539

Hi Pavan,

Check this code.

p_inq LIKE VBAK-VBELN AS LISTBOX VISIBLE LENGTH 8.

SELECT vbeln

FROM VBAK

INTO CORRESPONDING FIELDS OF TABLE li_tmp

WHERE vbeln NE space.

IF NOT li_tmp[] IS INITIAL.

CLEAR lws_n.

SORT li_tmp BY vbeln.

DELETE ADJACENT DUPLICATES FROM li_tmp.

LOOP AT li_tmp.

CLEAR wa_values.

<b>wa_values-key = li_tmp-vbeln.</b>

wa_values-text = li_tmp-vbeln.

APPEND wa_values TO i_values.

ENDLOOP.

ENDIF.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'P_INQ'

values = i_values

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

Reward if helpful.

Regards,

Tushar

4 REPLIES 4
Read only

Former Member
0 Likes
539

Hi Pavan,

we have to add the key also along with the text....

say...

*--Table declaration

IT_LIST TYPE VRM_VALUES," table to store values of listbox

*--Structure declaration

WA_LIST LIKE LINE OF IT_LIST,

*--Variable declaration

V_NAME TYPE VRM_ID, " to store Id of Value Set

*--populating the values for the list box

WA_LIST-TEXT = 'P'.

WA_LIST-KEY = 'P'.

APPEND WA_LIST TO IT_LIST.

CLEAR WA_LIST.

WA_LIST-TEXT = 'H'.

WA_LIST-KEY = 'H'.

APPEND WA_LIST TO IT_LIST.

CLEAR WA_LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = V_NAME

VALUES = IT_LIST.

Regards,

Vidya.

Read only

Former Member
0 Likes
539

<b>name = 'DEMOF4HELP-CONNID'.</b>

Try giving the name in caps.

Regards,

Ravi

Read only

Former Member
0 Likes
539

Hello Pavan,

Your code looks ok, did u check with the properties of the listbox, try to compare this with the abapdocu program list box properties. You may see the mistake

Thanks,

Thirumal

Read only

Former Member
0 Likes
540

Hi Pavan,

Check this code.

p_inq LIKE VBAK-VBELN AS LISTBOX VISIBLE LENGTH 8.

SELECT vbeln

FROM VBAK

INTO CORRESPONDING FIELDS OF TABLE li_tmp

WHERE vbeln NE space.

IF NOT li_tmp[] IS INITIAL.

CLEAR lws_n.

SORT li_tmp BY vbeln.

DELETE ADJACENT DUPLICATES FROM li_tmp.

LOOP AT li_tmp.

CLEAR wa_values.

<b>wa_values-key = li_tmp-vbeln.</b>

wa_values-text = li_tmp-vbeln.

APPEND wa_values TO i_values.

ENDLOOP.

ENDIF.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'P_INQ'

values = i_values

EXCEPTIONS

id_illegal_name = 1

OTHERS = 2.

Reward if helpful.

Regards,

Tushar